![]() |
Murl Engine API
Version 2018.3
|
The ITransformable property interface. More...
#include <murl_graph_i_transformable.h>
The ITransformable property interface.
This interface provides the basis for transforming nodes within a virtual 2D or 3D space. Internally, this encapsulates a 4x4 transformation matrix. In general, transforms are applied according to the hierarchy in which they are specified.
Animation controllers may call the SetTransform() method when translation and/or rotation keys are present in a given Resource::IAnimation.
Public Member Functions | |
virtual Bool | SetDepthOrder (SInt32 depthOrder)=0 |
Set the depth order. More... | |
virtual SInt32 | GetDepthOrder () const =0 |
Get the depth order. More... | |
virtual Bool | SetTransform (const Matrix &transform)=0 |
Set the 4x4 transformation matrix. More... | |
virtual const Matrix & | GetTransform () const =0 |
Get a constant reference to the internal 4x4 transformation matrix. More... | |
virtual Matrix & | GetTransform ()=0 |
Get a mutable reference to the internal 4x4 transformation matrix. More... | |
virtual Bool | SetPosition (const Vector &pos)=0 |
Set the translation component of the transformation matrix. More... | |
virtual Bool | SetPosition (Real posX, Real posY, Real posZ)=0 |
Set the translation component of the transformation matrix. More... | |
virtual Bool | SetPositionX (Real pos)=0 |
Set the X component of the transformation matrix' translation. More... | |
virtual Bool | SetPositionY (Real pos)=0 |
Set the Y component of the transformation matrix' translation. More... | |
virtual Bool | SetPositionZ (Real pos)=0 |
Set the Z component of the transformation matrix' translation. More... | |
virtual const Vector & | GetPosition () const =0 |
Get a constant reference to the internal position vector. More... | |
virtual Real | GetPositionX () const =0 |
Get the X component of the transformation matrix' translation. More... | |
virtual Real | GetPositionY () const =0 |
Get the Y component of the transformation matrix' translation. More... | |
virtual Real | GetPositionZ () const =0 |
Get the Z component of the transformation matrix' translation. More... | |
virtual Bool | SetRotation (const Vector &axis, Real angle)=0 |
Set the rotation component of the transformation matrix in axis-angle notation. More... | |
virtual Bool | SetRotation (const Quaternion &q)=0 |
Set the rotation component of the transformation matrix by a quaternion. More... | |
virtual Bool | SetRotationOrder (IEnums::RotationOrder rotationOrder)=0 |
Set the axis rotation order for Euler axis notation. More... | |
virtual Bool | SetRotation (Real angleX, Real angleY, Real angleZ)=0 |
Set the rotation component of the transformation matrix in Euler angles notation. More... | |
virtual Bool | SetRotationXYZ (Real angleX, Real angleY, Real angleZ, IEnums::RotationOrder rotationOrder)=0 |
Set the rotation component of the transformation matrix in Euler angles notation with a given rotation order. More... | |
virtual Bool | SetRotationX (Real angle)=0 |
Set the rotation component of the transformation matrix to only rotate around the X axis. More... | |
virtual Bool | SetRotationY (Real angle)=0 |
Set the rotation component of the transformation matrix to only rotate around the Y axis. More... | |
virtual Bool | SetRotationZ (Real angle)=0 |
Set the rotation component of the transformation matrix to only rotate around the Z axis. More... | |
virtual IEnums::RotationOrder | GetRotationOrder () const =0 |
Get the axis rotation order for Euler axis notation. More... | |
virtual const Vector & | GetRotation () const =0 |
Get a constant reference to the internal euler angles vector. More... | |
virtual Real | GetRotationX () const =0 |
Get the rotation around the X axis. More... | |
virtual Real | GetRotationY () const =0 |
Get the rotation around the Y axis. More... | |
virtual Real | GetRotationZ () const =0 |
Get the rotation around the Z axis. More... | |
Set the depth order.
For any geometry that gets sorted back-to-front (i.e. with disabled Z-Buffer writes), the depth order provides an additional means for sorting, useful when two or more objects share the same depth (or distance value, depending on the depth sorting mode applied by the currently active Graph::ICamera). In such a case, objects with a higher depth order will be drawn later, i.e. on top of others. Like the hierarchical behavior of the transformation matrix, depth orders are also applied relative to their parents.
depthOrder | A signed 32bit integer |
|
pure virtual |
Get the depth order.
Set the 4x4 transformation matrix.
This method copies the given transformation matrix to the internal matrix as a whole.
transform | The transformation matrix to apply |
|
pure virtual |
Get a constant reference to the internal 4x4 transformation matrix.
|
pure virtual |
Get a mutable reference to the internal 4x4 transformation matrix.
This method may be called to directly modify the internal transformation matrix. Calling this will internally flag the transform as "modified" in any case, even if it was not actually modified.
Set the translation component of the transformation matrix.
This method directly copies the X, Y and Z values of the given position vector to the XW, YW and ZW components of the matrix without modifying any other component.
pos | The position vector to apply |
|
pure virtual |
Set the translation component of the transformation matrix.
This method directly copies the individually given X, Y and Z position values to the XW, YW and ZW components of the matrix without modifying any other component.
posX | The X component to apply |
posY | The Y component to apply |
posZ | The Z component to apply |
Set the X component of the transformation matrix' translation.
This method directly copies the given X position value to the XW component of the matrix without modifying any other component.
pos | The X component to apply |
Set the Y component of the transformation matrix' translation.
This method directly copies the given Y position value to the YW component of the matrix without modifying any other component.
pos | The Y component to apply |
Set the Z component of the transformation matrix' translation.
This method directly copies the given Z position value to the ZW component of the matrix without modifying any other component.
pos | The Z component to apply |
|
pure virtual |
Get a constant reference to the internal position vector.
|
pure virtual |
Get the X component of the transformation matrix' translation.
|
pure virtual |
Get the Y component of the transformation matrix' translation.
|
pure virtual |
Get the Z component of the transformation matrix' translation.
|
pure virtual |
Set the rotation component of the transformation matrix in axis-angle notation.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating the rotation component from a given axis and angle. The axis must be normalized (i.e. have unit length), and the angle must be given in radians. Positive angle values result in a clockwise rotation when viewed along the given axis.
axis | The normalized rotation axis |
angle | The rotation angle around the axis in radians |
|
pure virtual |
Set the rotation component of the transformation matrix by a quaternion.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating the rotation component from a given quaternion.
q | The quaternion. |
|
pure virtual |
Set the axis rotation order for Euler axis notation.
The default axis rotation order is IEnums::ROTATION_ORDER_ZYX.
rotationOrder | The axis rotation order. |
|
pure virtual |
Set the rotation component of the transformation matrix in Euler angles notation.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating and subsequently applying individual X, Y and Z rotations (Euler angles). Uses the axis rotation order set by SetRotationOrder() or rotationOrder="" XML attribute. Angle values must be given in radians. Positive values result in a clockwise rotation when viewed along the unit X, Y and Z axes, respectively.
angleX | The rotation angle around the X axis in radians |
angleY | The rotation angle around the Y axis in radians |
angleZ | The rotation angle around the Z axis in radians |
|
pure virtual |
Set the rotation component of the transformation matrix in Euler angles notation with a given rotation order.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating and subsequently applying individual X, Y and Z rotations (Euler angles). Angle values must be given in radians. Positive values result in a clockwise rotation when viewed along the unit X, Y and Z axes, respectively.
angleX | The rotation angle around the X axis in radians |
angleY | The rotation angle around the Y axis in radians |
angleZ | The rotation angle around the Z axis in radians |
rotationOrder | The axis rotation order. |
Set the rotation component of the transformation matrix to only rotate around the X axis.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating and applying a rotation around the unit X axis. The angle value must be given in radians. A positive value result in a clockwise rotation.
angle | The rotation angle around the X axis in radians |
Set the rotation component of the transformation matrix to only rotate around the Y axis.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating and applying a rotation around the unit Y axis. The angle value must be given in radians. A positive value result in a clockwise rotation.
angle | The rotation angle around the Y axis in radians |
Set the rotation component of the transformation matrix to only rotate around the Z axis.
This method directly overwrites the upper 3x3 matrix of the internal transformation by calculating and applying a rotation around the unit Z axis. The angle value must be given in radians. A positive value result in a clockwise rotation.
angle | The rotation angle around the Z axis in radians |
|
pure virtual |
Get the axis rotation order for Euler axis notation.
|
pure virtual |
Get a constant reference to the internal euler angles vector.
This method returns the Euler angles set by XML attribute angleX/Y/Z="" or SetRotationX/Y/Z(), SetRotationXYZ() or SetRotation(Real angleX, Real angleY, Real angleZ) only.
|
pure virtual |
Get the rotation around the X axis.
This method returns the Euler angle set by XML attribute angleX="" or SetRotationX(), SetRotationXYZ() or SetRotation(Real angleX, Real angleY, Real angleZ) only.
If the upper 3x3 matrix of the internal transformation matrix has been modified by other methods, the returned angle is incorrect. In this case Matrix::GetEulerRotation() can be used to calculate corresponding angles.
|
pure virtual |
Get the rotation around the Y axis.
This method returns the Euler angle set by XML attribute angleY="" or SetRotationY(), SetRotationXYZ() or SetRotation(Real angleX, Real angleY, Real angleZ) only.
If the upper 3x3 matrix of the internal transformation matrix has been modified by other methods, the returned angle is incorrect. In this case Matrix::GetEulerRotation() can be used to calculate corresponding angles.
|
pure virtual |
Get the rotation around the Z axis.
This method returns the Euler angle set by XML attribute angleZ="" or SetRotationZ(), SetRotationXYZ() or SetRotation(Real angleX, Real angleY, Real angleZ) only.
If the upper 3x3 matrix of the internal transformation matrix has been modified by other methods, the returned angle is incorrect. In this case Matrix::GetEulerRotation() can be used to calculate corresponding angles.