diff options
Diffstat (limited to 'include/math/spatial3.h')
-rw-r--r-- | include/math/spatial3.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/math/spatial3.h b/include/math/spatial3.h index 8de38bf..9065972 100644 --- a/include/math/spatial3.h +++ b/include/math/spatial3.h | |||
@@ -118,7 +118,7 @@ static inline void spatial3_set_transform(Spatial3* spatial, mat4 transform) { | |||
118 | static inline void spatial3_set_forward(Spatial3* spatial, vec3 forward) { | 118 | static inline void spatial3_set_forward(Spatial3* spatial, vec3 forward) { |
119 | spatial->f = vec3_normalize(forward); | 119 | spatial->f = vec3_normalize(forward); |
120 | // Use aux vector to define right vector orthogonal to forward. | 120 | // Use aux vector to define right vector orthogonal to forward. |
121 | if (vec3_eq(vec3_abs(spatial->f), up3())) { | 121 | if (vec3_eq(vec3_abs(spatial->f), up3(), 1e-9)) { |
122 | spatial->r = vec3_normalize(vec3_cross(spatial->f, forward3())); | 122 | spatial->r = vec3_normalize(vec3_cross(spatial->f, forward3())); |
123 | } else { | 123 | } else { |
124 | spatial->r = vec3_normalize(vec3_cross(spatial->f, up3())); | 124 | spatial->r = vec3_normalize(vec3_cross(spatial->f, up3())); |