Show
Ignore:
Timestamp:
12/09/03 15:07:44 (11 years ago)
Author:
robert
Message:

Removed osg::Transform::ComputeTransformCallback? from osg::Transform.

Updated various dependant files to reimplemt callbacks as Transform subclasses.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osghangglide/osghangglide.cpp

    r1844 r2517  
    2727extern osg::Node *makeClouds( void ); 
    2828 
    29 struct MoveEarthySkyWithEyePointCallback : public osg::Transform::ComputeTransformCallback 
     29class MoveEarthySkyWithEyePointTransform : public osg::Transform 
    3030{ 
     31public: 
    3132    /** 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) const  
     33    virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const  
    3334    { 
    3435        osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv); 
     
    4243 
    4344    /** 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) const 
     45    virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const 
    4546    { 
     47        std::cout<<"computing transform"<<std::endl; 
     48     
    4649        osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv); 
    4750        if (cv) 
     
    6871 
    6972    // 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; 
    7174 
    7275    // transform's value isn't knowm until in the cull traversal so its bounding 
     
    7679    // this node or any other branch above this transform. 
    7780    transform->setCullingActive(false); 
    78  
    79     // set the compute transform callback to do all the work of 
    80     // determining the transform according to the current eye point. 
    81     transform->setComputeTransformCallback(new MoveEarthySkyWithEyePointCallback); 
    8281 
    8382    // add the sky and base layer.