Link Search Menu Expand Document

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.
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.