Hi there, Quaternion.toRotationMatrix sounds like it returns the rotation matrix for a given quaternion. So I called it with something like: const rot = this.rotation.toRotationMatrix().
This breaks because the method actually expects a matrix as an argument. The function then writes the result into the given matrix (why isn’t it called ToRef then?) and returns the updated matrix as well.
The doc says, that it “returns the current unchanged quaternion”, what seems to be wrong.
Calling it like this works, but looks weird, IMHO:
It might be a little unexpected to have to pass a matrix to the function, but there’s a reason for that as we want to avoid creating matrices when possible in the function to avoid increasing memory in many cases, the function is used with a “cached” matrix that is reused between calls.