- Timestamp:
- 12/09/03 15:07:44 (10 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osghangglide/osghangglide.cpp
r1844 r2517 27 27 extern osg::Node *makeClouds( void ); 28 28 29 struct MoveEarthySkyWithEyePointCallback : public osg::Transform::ComputeTransformCallback 29 class MoveEarthySkyWithEyePointTransform : public osg::Transform 30 30 { 31 public: 31 32 /** Get the transformation matrix which moves from local coords to world coords.*/ 32 virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix, const osg::Transform*,osg::NodeVisitor* nv) const33 virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const 33 34 { 34 35 osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv); … … 42 43 43 44 /** Get the transformation matrix which moves from world coords to local coords.*/ 44 virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix, const osg::Transform*,osg::NodeVisitor* nv) const45 virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const 45 46 { 47 std::cout<<"computing transform"<<std::endl; 48 46 49 osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv); 47 50 if (cv) … … 68 71 69 72 // use a transform to make the sky and base around with the eye point. 70 osg::Transform* transform = new osg::Transform;73 osg::Transform* transform = new MoveEarthySkyWithEyePointTransform; 71 74 72 75 // transform's value isn't knowm until in the cull traversal so its bounding … … 76 79 // this node or any other branch above this transform. 77 80 transform->setCullingActive(false); 78 79 // set the compute transform callback to do all the work of80 // determining the transform according to the current eye point.81 transform->setComputeTransformCallback(new MoveEarthySkyWithEyePointCallback);82 81 83 82 // add the sky and base layer.
