VLC  4.0.0-dev
Data Structures | Macros | Functions
vlc_viewpoint.h File Reference

Video and audio viewpoint struct and helpers. More...

Include dependency graph for vlc_viewpoint.h:

Go to the source code of this file.

Data Structures

struct  vlc_viewpoint_t
 Viewpoints. More...
 

Macros

#define FIELD_OF_VIEW_DEGREES_DEFAULT   80.f
 
#define FIELD_OF_VIEW_DEGREES_MAX   150.f
 
#define FIELD_OF_VIEW_DEGREES_MIN   20.f
 

Functions

static void vlc_viewpoint_init (vlc_viewpoint_t *p_vp)
 
static void vlc_viewpoint_clip (vlc_viewpoint_t *p_vp)
 
static void vlc_viewpoint_reverse (vlc_viewpoint_t *dst, const vlc_viewpoint_t *src)
 Reverse the viewpoint rotation. More...
 
void vlc_viewpoint_to_4x4 (const vlc_viewpoint_t *vp, float *matrix)
 Generate the 4x4 transform matrix corresponding to a viewpoint. More...
 

Detailed Description

Video and audio viewpoint struct and helpers.

Macro Definition Documentation

◆ FIELD_OF_VIEW_DEGREES_DEFAULT

#define FIELD_OF_VIEW_DEGREES_DEFAULT   80.f

Referenced by vlc_viewpoint_init().

◆ FIELD_OF_VIEW_DEGREES_MAX

#define FIELD_OF_VIEW_DEGREES_MAX   150.f

Referenced by vlc_viewpoint_clip().

◆ FIELD_OF_VIEW_DEGREES_MIN

#define FIELD_OF_VIEW_DEGREES_MIN   20.f

Referenced by vlc_viewpoint_clip().

Function Documentation

◆ vlc_viewpoint_clip()

static void vlc_viewpoint_clip ( vlc_viewpoint_t p_vp)
inlinestatic

◆ vlc_viewpoint_init()

static void vlc_viewpoint_init ( vlc_viewpoint_t p_vp)
inlinestatic

◆ vlc_viewpoint_reverse()

static void vlc_viewpoint_reverse ( vlc_viewpoint_t dst,
const vlc_viewpoint_t src 
)
inlinestatic

Reverse the viewpoint rotation.

It can be used to convert a camera view into a world transformation. It will also copy non-rotation related data from src to dst.

Parameters
dstthe viewpoint with the final reversed rotation
srcthe viewpoint for which the rotation need to be reversed

References vlc_viewpoint_t::fov, vlc_viewpoint_t::pitch, vlc_viewpoint_t::roll, VLC_API, vlc_viewpoint_to_4x4(), and vlc_viewpoint_t::yaw.

◆ vlc_viewpoint_to_4x4()

void vlc_viewpoint_to_4x4 ( const vlc_viewpoint_t vp,
float *  matrix 
)

Generate the 4x4 transform matrix corresponding to a viewpoint.

Convert a vlc_viewpoint_t into a 4x4 transform matrix with a column-major layout. The transformation is applied as-is. you have to reverse the viewpoint with vlc_viewpoint_reverse first if you want to transform the world.

Parameters
vpa valid viewpoint object
matrixa 4x4-sized array which will contain the matrix data

Column-major matrix multiplication mathematically equal to z_rot * x_rot * y_rot

References vlc_viewpoint_t::pitch, vlc_viewpoint_t::roll, and vlc_viewpoint_t::yaw.

Referenced by vlc_viewpoint_reverse().