← Back to 3D Structs

Quaternion

⚠️ Experimental - Pre-Release

Quaternion represents a 3D rotation using quaternion mathematics. Used by Transform3D for 3D rotations. Quaternions avoid gimbal lock and provide smooth rotations.

Fields

x: float

The x component of the quaternion.

y: float

The y component of the quaternion.

z: float

The z component of the quaternion.

w: float

The w component of the quaternion.

Usage Example

@script Player extends Node3D    fn update() {        // Access rotation quaternion        var rot = self.transform.rotation        // Quaternion components: x, y, z, w    }

Related