excessive / cpml

Cirno's Perfect Math Library: Just about everything you need for 2D/3D games. Hopefully.
https://excessive.github.io/cpml/
Other
304 stars 41 forks source link

new implementation for quat.from_direction, and new tests #88

Closed snowkittykira closed 1 year ago

snowkittykira commented 1 year ago

Fix for #87 by reimplementing quat.from_direction in terms of quat.from_angle_axis. Also corrected the existing test and added a couple of new ones.

mcclure commented 1 year ago

Does this produce different "up to normalization" results, or does it just produce the same results but normalized?

snowkittykira commented 1 year ago

I can't say for sure without an explanation of how the original code works! I could write some code to try with a bunch of vectors but that won't necessarily find corner cases. It did return the same (but normalized) value for the test case though.

snowkittykira commented 1 year ago

closing because i'm not confident enough that this is the proper fix, i'm going to do more testing