Code that relies on this returning null would break.
It might be that code expects to be able to call this method to see if the quaternion can be inverted successfully… and throwing an exception both breaks that kind of code and makes it a lot more complicated. Where as checking for a null is easy.
Furthermore, if your quaternion was valid to begin with you’d never see this in normal code.
Ack! Before this gets any older…
There is something that can be added to an ‘in-house’ Quaternion. (In house being not the usual Java Quat.)
How about adding getForwardVector() that would return q.getRotationColumn(2) and getBackwardVector() that would return q.getRotationColumn(2).negate() and the corresponding get left/right and up/down vectors?
How many people look for that/these and can’t find it/them because they don’t know it’s/the’re there?
We could use a tutorial on 3D (spaceship) navigation, too.