Transform¶
Reference¶
- class Transform¶
- module:
- position: Vector3¶
The position of the transform.
- rotation: Quaternion¶
The rotation of the transform.
- scale: Vector3¶
The scale of the transform.
- static new()¶
Creates a new transform object.
- static new(position, rotation, scale)
Creates a transform object from existing position, rotation, and scale.
- static fromJson(json)¶
Creates a transform object from JSON.
- static fromData(data)¶
Creates a transform object from data.
- toData()¶
Converts the transform into a table representation.
- moveTo(x, y, z)¶
Moves the transform to a new position.
- Parameters:¶
x (
number or Vector3
) – The x coordinate or a Vector3 position.y (
number
) – The y coordinate (if x is a number).z (
number
) – The z coordinate (if x is a number).
- moveBy(x, y, z)¶
Moves the transform by a given offset.
- Parameters:¶
x (
number or Vector3
) – The x offset or a Vector3 offset.y (
number
) – The y offset (if x is a number).z (
number
) – The z offset (if x is a number).
- lookAt(x, y, z, up)¶
Rotates the transform to look at a target position.