Model:pose
Applies a pose to a single node of the Model. The input pose is assumed to be relative to the pose of the node's parent. This is useful for applying inverse kinematics (IK) to a chain of bones in a skeleton.
The alpha parameter can be used to mix between the node's current pose and the input pose.
Model:pose(name, x, y, z, angle, ax, ay, az, alpha)
Arguments
Name | Type | Default | Description |
name | string | The name of the node. | |
x | number | The x position. | |
y | number | The y position. | |
z | number | The z position. | |
angle | number | The angle of rotation around the axis, in radians. | |
ax | number | The x component of the rotation axis. | |
ay | number | The y component of the rotation axis. | |
az | number | The z component of the rotation axis. | |
alpha | number | 1 | How much of the pose to mix in, from 0 to 1. |
Returns
Nothing
Model:pose(index, x, y, z, angle, ax, ay, az, alpha)
Arguments
Name | Type | Default | Description |
index | number | The node index. | |
x | number | The x position. | |
y | number | The y position. | |
z | number | The z position. | |
angle | number | The angle of rotation around the axis, in radians. | |
ax | number | The x component of the rotation axis. | |
ay | number | The y component of the rotation axis. | |
az | number | The z component of the rotation axis. | |
alpha | number | 1 | How much of the pose to mix in, from 0 to 1. |
Returns
Nothing
Clear the pose of the Model.
Model:pose()
Arguments
None
Returns
Nothing
Notes
For skinned nodes to render correctly, use a Shader created with the animated
flag set to true
. See lovr.graphics.newShader
for more.
See also
Model:getNodePose
Model:animate
Model:getNodeName
Model:getNodeCount
Model