source: flair-src/trunk/lib/FlairSimulator/src/unexported/Model_impl.h@ 15

Last change on this file since 15 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 3.1 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2013/03/25
6// filename: Model_impl.h
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: classe definissant un modele a simuler
14//
15/*********************************************************************/
16
17#ifndef MODEL_IMPL_H
18#define MODEL_IMPL_H
19
20#include <Thread.h>
21#include <vrpn_Tracker.h>
22#include "Model.h"
23#include "Quaternion.h"
24
25namespace flair {
26namespace core {
27class cvmatrix;
28class Mutex;
29class ConditionVariable;
30}
31namespace gui {
32class TabWidget;
33class CheckBox;
34class DoubleSpinBox;
35class SpinBox;
36class Vector3DSpinBox;
37}
38namespace simulator {
39class Simulator;
40class AnimPoursuite;
41}
42}
43
44#ifdef GL
45#include <Vector3D.h>
46#include <IMeshSceneNode.h>
47
48namespace irr {
49namespace scene {
50class ISceneManager;
51class ITriangleSelector;
52class IMetaTriangleSelector;
53class ISceneNodeAnimatorCollisionResponse;
54class ICameraSceneNode;
55}
56}
57#endif
58
59#ifdef GL
60class Model_impl : public irr::scene::ISceneNode,
61 public flair::core::Thread,
62 private vrpn_Tracker
63#else
64class Model_impl : public flair::core::Thread,
65 private vrpn_Tracker
66#endif
67 {
68public:
69#ifdef GL
70 Model_impl(flair::simulator::Model *self, std::string name,
71 irr::scene::ISceneManager *scenemanager, vrpn_Connection_IP *vrpn);
72#else
73 Model_impl(flair::simulator::Model *self, std::string name,
74 vrpn_Connection_IP *vrpn);
75#endif
76 ~Model_impl();
77
78#ifdef GL
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"); };
86
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;
99#endif
100 void mainloop(void);
101
102 flair::gui::TabWidget *tabwidget;
103 flair::gui::DoubleSpinBox *dT;
104
105private:
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;
112
113 struct timeval _timestamp;
114 void Run(void);
115 flair::core::Quaternion ComputeInitRotation(flair::core::Quaternion quat_in);
116#ifdef GL
117 void CollisionHandler(void);
118
119 irr::scene::IMetaTriangleSelector *meta_selector;
120 irr::scene::ISceneNodeAnimatorCollisionResponse *anim;
121
122 bool position_init;
123
124 flair::core::ConditionVariable *cond;
125 int sync_count;
126
127 flair::core::Mutex *collision_mutex;
128 bool collision_occured;
129 flair::core::Vector3D collision_point;
130#endif
131};
132
133#endif // MODEL_IMPL_H
Note: See TracBrowser for help on using the repository browser.