godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

using transform.basis.orthonormalized() instead of transform.basis wh…

Open lschlieder opened this issue 2 months ago • 0 comments

…en creating Quaternion

In the Interpolating with quaternions section, add the .orthonormalized() function to the creation of the Quaternion. While Quaternion(Basis) usually works fine, it fails when the basis is not orthonormalized, as stated in the Quaternion documentation (see below) :

Quaternion Quaternion(from: Basis)

Constructs a Quaternion from the given rotation Basis.

This constructor is faster than Basis.get_rotation_quaternion(), but the given basis must be orthonormalized (see Basis.orthonormalized()). Otherwise, the constructor fails and returns IDENTITY.

lschlieder avatar Oct 08 '25 21:10 lschlieder