Varjo Native SDK
Varjo_math.h File Reference

Go to the source code of this file.

Functions

struct varjo_Vector3D varjo_GetEulerAngles (struct varjo_Matrix *matrix, varjo_EulerOrder order, varjo_RotationDirection direction, varjo_Handedness handedness)
 Extracts the euler angles in radians from the given matrix. More...
 
struct varjo_Vector3D varjo_GetPosition (struct varjo_Matrix *matrix)
 Gets the translation part from a transformation matrix. More...
 
static void varjo_UpdateNearFarPlanes (double *projectionMatrix, varjo_ClipRange clipRange, double nearZ, double farZ)
 Updates the near and far clip plane distances in the projection matrix. More...
 
static struct varjo_Matrix varjo_GetProjectionMatrix (struct varjo_FovTangents *tangents)
 Creates a projection matrix from given FOV tangents. More...
 

Function Documentation

◆ varjo_GetEulerAngles()

struct varjo_Vector3D varjo_GetEulerAngles ( struct varjo_Matrix matrix,
varjo_EulerOrder  order,
varjo_RotationDirection  direction,
varjo_Handedness  handedness 
)

Extracts the euler angles in radians from the given matrix.

Default convention is right handed counter clockwise rotation, where X-axis is negative and Y and Z axes are positive.

Rotations are global, to get local rotations flip the axes. Eg: Global rotation XYZ -> local rotation ZYX.

Parameters
matrixMatrix to extract the angles from.
orderEuler axis order.
directionRotation direction.
handednessRotation Handedness.

◆ varjo_GetPosition()

struct varjo_Vector3D varjo_GetPosition ( struct varjo_Matrix matrix)

Gets the translation part from a transformation matrix.

Parameters
matrixMatrix to extract the translation from.

◆ varjo_GetProjectionMatrix()

static struct varjo_Matrix varjo_GetProjectionMatrix ( struct varjo_FovTangents tangents)
static

Creates a projection matrix from given FOV tangents.

Parameters
tangentsTangents for a view.
Returns
projection Projection matrix with default depth transform.
See also
varjo_UpdateNearFarPlanes() To update the depth transform in the projection matrix.

◆ varjo_UpdateNearFarPlanes()

static void varjo_UpdateNearFarPlanes ( double *  projectionMatrix,
varjo_ClipRange  clipRange,
double  nearZ,
double  farZ 
)
static

Updates the near and far clip plane distances in the projection matrix.

Parameters
projectionMatrixProjection matrix to modify.
clipRangeClip space range (0..1 or -1..1).
nearZPositive distance in meters to the near plane. To indicate depth values reversed, can be greater than farZ.
farZPositive distance in meters to the far plane. To indicate depth values reversed, can be smaller than nearZ.