1 | #include "ExampleApplication.h" |
---|
2 | #include "OgreOde_Core.h" |
---|
3 | #include "OgreOde_Prefab.h" |
---|
4 | #include "OgreOde_Loader.h" |
---|
5 | |
---|
6 | class LandscapeFrameListener : public ExampleFrameListener, |
---|
7 | public OgreOde::TerrainGeometryHeightListener, |
---|
8 | public OgreOde::CollisionListener |
---|
9 | { |
---|
10 | public: |
---|
11 | LandscapeFrameListener(Ogre::RenderWindow* win, Ogre::Camera* cam, Ogre::Root* root); |
---|
12 | ~LandscapeFrameListener(); |
---|
13 | bool frameStarted(const Ogre::FrameEvent& evt); |
---|
14 | void changeCar(); |
---|
15 | |
---|
16 | private: |
---|
17 | void updateInfo(); |
---|
18 | OgreOde::StepHandler *_stepper; |
---|
19 | OgreOde_Prefab::Vehicle *_vehicle; |
---|
20 | Ogre::RaySceneQuery *_ray_query; |
---|
21 | Ogre::Ray ray; |
---|
22 | char _drive; |
---|
23 | OgreOde_Loader::DotLoader *dotOgreOdeLoader; |
---|
24 | |
---|
25 | virtual Ogre::Real heightAt(const Ogre::Vector3& position); |
---|
26 | virtual bool collision(OgreOde::Contact* contact); |
---|
27 | |
---|
28 | protected: |
---|
29 | Ogre::SceneManager *mSceneMgr; |
---|
30 | OgreOde::World *_world; |
---|
31 | OgreOde::TerrainGeometry *_terrain; |
---|
32 | Ogre::Real _time_step; |
---|
33 | size_t _average_num_query; |
---|
34 | }; |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | class LandscapeApplication : public ExampleApplication |
---|
39 | { |
---|
40 | public: |
---|
41 | LandscapeApplication(); |
---|
42 | ~LandscapeApplication(); |
---|
43 | |
---|
44 | protected: |
---|
45 | virtual bool setup(void); |
---|
46 | virtual void chooseSceneManager(void); |
---|
47 | virtual void setupResources(void); |
---|
48 | virtual void createCamera(void); |
---|
49 | void createScene(void); |
---|
50 | void createFrameListener(void); |
---|
51 | |
---|
52 | |
---|
53 | }; |
---|
54 | |
---|