quat.lookAt fails
The function quat.lookAt fails (returns a quat with all NaN values) when the direction is aligned with the 'up' vector. I'm trying to draw Images as decals on the walls, floor and ceiling and using this line:
var flat = quat.lookAt(hit.normal, vec3.up());
to get a quaternion for the rotation only works if the floor or ceiling collisions return 'normal' vectors which are not very accurate.
Is there a better (or different) way to get a quat rotation from a vector normal while we wait for lookAt to be fixed?
This works...