Pose
The “position” of a view. Abstracts a mat4 transformation matrix.
Constructor
pose = Pose() -- Creates a zero pose
A Pose may also be created the following ways:
pose = Pose(transform) -- Creates a pose from a transform
pose = Pose(x, y, z) -- Create positioned pose
pose = Pose(a, x, y, z) -- Create rotated pose
Arguments
| Name | Type | Description |
| a | ??? | |
| b | ??? | |
| c | ??? | |
| d | ??? | |
Returns
Nothing
Methods
pose:copy ()
Creates and returns a copy of a given Pose
Arguments
None
Returns
| Type | Description |
| Pose | A copy of the original Pose object. |
pose:identity ()
Sets the Pose to {0, 0, 0, 0}.
Arguments
None
Returns
| Type | Description |
| Pose | original Pose, post reset to the identity matrix. |
pose:set (other)
Sets the Pose to inherit
Arguments
| Name | Type | Description |
| other | Pose | The source Pose to copy. |
Returns
| Type | Description |
| Pose | the original Pose, after having been updated. |
pose:rotate (angle, x, y, z)
Rotates the Pose
Arguments
| Name | Type | Description |
| angle | number | The angle component of the angle/axis rotation (radians). |
| x | number | The x component of the axis of rotation. |
| y | number | The y component of the axis of rotation. |
| z | number | The z component of the axis of rotation. |
Returns
| Type | Description |
| Pose | The original Pose, post-rotation. |
pose:move (x, y, z)
Moves the Pose
Arguments
| Name | Type | Description |
| x | number | The movement along the x axis. |
| y | number | The movement along the y axis. |
| z | number | The movement along the z axis. |
Returns
| Type | Description |
| Pose | The original Pose, post-move. |
pose:scale (x, y, z)
Scales the Pose
Arguments
| Name | Type | Description |
| x | number | The x component of the scale to apply (or all axes, if y and z aren’t provided). |
| y | number | The y component of the scale to apply. |
| z | number | The z component of the scale to apply. |
Returns
| Type | Description |
| Pose | The original Pose, post-scale. |
Concatenates (multiplies) this transform with another
Arguments
| Name | Type | Description | |
| otherPoseOrTransform | Pose | mat4 | Either a CPML mat4 matrix to concatenate with, or another Pose |
Returns
| Type | Description |
| Pose | The original Pose, post-concatenation. |