Closed tangmi closed 5 years ago
I think adding an assertion could trigger a few unintended failures on the user side, i.e when the quaternion is produced by some computation that is mathematically supposed get us a normalized quaternion but numerically ends up failing the assertion by some margin. It would be better to let the users just accumulate that minor error instead of hitting a sudden assert.
Documenting it clearly would be though!
It seems that the
rotate_vector
implementation forQuaternion
doesn't care thatself
is normalized or not.I believe that rotating a vector with a quaternion only makes sense for unit quaternions. Would it be a good idea to document
Quaternion::rotate_vector
and possibly put andebug_assert!(self.is_unit())
so users don't get strange behavior trying to useRotation<Point3<S>>
whenself
doesn't validly represent a rotation?Cheers!