Changeset 9031 for OpenSceneGraph/trunk/examples/osgrobot/osgrobot.cpp
- Timestamp:
- 10/14/08 18:44:14 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgrobot/osgrobot.cpp
r9029 r9031 152 152 { 153 153 case 'q': 154 rotate( M_PIl/180, joint1);154 rotate(osg::PI/180, joint1); 155 155 return true; 156 156 case 'a': 157 rotate(- M_PIl/180, joint1);157 rotate(-osg::PI/180, joint1); 158 158 return true; 159 159 case 'w': 160 rotate( M_PIl/180, joint2);160 rotate(osg::PI/180, joint2); 161 161 return true; 162 162 case 's': 163 rotate(- M_PIl/180, joint2);163 rotate(-osg::PI/180, joint2); 164 164 return true; 165 165 case 'e': 166 rotate( M_PIl/180, joint3);166 rotate(osg::PI/180, joint3); 167 167 return true; 168 168 case 'd': 169 rotate(- M_PIl/180, joint3);169 rotate(-osg::PI/180, joint3); 170 170 return true; 171 171 case 'r': 172 rotate( M_PIl/180, joint4);172 rotate(osg::PI/180, joint4); 173 173 return true; 174 174 case 'f': 175 rotate(- M_PIl/180, joint4);175 rotate(-osg::PI/180, joint4); 176 176 return true; 177 177 case 't': 178 rotate( M_PIl/180, joint5);178 rotate(osg::PI/180, joint5); 179 179 return true; 180 180 case 'g': 181 rotate(- M_PIl/180, joint5);181 rotate(-osg::PI/180, joint5); 182 182 return true; 183 183 case 'y': 184 rotate( M_PIl/180, joint6);184 rotate(osg::PI/180, joint6); 185 185 return true; 186 186 case 'h': 187 rotate(- M_PIl/180, joint6);187 rotate(-osg::PI/180, joint6); 188 188 return true; 189 189 } … … 251 251 osg::MatrixTransform* xTransform = new osg::MatrixTransform(); 252 252 previousJoint->addChild(xTransform); 253 osg::Matrix xRot = osg::Matrix::rotate( M_PI_2, 1.0, 0.0, 0.0);253 osg::Matrix xRot = osg::Matrix::rotate(osg::PI_2, 1.0, 0.0, 0.0); 254 254 xTransform->setMatrix(xRot); 255 255 osg::Geode* joint = new osg::Geode(); … … 259 259 osg::MatrixTransform* zTransform = new osg::MatrixTransform(); 260 260 osg::Matrix zTrans = osg::Matrix::translate( 0.0, 0.0, height); 261 osg::Matrix zRot = osg::Matrix::rotate( M_PI_2+jointAngle2, 0.0,0.0,1.0);261 osg::Matrix zRot = osg::Matrix::rotate(osg::PI_2+jointAngle2, 0.0,0.0,1.0); 262 262 zTransform->setMatrix(zTrans*zRot); 263 263 xTransform->addChild(zTransform); … … 275 275 osg::MatrixTransform* xTransform = new osg::MatrixTransform(); 276 276 previousJoint->addChild(xTransform); 277 osg::Matrix xRot = osg::Matrix::rotate( M_PI_2, 1.0,0.0,0.0);277 osg::Matrix xRot = osg::Matrix::rotate(osg::PI_2, 1.0,0.0,0.0); 278 278 xTransform->setMatrix(xRot); 279 279 osg::Geode* tube3 = new osg::Geode(); … … 295 295 osg::MatrixTransform* xTransform = new osg::MatrixTransform(); 296 296 previousJoint->addChild(xTransform); 297 osg::Matrix xRot = osg::Matrix::rotate(- M_PI_2, 1.0, 0.0, 0.0);297 osg::Matrix xRot = osg::Matrix::rotate(-osg::PI_2, 1.0, 0.0, 0.0); 298 298 xTransform->setMatrix(xRot); 299 299 if (showAxis) … … 332 332 previousJoint->addChild(xTransform); 333 333 xTransform->addChild(tube4); 334 osg::Matrix xRot= osg::Matrix::rotate( M_PI_2, 1,0,0);334 osg::Matrix xRot= osg::Matrix::rotate(osg::PI_2, 1,0,0); 335 335 xTransform->setMatrix(xRot); 336 336 height = 7.5; 337 337 osg::Matrix zTrans = osg::Matrix::translate(0,0,17.5); 338 osg::Matrix zRot = osg::Matrix::rotate(jointAngle4- M_PI_2, 0,0,1);338 osg::Matrix zRot = osg::Matrix::rotate(jointAngle4-osg::PI_2, 0,0,1); 339 339 340 340 osg::MatrixTransform* zTransform = new osg::MatrixTransform(); … … 373 373 osg::MatrixTransform* xTransform = new osg::MatrixTransform(); 374 374 previousJoint->addChild(xTransform); 375 osg::Matrix xRot= osg::Matrix::rotate(- M_PI_2, 1.0,0,0);375 osg::Matrix xRot= osg::Matrix::rotate(-osg::PI_2, 1.0,0,0); 376 376 xTransform->setMatrix(xRot); 377 377 xTransform->addChild(joint); … … 396 396 joint->addDrawable(new osg::ShapeDrawable(new osg::Cylinder(osg::Vec3(0.0f,0.0f,height/2),radius,height),hints)); 397 397 osg::MatrixTransform* xTransform = new osg::MatrixTransform(); 398 osg::Matrix xRot= osg::Matrix::rotate( M_PI_2, 1.0, 0.0, 0.0);398 osg::Matrix xRot= osg::Matrix::rotate(osg::PI_2, 1.0, 0.0, 0.0); 399 399 xTransform->setMatrix(xRot); 400 400 xTransform->addChild(joint); … … 453 453 previousJoint->addChild(mt); 454 454 455 osg::Matrix xMatrix = osg::Matrix::rotate(- M_PI_2, 0.0, 1.0, 0.0);455 osg::Matrix xMatrix = osg::Matrix::rotate(-osg::PI_2, 0.0, 1.0, 0.0); 456 456 mt->setMatrix(xMatrix); 457 457 … … 466 466 osg::MatrixTransform *yMt = new osg::MatrixTransform(); 467 467 previousJoint->addChild(yMt); 468 osg::Matrix yMatrix = osg::Matrix::rotate( M_PI_2, 1.0, 0.0, 0.0);468 osg::Matrix yMatrix = osg::Matrix::rotate(osg::PI_2, 1.0, 0.0, 0.0); 469 469 yMt->setMatrix(yMatrix); 470 470
