#"The quaternion (x, y, z, w) must be normalized." But it is...?

2 messages · Page 1 of 1 (latest)

sinful fiber
#

the code:

var first_quat = buffer[0].basis.orthonormalized().get_rotation_quaternion()
var second_quat = buffer[1].basis.orthonormalized().get_rotation_quaternion()
global_rotation = first_quat.normalized().slerp(second_quat.normalized(), t).get_euler()

the error:

E 0:00:16:0906   HumanBone.gd:193 @ _physics_process(): The quaternion (1.000341, -0.038026, 0.005365, -0.025509) must be normalized.
  <C++ Error>    Condition "!is_normalized()" is true. Returning: Vector3(0, 0, 0)
  <C++ Source>   core\math\quaternion.cpp:44 @ Quaternion::get_euler()
  <Stack Trace>  HumanBone.gd:193 @ _physics_process()

buffer is an array of Transform3Ds
i dont really understand, i normalized the quats when slerping but it still sends the error every so often

a similar issue ive encountered is sometimes getting the error: "The axis vector3 must be normalized"... again, even though i put .normalized() on the end of those too. is there something simple im missing?

#

i put everything back into the process function (from physics_process) and the errors dissapeared, still dunno exactly why theres a difference there