Rotation¶
Global · Rotation · server and client scripts
Rotation is an immutable unit-quaternion 3D orientation. Read Forward, Up, and Right basis vectors, rotate a vector with :Apply, compose two rotations with *, interpolate with :Lerp, invert with :Inverse, or convert with :ToEuler, :ToAxisAngle, and :AngleTo.
Example
fromEuler¶
Rotation.fromEuler creates a rotation from YXZ Euler angles in degrees.
Example
fromAxisAngle¶
Rotation.fromAxisAngle creates a rotation around axis by degrees. A zero axis returns Rotation.Identity.
Example
lookAt¶
Rotation.lookAt creates a rotation whose Forward points along forward, using up (defaults to Vector3.YAxis) as the reference up direction.
Example
Identity¶
Rotation.Identity is the zero rotation whose Forward is (0, 0, -1), Up is (0, 1, 0), and Right is (1, 0, 0).
Default Rotation.Identity