Commit 26f09915 authored by Thomas Guillem's avatar Thomas Guillem

viewpoint: add vlc_viewpoint_clip

parent e61dee00
......@@ -23,6 +23,8 @@
#include <vlc_common.h>
#include <math.h>
/**
* \defgroup output Output
* \ingroup output
......@@ -52,6 +54,15 @@ static inline void vlc_viewpoint_init( vlc_viewpoint_t *p_vp )
p_vp->fov = FIELD_OF_VIEW_DEGREES_DEFAULT;
}
static inline void vlc_viewpoint_clip( vlc_viewpoint_t *p_vp )
{
p_vp->yaw = fmodf( p_vp->yaw, 360.f );
p_vp->pitch = fmodf( p_vp->pitch, 360.f );
p_vp->roll = fmodf( p_vp->roll, 360.f );
p_vp->fov = VLC_CLIP( p_vp->fov, FIELD_OF_VIEW_DEGREES_MIN,
FIELD_OF_VIEW_DEGREES_MAX );
}
/**@}*/
#endif /* VLC_VIEWPOINT_H_ */
......@@ -33,7 +33,6 @@
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <sys/stat.h>
#include "input_internal.h"
......@@ -1960,12 +1959,7 @@ static bool Control( input_thread_t *p_input,
priv->viewpoint.fov += p_vp->fov;
}
priv->viewpoint.yaw = fmodf( priv->viewpoint.yaw, 360.f );
priv->viewpoint.pitch = fmodf( priv->viewpoint.pitch, 360.f );
priv->viewpoint.roll = fmodf( priv->viewpoint.roll, 360.f );
priv->viewpoint.fov = VLC_CLIP( priv->viewpoint.fov,
FIELD_OF_VIEW_DEGREES_MIN,
FIELD_OF_VIEW_DEGREES_MAX );
vlc_viewpoint_clip( &priv->viewpoint );
vout_thread_t **pp_vout;
size_t i_vout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment