Skip to main content

Function: extractYaw()

extractYaw(rotation, target): Quaternion

Defined in: src/utils/RotationUtils.ts:23

Extracts only the yaw (Y-axis rotation) from a quaternion. This is useful for making an object face a certain direction horizontally without tilting up or down.

Parameters

rotation

Readonly<THREE.Quaternion>

The source quaternion from which to extract the yaw.

target

Quaternion = ...

The target quaternion to store the result. If not provided, a new quaternion will be created.

Returns

Quaternion

The resulting quaternion containing only the yaw rotation.