11 #include <osgText/Font>
13 using namespace vrecko;
15 namespace APShootingSimulation
64 virtual bool initialize(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode *parameters = NULL);
69 virtual void update(
void);
78 osg::ref_ptr<vrecko::EnvironmentObject> resolveIntersections(osg::Vec3 &vector,
80 std::vector<osg::Node*> **nodePath = NULL);
91 bool addObject(osg::ref_ptr<vrecko::EnvironmentObject> &obj,
const std::string& geoPath);
96 void setCrosshairPos();
103 void moveTarget(osg::Vec3 currentTargetPos);
108 void testAndHandleHit();
118 static const std::string START_BUTTONS;
121 static const std::string PATH_WALL;
122 static const std::string PATH_CROSSHAIR;
123 static const std::string PATH_TARGET;
125 #define NUM_TARGETS 3
126 static const std::string PATH_TARGET_DAMAGED[];
129 osg::ref_ptr<vrecko::EnvironmentObject> wall;
130 osg::ref_ptr<vrecko::EnvironmentObject> target;
131 osg::ref_ptr<vrecko::EnvironmentObject> crosshair;
132 osg::ref_ptr<vrecko::EnvironmentObject> damagedTargets[
NUM_TARGETS];
135 unsigned int dmgTargetIndex;
137 unsigned int targetPosIndex;
140 osg::Vec2 _mouse2DVector;
141 osg::Vec3 _aimVector;
142 osg::Vec3 _standingPosition;
143 osg::Vec3 _opti3DVector0;
144 osg::Vec3 _opti3DVector1;
146 static const float CROSSHAIR_DIFF;
147 static const float DEFAULT_Z_GRID;
151 static const int NUM_TARGETS_POS;
152 static const float X_TARGETS[];
153 static const float Y_TARGETS[];
155 static const float MIN_X;
156 static const float MAX_X;
157 static const float MIN_Y;
158 static const float MAX_Y;
160 static const float TARGET_INITIAL_SPEED;
161 static const float TARGET_SPEED_INCREASE_VALUE;
169 static const int MAX_LEVEL;
172 std::string scoreString;
176 osg::ref_ptr<osgText::Text> startText;
177 osg::ref_ptr<osg::Geode> startTextGeode;
178 osg::ref_ptr<osgText::Text> scoreText;
179 osg::ref_ptr<osg::Geode> scoreTextGeode;
180 osg::ref_ptr<osgText::Font> textFont;
183 std::string timeString;
185 static const int STARTING_TIME;
187 osg::Timer_t beginningTime;
188 osg::Timer_t currentTime;
189 osg::Timer_t startOfMove;
190 osg::Timer_t previousTick;
193 static const double MOVE_UP_SPEED;
194 static const double MOVE_DOWN_SPEED;