VLC  4.0.0-dev
Functions
viewpoint.c File Reference
Include dependency graph for viewpoint.c:

Functions

void vlc_viewpoint_to_4x4 (const vlc_viewpoint_t *vp, float *m)
 Generate the 4x4 transform matrix corresponding to a viewpoint. More...
 

Function Documentation

◆ 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().