• Get the world rotation of an entity, taking into account the full parent hierarchy. This computes the world-space rotation by combining all parent rotations.

    When the entity has AvatarAttach and Transform, the renderer updates the Transform with avatar-relative values (including the exact anchor point rotation for hand, head, etc.). This function combines the player's rotation with those values to compute the world rotation.

    Returns

    The entity's rotation in world space as a quaternion. Returns identity quaternion {x: 0, y: 0, z: 0, w: 1} if the entity has no Transform.

    Example:

    const worldRot = getWorldRotation(engine, childEntity)
    console.log(`World rotation: ${worldRot.x}, ${worldRot.y}, ${worldRot.z}, ${worldRot.w}`)

    Parameters

    Returns QuaternionType