Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quaternion ¶
A unit quaternion used for representing 3D rotations.
func Between ¶
func Between(p_v0, p_v1 vector3.Vector3) Quaternion
Constructs a quaternion representing the shortest arc between two points on the surface of a sphere with a radius of 1.0.
func From ¶
func From(quaternion *Quaternion) Quaternion
Constructs a Quaternion as a copy of the given Quaternion.
func IDENTITY ¶
func IDENTITY() Quaternion
The identity quaternion, representing no rotation. Equivalent to an identity Basis matrix. If a vector is transformed by an identity quaternion, it will not change.
func New ¶
func New(p_x, p_y, p_z, p_w float64) Quaternion
Constructs a quaternion defined by the given values.
func Rotated ¶
func Rotated(axisNormal vector3.Vector3, angle float64) Quaternion
Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
func ZERO ¶
func ZERO() Quaternion
Constructs a default-initialized quaternion with all components set to 0.