diff options
-rw-r--r-- | include/math/spatial3.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/math/spatial3.h b/include/math/spatial3.h index 9065972..49e5615 100644 --- a/include/math/spatial3.h +++ b/include/math/spatial3.h | |||
@@ -107,6 +107,11 @@ static inline void spatial3_roll(Spatial3* spatial, const R angle) { | |||
107 | spatial->r = vec3_normalize(vec3_cross(spatial->f, spatial->u)); | 107 | spatial->r = vec3_normalize(vec3_cross(spatial->f, spatial->u)); |
108 | } | 108 | } |
109 | 109 | ||
110 | /// Rotate the spatial about the global Y axis. | ||
111 | static inline void spatial3_global_yaw(Spatial3* spatial, const R angle) { | ||
112 | spatial3_rotate(spatial, up3(), angle); | ||
113 | } | ||
114 | |||
110 | /// Set the spatial's transformation matrix. | 115 | /// Set the spatial's transformation matrix. |
111 | static inline void spatial3_set_transform(Spatial3* spatial, mat4 transform) { | 116 | static inline void spatial3_set_transform(Spatial3* spatial, mat4 transform) { |
112 | spatial->r = mat4_v0(transform); | 117 | spatial->r = mat4_v0(transform); |
@@ -115,6 +120,7 @@ static inline void spatial3_set_transform(Spatial3* spatial, mat4 transform) { | |||
115 | spatial->p = mat4_v3(transform); | 120 | spatial->p = mat4_v3(transform); |
116 | } | 121 | } |
117 | 122 | ||
123 | /// Set the spatial's forward vector. | ||
118 | static inline void spatial3_set_forward(Spatial3* spatial, vec3 forward) { | 124 | static inline void spatial3_set_forward(Spatial3* spatial, vec3 forward) { |
119 | spatial->f = vec3_normalize(forward); | 125 | spatial->f = vec3_normalize(forward); |
120 | // Use aux vector to define right vector orthogonal to forward. | 126 | // Use aux vector to define right vector orthogonal to forward. |