class SG_EXPORT osg::Transform

Transform - is group which all children are transformed by the the Transform's osg::Matrix.

Inheritance:


Public Methods

[more] Transform()
[more] Transform(const Transform&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more] Transform(const Matrix& matix)
[more] META_Node(Transform)
[more]void setReferenceFrame(ReferenceFrame rf)
Set the transform's ReferenceFrame, either to be realtive to its parent reference frame, or relative to an absolute coordinate frame.
[more]const ReferenceFrame getReferenceFrame() const
[more]void setComputeTransformCallback(ComputeTransformCallback* ctc)
Set the ComputerTransfromCallback which allows users to attach custom computation of the local transformation as seen by cull traversers and alike
[more]ComputeTransformCallback* getComputeTransformCallback()
Get the non const ComputerTransfromCallback
[more]const ComputeTransformCallback* getComputeTransformCallback() const
Get the const ComputerTransfromCallback
[more]inline const bool getLocalToWorldMatrix(Matrix& matrix, NodeVisitor* nv) const
Get the transformation matrix which moves from local coords to world coords.
[more]inline const bool getWorldToLocalMatrix(Matrix& matrix, NodeVisitor* nv) const
Get the transformation matrix which moves from world coords to local coords.
[more]void setMatrix(const Matrix& mat)
Set the transform's matrix
[more]inline const Matrix& getMatrix() const
Get the transform's matrix.
[more]void preMult(const Matrix& mat)
preMult transform
[more]void postMult(const Matrix& mat)
postMult transform

Public Members

[more]enum ReferenceFrame
[more]struct ComputeTransformCallback: public osg::Referenced
Callback attached to an Transform to specifiy how to compute the modelview transformation for the transform below the Transform node

Protected Fields

[more]ref_ptr<ComputeTransformCallback> _computeTransformCallback
[more]ReferenceFrame _referenceFrame
[more]ref_ptr<Matrix> _matrix
[more]mutable ref_ptr<Matrix> _inverse
[more]mutable bool _inverseDirty

Protected Methods

[more]virtual ~Transform()
[more]virtual const bool computeBound() const
Override's Group's computeBound.
[more]virtual const bool computeLocalToWorldMatrix(Matrix& matrix, NodeVisitor*) const
[more]virtual const bool computeWorldToLocalMatrix(Matrix& matrix, NodeVisitor*) const
[more]inline void computeInverse() const


Inherited from Group:

Public Methods

ovirtual void traverse(NodeVisitor& nv)
ovirtual bool addChild( Node* child )
ovirtual bool removeChild( Node* child )
ovirtual bool replaceChild( Node* origChild, Node* newChild )
oinline const int getNumChildren() const
oinline Node* getChild( const int i )
oinline const Node* getChild( const int i ) const
oinline bool containsNode( const Node* node ) const
oinline ChildList::iterator findNode( const Node* node )
oinline ChildList::const_iterator findNode( const Node* node ) const

Protected Fields

oChildList _children


Documentation

Transform - is group which all children are transformed by the the Transform's osg::Matrix. Typical uses of the Transform is for positioning objects within a scene or producing trackball functionality or for animation. The Transform node can be customized via the ComputeTransfromCallback which can be attached to the node, this might be used to convert internal representations of the transformation into generic osg::Matrix'c which are used during scene grpah traversal, such as CullTraversal and IntersectionTraversal. Note, if the transformation matrix scales the subgraph then the normals of the underlying geometry will need to be renormalized to be unit vectors once more. One can done transparently through OpenGL's use of either GL_NORMALIZE and GL_SCALE_NORMALIZE modes. Further background reading see the glNormalize documentation in the OpenGL Reference Guide (the blue book). To enable it in the OSG, you simple need to attach a local osg::StateSet to the osg::Transform, and set the appropriate mode to on via stateset->setMode(GL_NORMALIZE,osg::StateAttribute::ON);.
o Transform()

o Transform(const Transform&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

o Transform(const Matrix& matix)

o META_Node(Transform)

oenum ReferenceFrame

o RELATIVE_TO_PARENTS

o RELATIVE_TO_ABSOLUTE

ovoid setReferenceFrame(ReferenceFrame rf)
Set the transform's ReferenceFrame, either to be realtive to its parent reference frame, or relative to an absolute coordinate frame. RELATIVE_TO_PARENTS is the default. Note, setting the RefrenceFrame to be RELATIVE_TO_ABSOLUTE will also set the CullingActive flag on the transform, and hence all its parents, to false, therby disabling culling of it and all its parents. This is neccessary to prevent inappropriate culling, but may impact of cull times if the absolute transform is deep in the scene graph, it is therefore recommend to only use abolsoute Transforms at the top of the scene, for such things as headlight LightSource's or Head up displays.

oconst ReferenceFrame getReferenceFrame() const

ostruct ComputeTransformCallback: public osg::Referenced
Callback attached to an Transform to specifiy how to compute the modelview transformation for the transform below the Transform node

ovirtual const bool computeLocalToWorldMatrix(Matrix& matrix, const Transform* transform, NodeVisitor* nv) const = 0
Get the transformation matrix which moves from local coords to world coords

ovirtual const bool computeWorldToLocalMatrix(Matrix& matrix, const Transform* transform, NodeVisitor* nv) const = 0
Get the transformation matrix which moves from world coords to local coords

ovoid setComputeTransformCallback(ComputeTransformCallback* ctc)
Set the ComputerTransfromCallback which allows users to attach custom computation of the local transformation as seen by cull traversers and alike

oComputeTransformCallback* getComputeTransformCallback()
Get the non const ComputerTransfromCallback

oconst ComputeTransformCallback* getComputeTransformCallback() const
Get the const ComputerTransfromCallback

oinline const bool getLocalToWorldMatrix(Matrix& matrix, NodeVisitor* nv) const
Get the transformation matrix which moves from local coords to world coords. Return true if Matrix passed in has been modified and

oinline const bool getWorldToLocalMatrix(Matrix& matrix, NodeVisitor* nv) const
Get the transformation matrix which moves from world coords to local coords. Return true if Matrix passed in has been modified and

ovoid setMatrix(const Matrix& mat)
Set the transform's matrix

oinline const Matrix& getMatrix() const
Get the transform's matrix.

ovoid preMult(const Matrix& mat)
preMult transform

ovoid postMult(const Matrix& mat)
postMult transform

ovirtual ~Transform()

ovirtual const bool computeBound() const
Override's Group's computeBound. There is no need to override in subclasses from osg::Transform since this computeBound() uses the underlying matrix (calling computeMatrix if required.)

ovirtual const bool computeLocalToWorldMatrix(Matrix& matrix, NodeVisitor*) const

ovirtual const bool computeWorldToLocalMatrix(Matrix& matrix, NodeVisitor*) const

oinline void computeInverse() const

oref_ptr<ComputeTransformCallback> _computeTransformCallback

oReferenceFrame _referenceFrame

oref_ptr<Matrix> _matrix

omutable ref_ptr<Matrix> _inverse

omutable bool _inverseDirty


Direct child classes:
PositionAttitudeTransform
Friends:
struct osg::Transform::ComputeTransformCallback

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.