1 #ifndef ABSTRACTTURTLE_H_
2 #define ABSTRACTTURTLE_H_
25 const osg::Vec3d
HeadVec(0.0,1.0,0.0);
26 const osg::Vec3d
UpVec(1.0,0.0,0.0);
27 const osg::Vec3d
LeftVec(0.0,0.0,1.0);
28 const osg::Vec3d
Center(0.0,0.0,0.0);
30 const osg::Vec4d
White(1.0,1.0,1.0,1.0);
130 virtual void drawFrame( osg::Matrixd & matrix, osg::Vec4d * color = NULL ) = 0;
138 virtual void drawVector(
const osg::Vec3d & vector, osg::Matrixd & matrix, osg::Vec4d & color)
141 double l = vector.length();
142 osg::Cylinder * cylinder =
new osg::Cylinder(vector * s * (l/2.0f) * matrix,s * 0.01f,s * l);
143 osg::Cone * cone =
new osg::Cone(vector * s * ( l + 0.03f ) * matrix, s * 0.03f,s * 0.15f);
145 osg::Matrixd m = osg::Matrixd::rotate(
LeftVec, vector ) * matrix;
146 cylinder->setRotation( m.getRotate() );
147 cone->setRotation( m.getRotate() );
149 osg::ShapeDrawable * shape;
150 shape =
new osg::ShapeDrawable(cylinder);
151 shape->setColor( color );
152 geode->addDrawable( shape );
154 shape =
new osg::ShapeDrawable(cone);
156 geode->addDrawable( shape );
170 return osg::DegreesToRadians( angle );
194 virtual int turnLeft(std::vector<Parameter> & p) = 0;
203 virtual int turnRight(std::vector<Parameter> & p) = 0;
212 virtual int pitchDown(std::vector<Parameter> & p) = 0;
221 virtual int pitchUp(std::vector<Parameter> & p) = 0;
230 virtual int rollLeft(std::vector<Parameter> & p) = 0;
239 virtual int rollRight(std::vector<Parameter> & p) = 0;
325 virtual int drawForward(std::vector<Parameter> & p) = 0;
340 virtual int moveForward(std::vector<Parameter> & p) = 0;