13 #include <xercesc/parsers/XercesDOMParser.hpp>
14 #include <xercesc/dom/DOM.hpp>
15 #include <xercesc/sax/HandlerBase.hpp>
16 #include <xercesc/util/XMLString.hpp>
17 #include <xercesc/util/PlatformUtils.hpp>
21 #include <osg/Geometry>
23 #include <osg/ShapeDrawable>
24 #include <osg/PositionAttitudeTransform>
25 #include <osg/LineWidth>
26 #include <osg/LightModel>
27 #include <osg/ShadeModel>
28 #include <osg/PolygonMode>
33 using namespace vrecko;
34 using namespace vrecko;
36 namespace APCameraMovement {
38 #define CONTROL_POINT_RADIUS 1.0
39 #define CONTROL_POINT_COLOR osg::Vec4(1.0, 0.0, 0.0, 0.5)
41 #define VECTOR_POINT_RADIUS 1.0
42 #define VECTOR_POINT_COLOR osg::Vec4(0.0, 0.0, 1.0, 0.5)
44 #define CONTROL_LINE_WIDTH 1.0
45 #define CONTROL_LINE_COLOR osg::Vec4(0.0, 0.0, 1.0, 1.0)
47 #define PATH_LINE_WIDTH 1.0
48 #define PATH_LINE_COLOR osg::Vec4(1.0, 0.0, 0.0, 1.0)
50 #define DEFAULT_VECPW osg::Vec3(CONTROL_POINT_RADIUS*3, 0.0, 0.0)
51 #define DEFAULT_VECCPW osg::Vec3(-(CONTROL_POINT_RADIUS*3), 0.0, 0.0)
52 #define DEFAULT_CDIR osg::Quat(0.0, 0.0, 0.0, 1.0)
54 #define TOP_VECTOR osg::Vec3(0.0, 1.0, 0.0)
55 #define DIR_VECTOR osg::Vec3(0.0, 0.0, 1.0)
78 virtual void preInitialize();
81 virtual void postInitialize();
84 virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode *pParametersNode);
90 virtual void update();
104 controlPoints.push_back(p);
109 bool startAnimation();
110 bool stopAnimation();
111 bool updateActTime();
112 float convertActTimeToActPos();
113 bool updateAnimation(
float fActPos);
118 std::vector<ControlPoint> controlPoints;
121 std::vector<osg::Vec3> pathPoints;
128 osg::Timer_t lastTimerTick;
143 float controlPointRadius;
144 osg::Vec4 controlPointColor;
146 float vectorPointRadius;
147 osg::Vec4 vectorPointColor;
149 float controlLineWidth;
150 osg::Vec4 controlLineColor;
153 osg::Vec4 pathLineColor;