|
Back to Table of contents |
General information |
type: class
inherits: (none)
module: glowViewTransformGlowTransformData stores the actual transform data used by GlowViewTransform and GlowViewManipulator. You can connect multiple transforms and manipulators to the same transform data object if you want them to move in concert.
GLOW programs that render 3D scenes may find GlowTransformData useful for managing 3D transforms.
Methods |
Constructors and destructor
GlowTransformData(bool persistent = true)
Creates a new GlowTransformData, given a persistence setting. The transform is set to the identity.GlowTransformData(const Vec3f& trans, const Quatf& rot, GLfloat scale, bool persistent = true)
Creates a new GlowTransformData, given an initial transform and a persistence setting.virtual ~GlowTransformData(void)
Transform data methods
void Set(const Vec3f& trans, const Quatf& rot, GLfloat scale)
Sets the current transform.void SetTranslation(const Vec3f& trans)
Sets the current translation vector.void SetRotation(const Quatf& rot)
Sets the current rotation quaternion.void SetScale(GLfloat scale)
Sets the current scale factor.void SetIdentity(void)
Sets the transform to the identity transform.void AddTranslation(const Vec3f& trans)
Adds the given translation vector to the data.void AddRotation(const Quatf& rot)
Adds the given rotation quaternion to the data.void AddScale(GLfloat scale)
Adds the given scale factor to the data.const Vec3f& GetTranslation(void) const
Returns the current translation vector.const Quatf& GetRotation(void) const
Returns the current rotation quaternion.GLfloat GetScale(void) const
Returns the current scale factor.Applying the transform
Vec3f Apply(const Vec3f& vec) const
Returns the result of applying the current transform to the given vector.Vec3f ApplyInverse(const Vec3f& vec) const
Returns the result of applying the inverse of the current transform to the given vector.void ApplyToGLMatrix(void) const
Multiplies the current OpenGL matrix by the current transform.void ApplyInverseToGLMatrix(void) const
Multiplies the current OpenGL matrix by the inverse of the current transform.void GetGLMatrixf(GLfloat* matrix) const
Sets matrix[0] through matrix[15] to the matrix representing the current transform, in OpenGL (column-major) order.void GetMatrix(Mat4f& matrix) const
Sets matrix to the matrix representing the current transform.Other methods
bool IsSpinning(void) const
Returns true if the transform data is currently spinning.void StartSpinning(const Quatf& spin)
Starts the transform spinning, using the given quaternion as the delta rotation.void StopSpinning(void)
Stops spinning.void StepSpin(void)
Advances the spin one step. Normally this is called automatically during idle time when spinning is on, so you do not need to call it manually.bool IsPersistent(void) const
Returns true if the transform data is persistent. This means the object will not auto-destruct when it is not referenced by any GlowViewTransform objects. Normally, transform data objects that are created automatically by view transforms are non-persistent. Transform data objects that you create manually should probably be persistent so you have control over when it gets deleted.void SetPersistent(bool persist)
Sets the persistence.void RefreshAll(void)
Refreshes every view transform component connected to this data.
|
Back to Table of contents |
The GLOW Toolkit