Transform - is group which all children are transformed by the the Transform's osg::Matrix.
Inheritance:
Public Methods
-
Transform()
-
Transform(const Transform&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
-
Transform(const Matrix& matix)
-
META_Node(Transform)
-
inline void setType(Type type)
- Set the Transform Type, which can be DYNAMIC - the Matrix value is updated during the main loop, or STATIC - the Matrix is constant throughout the life of the main loop.
-
inline const Type getType() const
- Get the Transform Type
-
inline void setMatrixMode(MatrixMode mode)
- Set the matrix mode which tells traversers them how to treat this Transform - as Projection, View or Model transformation
-
inline const MatrixMode getMatrixMode() const
- Get the transform mode
-
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
-
ComputeTransformCallback* getComputeTransformCallback()
- Get the non const ComputerTransfromCallback
-
const ComputeTransformCallback* getComputeTransformCallback() const
- Get the const ComputerTransfromCallback
-
inline const bool getLocalToWorldMatrix(Matrix& matrix, NodeVisitor* nv) const
- Get the transformation matrix which moves from local coords to world coords.
-
inline const bool getWorldToLocalMatrix(Matrix& matrix, NodeVisitor* nv) const
- Get the transformation matrix which moves from world coords to local coords.
-
void setMatrix(const Matrix& mat)
- Set the transform's matrix
-
inline const Matrix& getMatrix() const
- Get the transform's matrix.
-
void preMult(const Matrix& mat)
- preMult transform
-
void postMult(const Matrix& mat)
- postMult transform
Public Members
-
enum Type
- Range of types that the Transform can be
-
struct ComputeTransformCallback: public osg::Referenced
- Callback attached to an Transform to specifiy how to compute the modelview or projection transformation for the transform below the Transform node
Protected Fields
-
Type _type
-
MatrixMode _mode
-
ref_ptr<ComputeTransformCallback> _computeTransformCallback
-
ref_ptr<Matrix> _matrix
Protected Methods
-
virtual ~Transform()
-
virtual const bool computeBound() const
- Override's Group's computeBound.
-
virtual const bool computeLocalToWorldMatrix(Matrix& matrix, NodeVisitor*) const
-
virtual const bool computeWorldToLocalMatrix(Matrix& matrix, NodeVisitor*) const
Inherited from Group:
Public Methods
-
virtual void traverse(NodeVisitor& nv)
-
virtual bool addChild( Node* child )
-
virtual bool removeChild( Node* child )
-
virtual bool replaceChild( Node* origChild, Node* newChild )
-
inline const int getNumChildren() const
-
inline Node* getChild( const int i )
-
inline const Node* getChild( const int i ) const
-
inline bool containsNode( const Node* node ) const
-
inline ChildList::iterator findNode( const Node* node )
-
inline ChildList::const_iterator findNode( const Node* node ) const
Protected Fields
-
ChildList _children
Inherited from Node:
Public Methods
-
virtual Object* cloneType() const
-
virtual Object* clone(const CopyOp& copyop) const
-
virtual bool isSameKindAs(const Object* obj) const
-
virtual const char* className() const
-
virtual void accept(NodeVisitor& nv)
-
virtual void ascend(NodeVisitor& nv)
-
inline void setName( const std::string& name )
-
inline void setName( const char* name )
-
inline const std::string& getName() const
-
inline const ParentList& getParents() const
-
inline ParentList getParents()
-
inline Group* getParent(const int i)
-
inline const Group* getParent(const int i) const
-
inline const int getNumParents() const
-
void setAppCallback(NodeCallback* nc)
-
inline NodeCallback* getAppCallback()
-
inline const NodeCallback* getAppCallback() const
-
inline const int getNumChildrenRequiringAppTraversal() const
-
void setCullingActive(const bool active)
-
inline const bool getCullingActive() const
-
inline const int getNumChildrenWithCullingDisabled() const
-
inline void setUserData(osg::Referenced* obj)
-
inline Referenced* getUserData()
-
inline const Referenced* getUserData() const
-
inline void setNodeMask(const NodeMask nm)
-
inline const NodeMask getNodeMask() const
-
inline const DescriptionList& getDescriptions() const
-
inline DescriptionList& getDescriptions()
-
inline const std::string& getDescription(const int i) const
-
inline std::string& getDescription(const int i)
-
inline const int getNumDescriptions() const
-
void addDescription(const std::string& desc)
-
inline void setStateSet(osg::StateSet* dstate)
-
inline osg::StateSet* getStateSet()
-
inline const osg::StateSet* getStateSet() const
-
inline const BoundingSphere& getBound() const
-
void dirtyBound()
Public Members
-
typedef std::vector<Group*> ParentList
-
typedef std::vector<std::string> DescriptionList
Protected Fields
-
mutable BoundingSphere _bsphere
-
mutable bool _bsphere_computed
-
std::string _name
-
ParentList _parents
-
ref_ptr<NodeCallback> _appCallback
-
int _numChildrenRequiringAppTraversal
-
bool _cullingActive
-
int _numChildrenWithCullingDisabled
-
osg::ref_ptr<Referenced> _userData
-
NodeMask _nodeMask
-
DescriptionList _descriptions
-
ref_ptr<StateSet> _dstate
Protected Methods
-
void addParent(osg::Group* node)
-
void removeParent(osg::Group* node)
-
void setNumChildrenRequiringAppTraversal(const int num)
-
void setNumChildrenWithCullingDisabled(const int num)
Inherited from Object:
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
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);.
- Transform()
- Transform(const Transform&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
- Transform(const Matrix& matix)
- META_Node(Transform)
- enum Type
- Range of types that the Transform can be
- DYNAMIC
- STATIC
- inline void setType(Type type)
- Set the Transform Type, which can be DYNAMIC - the Matrix
value is updated during the main loop, or STATIC - the Matrix
is constant throughout the life of the main loop. STATIC
Transforms can be optimized away is some instances, which
can improve performance so unless you plan to modify the
Matrix explicitly set the Matrix to STATIC. The default
value is DYNAMIC.
- inline const Type getType() const
- Get the Transform Type
- inline void setMatrixMode(MatrixMode mode)
- Set the matrix mode which tells traversers them how to treat this Transform - as Projection, View or Model transformation
- inline const MatrixMode getMatrixMode() const
- Get the transform mode
- struct ComputeTransformCallback: public osg::Referenced
- Callback attached to an Transform to specifiy how to compute the modelview or projection transformation
for the transform below the Transform node
- virtual const bool computeLocalToWorldMatrix(Matrix& matrix, const Transform* transform, NodeVisitor* nv) const = 0
- Get the transformation matrix which moves from local coords to world coords
- virtual const bool computeWorldToLocalMatrix(Matrix& matrix, const Transform* transform, NodeVisitor* nv) const = 0
- Get the transformation matrix which moves from world coords to local coords
- 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
- ComputeTransformCallback* getComputeTransformCallback()
- Get the non const ComputerTransfromCallback
- const ComputeTransformCallback* getComputeTransformCallback() const
- Get the const ComputerTransfromCallback
- inline 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
- inline 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
- void setMatrix(const Matrix& mat)
- Set the transform's matrix
- inline const Matrix& getMatrix() const
- Get the transform's matrix.
- void preMult(const Matrix& mat)
- preMult transform
- void postMult(const Matrix& mat)
- postMult transform
- virtual ~Transform()
- virtual 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.)
- virtual const bool computeLocalToWorldMatrix(Matrix& matrix, NodeVisitor*) const
- virtual const bool computeWorldToLocalMatrix(Matrix& matrix, NodeVisitor*) const
- Type _type
- MatrixMode _mode
- ref_ptr<ComputeTransformCallback> _computeTransformCallback
- ref_ptr<Matrix> _matrix
- 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++.