[vlc-devel] [PATCH 1/4] viewpoint: add reverse viewpoint function

Alexandre Janniaux ajanni at videolabs.io
Thu Feb 7 12:12:15 CET 2019


It reverses the transformation (here rotation only) which is helpful to
transform the viewpoint rotation into a world rotation.
It also abstract a little the internal representation of a viewpoint.
---
 include/vlc_viewpoint.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/vlc_viewpoint.h b/include/vlc_viewpoint.h
index b9e162b02e..df930b3900 100644
--- a/include/vlc_viewpoint.h
+++ b/include/vlc_viewpoint.h
@@ -59,4 +59,11 @@ static inline void vlc_viewpoint_clip( vlc_viewpoint_t *p_vp )
                           FIELD_OF_VIEW_DEGREES_MAX );
 }
 
+static inline void vlc_viewpoint_reverse( vlc_viewpoint_t *p_vp )
+{
+    p_vp->yaw *= -1;
+    p_vp->pitch *= -1;
+    p_vp->roll *= -1;
+}
+
 #endif /* VLC_VIEWPOINT_H_ */
-- 
2.20.1



More information about the vlc-devel mailing list