Changeset 15 in flair-src for trunk/lib/FlairSimulator/src/unexported/Model_impl.h
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/unexported/Model_impl.h
r10 r15 23 23 #include "Quaternion.h" 24 24 25 namespace flair 26 { 27 namespace core 28 { 29 class cvmatrix; 30 class Mutex; 31 class ConditionVariable; 32 } 33 namespace gui 34 { 35 class TabWidget; 36 class CheckBox; 37 class DoubleSpinBox; 38 class SpinBox; 39 class Vector3DSpinBox; 40 } 41 namespace simulator 42 { 43 class Simulator; 44 class AnimPoursuite; 45 } 25 namespace flair { 26 namespace core { 27 class cvmatrix; 28 class Mutex; 29 class ConditionVariable; 30 } 31 namespace gui { 32 class TabWidget; 33 class CheckBox; 34 class DoubleSpinBox; 35 class SpinBox; 36 class Vector3DSpinBox; 37 } 38 namespace simulator { 39 class Simulator; 40 class AnimPoursuite; 41 } 46 42 } 47 43 … … 50 46 #include <IMeshSceneNode.h> 51 47 52 namespace irr 53 { 54 namespace scene 55 { 56 class ISceneManager; 57 class ITriangleSelector; 58 class IMetaTriangleSelector; 59 class ISceneNodeAnimatorCollisionResponse; 60 class ICameraSceneNode; 61 } 48 namespace irr { 49 namespace scene { 50 class ISceneManager; 51 class ITriangleSelector; 52 class IMetaTriangleSelector; 53 class ISceneNodeAnimatorCollisionResponse; 54 class ICameraSceneNode; 55 } 62 56 } 63 57 #endif 64 58 65 59 #ifdef GL 66 class Model_impl : public irr::scene::ISceneNode,public flair::core::Thread,private vrpn_Tracker 60 class Model_impl : public irr::scene::ISceneNode, 61 public flair::core::Thread, 62 private vrpn_Tracker 67 63 #else 68 class Model_impl : public flair::core::Thread, private vrpn_Tracker 64 class Model_impl : public flair::core::Thread, 65 private vrpn_Tracker 69 66 #endif 70 {71 67 { 68 public: 72 69 #ifdef GL 73 Model_impl(flair::simulator::Model* self,std::string name,irr::scene::ISceneManager* scenemanager,vrpn_Connection_IP* vrpn); 70 Model_impl(flair::simulator::Model *self, std::string name, 71 irr::scene::ISceneManager *scenemanager, vrpn_Connection_IP *vrpn); 74 72 #else 75 Model_impl(flair::simulator::Model* self,std::string name,vrpn_Connection_IP* vrpn); 73 Model_impl(flair::simulator::Model *self, std::string name, 74 vrpn_Connection_IP *vrpn); 76 75 #endif 77 76 ~Model_impl(); 78 77 79 78 #ifdef GL 80 void OnRegisterSceneNode(void); 81 void render(void); 82 void Draw(void){printf("CA MARCHE PAS PUNAISE\r\n");ExtraDraw();}; 83 void ExtraDraw(void){printf("nope\r\n");}; 79 void OnRegisterSceneNode(void); 80 void render(void); 81 void Draw(void) { 82 printf("CA MARCHE PAS PUNAISE\r\n"); 83 ExtraDraw(); 84 }; 85 void ExtraDraw(void) { printf("nope\r\n"); }; 84 86 85 const irr::core::aabbox3d<irr::f32>& getBoundingBox(void) const 86 { 87 return box; 88 } 89 void UpdatePos(void); 90 void CheckCollision(void); 91 irr::scene::ITriangleSelector* TriangleSelector(void); 92 irr::scene::IMetaTriangleSelector* MetaTriangleSelector(void); 93 irr::core::aabbox3d<irr::f32> box; 94 void SynchronizationPoint(); 95 irr::scene::ICameraSceneNode* camera; 96 flair::simulator::AnimPoursuite* animator; 97 irr::scene::ITriangleSelector* selector; 87 const irr::core::aabbox3d<irr::f32> &getBoundingBox(void) const { 88 return box; 89 } 90 void UpdatePos(void); 91 void CheckCollision(void); 92 irr::scene::ITriangleSelector *TriangleSelector(void); 93 irr::scene::IMetaTriangleSelector *MetaTriangleSelector(void); 94 irr::core::aabbox3d<irr::f32> box; 95 void SynchronizationPoint(); 96 irr::scene::ICameraSceneNode *camera; 97 flair::simulator::AnimPoursuite *animator; 98 irr::scene::ITriangleSelector *selector; 98 99 #endif 99 100 void mainloop(void); 100 101 101 102 102 flair::gui::TabWidget *tabwidget; 103 flair::gui::DoubleSpinBox *dT; 103 104 104 105 flair::gui::Vector3DSpinBox*pos_init;106 107 108 flair::simulator::Model*self;109 flair::core::cvmatrix*output;110 105 private: 106 flair::gui::Vector3DSpinBox *pos_init; 107 flair::gui::SpinBox *yaw_init; 108 flair::gui::CheckBox *enable_opti; 109 flair::simulator::Model *self; 110 flair::core::cvmatrix *output; 111 flair::core::Mutex *states_mutex; 111 112 112 113 114 113 struct timeval _timestamp; 114 void Run(void); 115 flair::core::Quaternion ComputeInitRotation(flair::core::Quaternion quat_in); 115 116 #ifdef GL 116 117 void CollisionHandler(void); 117 118 118 irr::scene::IMetaTriangleSelector*meta_selector;119 irr::scene::ISceneNodeAnimatorCollisionResponse*anim;119 irr::scene::IMetaTriangleSelector *meta_selector; 120 irr::scene::ISceneNodeAnimatorCollisionResponse *anim; 120 121 121 122 bool position_init; 122 123 123 flair::core::ConditionVariable*cond;124 124 flair::core::ConditionVariable *cond; 125 int sync_count; 125 126 126 127 128 127 flair::core::Mutex *collision_mutex; 128 bool collision_occured; 129 flair::core::Vector3D collision_point; 129 130 #endif 130 131 131 }; 132 132
Note:
See TracChangeset
for help on using the changeset viewer.