I understand, that it makes sense to check input before calling VectorBase<3, Real>::getRotationTo, but wouldn't it be better to return some safe value, like Identity, instead of nan?
Ogre stable branch
[solved] getRotationTo return nan quaternion for ZERO vector
-
- Gnome
- Posts: 334
- Joined: Tue Oct 24, 2006 9:02 am
- Location: Moscow, Russa
- x 26
[solved] getRotationTo return nan quaternion for ZERO vector
Last edited by altren on Sat Jan 12, 2019 10:58 pm, edited 1 time in total.
-
- Gnome
- Posts: 334
- Joined: Tue Oct 24, 2006 9:02 am
- Location: Moscow, Russa
- x 26
Re: getRotationTo return nan quaternion for ZERO vector
Before this commit
code was less broken, but still had few edge cases with nan output for zero vectors.
Suggested fix: https://github.com/OGRECave/ogre/pull/1045
Code: Select all
SHA-1: fe247d2d3c06f8d3c6817e592a0274fcad0d97d1
* Improve Vector3::perpendicular() and Vector3::getRotationTo()
and add unit tests for these functions.
Suggested fix: https://github.com/OGRECave/ogre/pull/1045