Added support for osg::Transform::asMatrixTransform, asPositionAttitudeTransform
and as DOFTransform.
This commit is contained in:
parent
1ce53fcfba
commit
0d4e969746
@ -52,6 +52,9 @@ class SG_EXPORT DOFTransform : public Transform
|
||||
|
||||
META_Node(osg, DOFTransform);
|
||||
|
||||
virtual DOFTransform* asDOFTransform() { return this; }
|
||||
virtual const DOFTransform* asDOFTransform() const { return this; }
|
||||
|
||||
virtual void traverse(NodeVisitor& nv);
|
||||
|
||||
void setMinHPR(const Vec3& hpr) { _minHPR = hpr;}
|
||||
|
@ -37,6 +37,10 @@ class SG_EXPORT MatrixTransform : public Transform
|
||||
|
||||
META_Node(osg, MatrixTransform);
|
||||
|
||||
virtual MatrixTransform* asMatrixTransform() { return this; }
|
||||
virtual const MatrixTransform* asMatrixTransform() const { return this; }
|
||||
|
||||
|
||||
/** Set the transform's matrix.*/
|
||||
void setMatrix(const Matrix& mat) { _matrix = mat; _inverseDirty=true; dirtyBound(); }
|
||||
|
||||
|
@ -38,6 +38,8 @@ class SG_EXPORT PositionAttitudeTransform : public Transform
|
||||
|
||||
META_Node(osg, PositionAttitudeTransform);
|
||||
|
||||
virtual PositionAttitudeTransform* asPositionAttitudeTransform() { return this; }
|
||||
virtual const PositionAttitudeTransform* asPositionAttitudeTransform() const { return this; }
|
||||
|
||||
inline void setPosition(const Vec3& pos) { _position = pos; dirtyBound(); }
|
||||
|
||||
|
@ -57,6 +57,15 @@ class SG_EXPORT Transform : public Group
|
||||
virtual Transform* asTransform() { return this; }
|
||||
virtual const Transform* asTransform() const { return this; }
|
||||
|
||||
virtual MatrixTransform* asMatrixTransform() { return 0; }
|
||||
virtual const MatrixTransform* asMatrixTransform() const { return 0; }
|
||||
|
||||
virtual PositionAttitudeTransform* asPositionAttitudeTransform() { return 0; }
|
||||
virtual const PositionAttitudeTransform* asPositionAttitudeTransform() const { return 0; }
|
||||
|
||||
virtual DOFTransform* asDOFTransform() { return 0; }
|
||||
virtual const DOFTransform* asDOFTransform() const { return 0; }
|
||||
|
||||
enum ReferenceFrame
|
||||
{
|
||||
RELATIVE_TO_PARENTS,
|
||||
|
Loading…
Reference in New Issue
Block a user