vtlib library
Public Member Functions | List of all members
TransformExtension Struct Reference
Inheritance diagram for TransformExtension:
Inheritance graph
[legend]

Public Member Functions

void Identity ()
 
void SetTrans (const FPoint3 &pos)
 
FPoint3 GetTrans () const
 
void Translate (const FPoint3 &pos)
 
void TranslateLocal (const FPoint3 &pos)
 
void Rotate (const FPoint3 &axis, double angle)
 
void RotateLocal (const FPoint3 &axis, double angle)
 
void RotateParent (const FPoint3 &axis, double angle)
 
FQuat GetOrient () const
 
FPoint3 GetDirection () const
 
void SetDirection (const FPoint3 &point, bool bPitch=true)
 
void Scale (float factor)
 
void Scale (float x, float y, float z)
 
void SetTransform (const FMatrix4 &mat)
 
void GetTransform (FMatrix4 &mat) const
 
void PointTowards (const FPoint3 &point, bool bPitch=true)
 
- Public Member Functions inherited from NodeExtension
void SetEnabled (bool bOn)
 
bool GetEnabled () const
 
void SetCastShadow (bool b)
 Set this node to cast a shadow, if it is under a vtShadow node. Default is false.
 
bool GetCastShadow ()
 Get whether this node casts a shadow.
 
void GetBoundSphere (FSphere &sphere, bool bGlobal=false)
 Get the Bounding Sphere of the node.
 

Detailed Description

Extends OSG's MatrixTransform with methods to easily operate on its matrix.

Member Function Documentation

FPoint3 TransformExtension::GetDirection ( ) const

Get the direction, which by convention is shorthand for the -Z axis of the local frame. For oriented objects such as the camera, this is the direction the object is facing.

FQuat TransformExtension::GetOrient ( ) const

Get the orientation (rotate relative to default) of the transform

FPoint3 TransformExtension::GetTrans ( ) const

Get the translation component of the transform

void TransformExtension::GetTransform ( FMatrix4 mat) const

Get the entire transform as a 4x4 matrix.

void TransformExtension::Identity ( )

Set this transform to identity (no scale, rotation, or translation).

void TransformExtension::PointTowards ( const FPoint3 point,
bool  bPitch = true 
)

Rotate the object such that it points toward a given point. By convention, this means that the object's -Z axis points in the desired direction.

void TransformExtension::Rotate ( const FPoint3 axis,
double  angle 
)

Rotate around a given axis by a given angle, in radians.

void TransformExtension::RotateLocal ( const FPoint3 axis,
double  angle 
)

Similar to Rotate2, but operates in the local frame of reference.

void TransformExtension::RotateParent ( const FPoint3 axis,
double  angle 
)

Similar to Rotate2, but the rotation occurs in the parent's frame of reference.

void TransformExtension::Scale ( float  factor)

Scale (stretch) by the given factor in all dimensions.

void TransformExtension::Scale ( float  x,
float  y,
float  z 
)

Scale (stretch) by given factors in the x,y,z dimensions.

void TransformExtension::SetDirection ( const FPoint3 point,
bool  bPitch = true 
)

Set the direction, which by convention is shorthand for the -Z axis of the local frame. For oriented objects such as the camera, this is the direction the object is facing.

void TransformExtension::SetTrans ( const FPoint3 pos)

Set the translation component of the transform

void TransformExtension::SetTransform ( const FMatrix4 mat)

Set the entire transform with a 4x4 matrix.

void TransformExtension::Translate ( const FPoint3 pos)

Apply a relative offset (translation) to the transform, in the frame of its parent.

void TransformExtension::TranslateLocal ( const FPoint3 pos)

Apply a relative offset (translation) to the transform, in its own frame of reference.