transform object represents a position, rotation, and scale.transform objects are automatically applied to Node, Light, Model, and Body objects.Node objects, you should not be using the Transformation methods here. Instead, check the Transform Methods here to learn how to transform Node objects.matrix mat4: A transformation matrix.position vector3: The position applied to the matrix.scale vector3: The scale applied to the matrix.rotation vector4: The rotation applied to the matrix. Though this is a vector4, the x, y, z, w components map to a quaternion’s angle, ax, ay, az components.prevMatrix mat4: Used when detecting if the transform has been changed.changed bool: Whether the transform has been changed since the last Transform:updatePrevMatrix() call.mat4, pos, rot, and/or scale will automatically set the transform object to include these values.
-- Create a new transform object at position (1, 1, 1)
LGE.Transform({
position = lovr.math.vec3(1, 1, 1)
})
-- Create a transform object with all values set to (0, 0, 0)
LGE.Transform()
transform object.
Transform:cloneMatrix()
transform object.
Transform:setMatrix(info [array])
-- Example:
Transform:setMatrix({
rotation = lovr.math.vec4(math.rad(25), 1, 0, 0)
})
prevMatrix and changed a change in the position, rotation, scale, or matrix of the transform object.
Transform:updatePevMatrix()
x, y, z from a transformation matrix.
LGE.Transform.getPositionFromMat4(mat4 [mat4])
angle, ax, ay, az from a transformation matrix.
LGE.Transform.getRotationFromMat4(mat4 [mat4])
x, y, z from a transformation matrix.
LGE.Transform.getScaleFromMat4(mat4 [mat4])
x, y, z, angle, ax, ay, az from a transformation matrix.
LGE.Transform.getPose(mat4 [mat4])
LGE.Transform.getTransformMatFromMat4(mat4 [mat4])
LGE.Transform.getStringFromMat4(mat4 [mat4])