Description
The w
property of the Rotation
struct represents the W component of the quaternion rotation. This component is crucial for defining the rotation around the axis specified by the X, Y, and Z components of the quaternion. In the context of quaternions, the W component is often associated with the scalar part of the quaternion, which helps in determining the angle of rotation.
Usage
To access or modify the W component of a Rotation
instance, you can use the w
property. This property is a float
and can be both read and written to.
Example
// Example of accessing and setting the W component of a Rotation
Rotation rotation = new Rotation();
float currentW = rotation.w; // Get the current W component
rotation.w = 0.5f; // Set the W component to a new value