My Project
Loading...
Searching...
No Matches
Classes | Typedefs
Matrix Controls

Classes

struct  GPU_MatrixStack
 

Typedefs

typedef struct GPU_MatrixStack GPU_MatrixStack
 
DECLSPEC float SDLCALL GPU_VectorLength (const float *vec3)
 
DECLSPEC void SDLCALL GPU_VectorNormalize (float *vec3)
 
DECLSPEC float SDLCALL GPU_VectorDot (const float *A, const float *B)
 
DECLSPEC void SDLCALL GPU_VectorCross (float *result, const float *A, const float *B)
 
DECLSPEC void SDLCALL GPU_VectorCopy (float *result, const float *A)
 
DECLSPEC void SDLCALL GPU_VectorApplyMatrix (float *vec3, const float *matrix_4x4)
 
DECLSPEC void SDLCALL GPU_Vector4ApplyMatrix (float *vec4, const float *matrix_4x4)
 
DECLSPEC void SDLCALL GPU_MatrixCopy (float *result, const float *A)
 
DECLSPEC void SDLCALL GPU_MatrixIdentity (float *result)
 
DECLSPEC void SDLCALL GPU_MatrixOrtho (float *result, float left, float right, float bottom, float top, float z_near, float z_far)
 
DECLSPEC void SDLCALL GPU_MatrixFrustum (float *result, float left, float right, float bottom, float top, float z_near, float z_far)
 
DECLSPEC void SDLCALL GPU_MatrixPerspective (float *result, float fovy, float aspect, float z_near, float z_far)
 
DECLSPEC void SDLCALL GPU_MatrixLookAt (float *matrix, float eye_x, float eye_y, float eye_z, float target_x, float target_y, float target_z, float up_x, float up_y, float up_z)
 
DECLSPEC void SDLCALL GPU_MatrixTranslate (float *result, float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_MatrixScale (float *result, float sx, float sy, float sz)
 
DECLSPEC void SDLCALL GPU_MatrixRotate (float *result, float degrees, float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_MatrixMultiply (float *result, const float *A, const float *B)
 
DECLSPEC void SDLCALL GPU_MultiplyAndAssign (float *result, const float *B)
 
DECLSPEC const char *SDLCALL GPU_GetMatrixString (const float *A)
 
DECLSPEC float *SDLCALL GPU_GetCurrentMatrix (void)
 
DECLSPEC float *SDLCALL GPU_GetTopMatrix (GPU_MatrixStack *stack)
 
DECLSPEC float *SDLCALL GPU_GetModel (void)
 
DECLSPEC float *SDLCALL GPU_GetView (void)
 
DECLSPEC float *SDLCALL GPU_GetProjection (void)
 
DECLSPEC void SDLCALL GPU_GetModelViewProjection (float *result)
 
DECLSPEC GPU_MatrixStack *SDLCALL GPU_CreateMatrixStack (void)
 
DECLSPEC void SDLCALL GPU_FreeMatrixStack (GPU_MatrixStack *stack)
 
DECLSPEC void SDLCALL GPU_InitMatrixStack (GPU_MatrixStack *stack)
 
DECLSPEC void SDLCALL GPU_CopyMatrixStack (const GPU_MatrixStack *source, GPU_MatrixStack *dest)
 
DECLSPEC void SDLCALL GPU_ClearMatrixStack (GPU_MatrixStack *stack)
 
DECLSPEC void SDLCALL GPU_ResetProjection (GPU_Target *target)
 
DECLSPEC void SDLCALL GPU_MatrixMode (GPU_Target *target, int matrix_mode)
 
DECLSPEC void SDLCALL GPU_SetProjection (const float *A)
 
DECLSPEC void SDLCALL GPU_SetView (const float *A)
 
DECLSPEC void SDLCALL GPU_SetModel (const float *A)
 
DECLSPEC void SDLCALL GPU_SetProjectionFromStack (GPU_MatrixStack *stack)
 
DECLSPEC void SDLCALL GPU_SetViewFromStack (GPU_MatrixStack *stack)
 
DECLSPEC void SDLCALL GPU_SetModelFromStack (GPU_MatrixStack *stack)
 
DECLSPEC void SDLCALL GPU_PushMatrix (void)
 
DECLSPEC void SDLCALL GPU_PopMatrix (void)
 
DECLSPEC void SDLCALL GPU_LoadIdentity (void)
 
DECLSPEC void SDLCALL GPU_LoadMatrix (const float *matrix4x4)
 
DECLSPEC void SDLCALL GPU_Ortho (float left, float right, float bottom, float top, float z_near, float z_far)
 
DECLSPEC void SDLCALL GPU_Frustum (float left, float right, float bottom, float top, float z_near, float z_far)
 
DECLSPEC void SDLCALL GPU_Perspective (float fovy, float aspect, float z_near, float z_far)
 
DECLSPEC void SDLCALL GPU_LookAt (float eye_x, float eye_y, float eye_z, float target_x, float target_y, float target_z, float up_x, float up_y, float up_z)
 
DECLSPEC void SDLCALL GPU_Translate (float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_Scale (float sx, float sy, float sz)
 
DECLSPEC void SDLCALL GPU_Rotate (float degrees, float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_MultMatrix (const float *matrix4x4)
 

Detailed Description

Typedef Documentation

◆ GPU_MatrixStack

Matrix stack data structure for global vertex transforms.

Function Documentation

◆ GPU_ClearMatrixStack()

DECLSPEC void SDLCALL GPU_ClearMatrixStack ( GPU_MatrixStack stack)

Deletes matrices in the given stack.

◆ GPU_CopyMatrixStack()

DECLSPEC void SDLCALL GPU_CopyMatrixStack ( const GPU_MatrixStack source,
GPU_MatrixStack dest 
)

Copies matrices from one stack to another.

◆ GPU_CreateMatrixStack()

DECLSPEC GPU_MatrixStack *SDLCALL GPU_CreateMatrixStack ( void  )

Returns a newly allocated matrix stack that has already been initialized.

◆ GPU_FreeMatrixStack()

DECLSPEC void SDLCALL GPU_FreeMatrixStack ( GPU_MatrixStack stack)

Frees the memory for the matrix stack and any matrices it contains.

◆ GPU_Frustum()

DECLSPEC void SDLCALL GPU_Frustum ( float  left,
float  right,
float  bottom,
float  top,
float  z_near,
float  z_far 
)

Multiplies a perspective projection matrix into the current matrix.

◆ GPU_GetCurrentMatrix()

DECLSPEC float *SDLCALL GPU_GetCurrentMatrix ( void  )

Returns the current matrix from the active target. Returns NULL if stack is empty.

◆ GPU_GetMatrixString()

DECLSPEC const char *SDLCALL GPU_GetMatrixString ( const float *  A)

Returns an internal string that represents the contents of matrix A.

◆ GPU_GetModel()

DECLSPEC float *SDLCALL GPU_GetModel ( void  )

Returns the current model matrix from the active target. Returns NULL if stack is empty.

◆ GPU_GetModelViewProjection()

DECLSPEC void SDLCALL GPU_GetModelViewProjection ( float *  result)

Copies the current modelview-projection matrix from the active target into the given 'result' matrix (result = P*V*M).

◆ GPU_GetProjection()

DECLSPEC float *SDLCALL GPU_GetProjection ( void  )

Returns the current projection matrix from the active target. Returns NULL if stack is empty.

◆ GPU_GetTopMatrix()

DECLSPEC float *SDLCALL GPU_GetTopMatrix ( GPU_MatrixStack stack)

Returns the current matrix from the top of the matrix stack. Returns NULL if stack is empty.

◆ GPU_GetView()

DECLSPEC float *SDLCALL GPU_GetView ( void  )

Returns the current view matrix from the active target. Returns NULL if stack is empty.

◆ GPU_InitMatrixStack()

DECLSPEC void SDLCALL GPU_InitMatrixStack ( GPU_MatrixStack stack)

Allocate new matrices for the given stack.

◆ GPU_LoadIdentity()

DECLSPEC void SDLCALL GPU_LoadIdentity ( void  )

Fills current matrix with the identity matrix.

◆ GPU_LoadMatrix()

DECLSPEC void SDLCALL GPU_LoadMatrix ( const float *  matrix4x4)

Copies a given matrix to be the current matrix.

◆ GPU_LookAt()

DECLSPEC void SDLCALL GPU_LookAt ( float  eye_x,
float  eye_y,
float  eye_z,
float  target_x,
float  target_y,
float  target_z,
float  up_x,
float  up_y,
float  up_z 
)

Multiplies a view matrix into the current matrix.

◆ GPU_MatrixCopy()

DECLSPEC void SDLCALL GPU_MatrixCopy ( float *  result,
const float *  A 
)

Overwrite 'result' matrix with the values from matrix A.

◆ GPU_MatrixFrustum()

DECLSPEC void SDLCALL GPU_MatrixFrustum ( float *  result,
float  left,
float  right,
float  bottom,
float  top,
float  z_near,
float  z_far 
)

Multiplies a perspective projection matrix into the given matrix.

◆ GPU_MatrixIdentity()

DECLSPEC void SDLCALL GPU_MatrixIdentity ( float *  result)

Fills 'result' matrix with the identity matrix.

◆ GPU_MatrixLookAt()

DECLSPEC void SDLCALL GPU_MatrixLookAt ( float *  matrix,
float  eye_x,
float  eye_y,
float  eye_z,
float  target_x,
float  target_y,
float  target_z,
float  up_x,
float  up_y,
float  up_z 
)

Multiplies a view matrix into the given matrix.

◆ GPU_MatrixMode()

DECLSPEC void SDLCALL GPU_MatrixMode ( GPU_Target target,
int  matrix_mode 
)

Sets the active target and changes matrix mode to GPU_PROJECTION, GPU_VIEW, or GPU_MODEL. Further matrix stack operations manipulate that particular stack.

◆ GPU_MatrixMultiply()

DECLSPEC void SDLCALL GPU_MatrixMultiply ( float *  result,
const float *  A,
const float *  B 
)

Multiplies matrices A and B and stores the result in the given 'result' matrix (result = A*B). Do not use A or B as 'result'.

See also
GPU_MultiplyAndAssign

◆ GPU_MatrixOrtho()

DECLSPEC void SDLCALL GPU_MatrixOrtho ( float *  result,
float  left,
float  right,
float  bottom,
float  top,
float  z_near,
float  z_far 
)

Multiplies an orthographic projection matrix into the given matrix.

◆ GPU_MatrixPerspective()

DECLSPEC void SDLCALL GPU_MatrixPerspective ( float *  result,
float  fovy,
float  aspect,
float  z_near,
float  z_far 
)

Multiplies a perspective projection matrix into the given matrix.

◆ GPU_MatrixRotate()

DECLSPEC void SDLCALL GPU_MatrixRotate ( float *  result,
float  degrees,
float  x,
float  y,
float  z 
)

Multiplies a rotation matrix into the given matrix.

◆ GPU_MatrixScale()

DECLSPEC void SDLCALL GPU_MatrixScale ( float *  result,
float  sx,
float  sy,
float  sz 
)

Multiplies a scaling matrix into the given matrix.

◆ GPU_MatrixTranslate()

DECLSPEC void SDLCALL GPU_MatrixTranslate ( float *  result,
float  x,
float  y,
float  z 
)

Adds a translation into the given matrix.

◆ GPU_MultiplyAndAssign()

DECLSPEC void SDLCALL GPU_MultiplyAndAssign ( float *  result,
const float *  B 
)

Multiplies matrices 'result' and B and stores the result in the given 'result' matrix (result = result * B).

◆ GPU_MultMatrix()

DECLSPEC void SDLCALL GPU_MultMatrix ( const float *  matrix4x4)

Multiplies a given matrix into the current matrix.

◆ GPU_Ortho()

DECLSPEC void SDLCALL GPU_Ortho ( float  left,
float  right,
float  bottom,
float  top,
float  z_near,
float  z_far 
)

Multiplies an orthographic projection matrix into the current matrix.

◆ GPU_Perspective()

DECLSPEC void SDLCALL GPU_Perspective ( float  fovy,
float  aspect,
float  z_near,
float  z_far 
)

Multiplies a perspective projection matrix into the current matrix.

◆ GPU_PopMatrix()

DECLSPEC void SDLCALL GPU_PopMatrix ( void  )

Removes the current matrix from the stack, restoring the previously pushed matrix.

◆ GPU_PushMatrix()

DECLSPEC void SDLCALL GPU_PushMatrix ( void  )

Pushes the current matrix as a new matrix stack item to be restored later.

◆ GPU_ResetProjection()

DECLSPEC void SDLCALL GPU_ResetProjection ( GPU_Target target)

Reapplies the default orthographic projection matrix, based on camera and coordinate settings.

◆ GPU_Rotate()

DECLSPEC void SDLCALL GPU_Rotate ( float  degrees,
float  x,
float  y,
float  z 
)

Multiplies a rotation matrix into the current matrix.

◆ GPU_Scale()

DECLSPEC void SDLCALL GPU_Scale ( float  sx,
float  sy,
float  sz 
)

Multiplies a scaling matrix into the current matrix.

◆ GPU_SetModel()

DECLSPEC void SDLCALL GPU_SetModel ( const float *  A)

Copies the given matrix to the active target's model matrix.

◆ GPU_SetModelFromStack()

DECLSPEC void SDLCALL GPU_SetModelFromStack ( GPU_MatrixStack stack)

Copies the given matrix to the active target's model matrix.

◆ GPU_SetProjection()

DECLSPEC void SDLCALL GPU_SetProjection ( const float *  A)

Copies the given matrix to the active target's projection matrix.

◆ GPU_SetProjectionFromStack()

DECLSPEC void SDLCALL GPU_SetProjectionFromStack ( GPU_MatrixStack stack)

Copies the given matrix to the active target's projection matrix.

◆ GPU_SetView()

DECLSPEC void SDLCALL GPU_SetView ( const float *  A)

Copies the given matrix to the active target's view matrix.

◆ GPU_SetViewFromStack()

DECLSPEC void SDLCALL GPU_SetViewFromStack ( GPU_MatrixStack stack)

Copies the given matrix to the active target's view matrix.

◆ GPU_Translate()

DECLSPEC void SDLCALL GPU_Translate ( float  x,
float  y,
float  z 
)

Adds a translation into the current matrix.

◆ GPU_Vector4ApplyMatrix()

DECLSPEC void SDLCALL GPU_Vector4ApplyMatrix ( float *  vec4,
const float *  matrix_4x4 
)

Multiplies the given matrix into the given vector (vec4 = matrix*vec4).

◆ GPU_VectorApplyMatrix()

DECLSPEC void SDLCALL GPU_VectorApplyMatrix ( float *  vec3,
const float *  matrix_4x4 
)

Multiplies the given matrix into the given vector (vec3 = matrix*vec3).

◆ GPU_VectorCopy()

DECLSPEC void SDLCALL GPU_VectorCopy ( float *  result,
const float *  A 
)

Overwrite 'result' vector with the values from vector A.

◆ GPU_VectorCross()

DECLSPEC void SDLCALL GPU_VectorCross ( float *  result,
const float *  A,
const float *  B 
)

Performs the cross product of vectors A and B (result = A x B). Do not use A or B as 'result'.

◆ GPU_VectorDot()

DECLSPEC float SDLCALL GPU_VectorDot ( const float *  A,
const float *  B 
)

Returns the dot product of two vectors.

◆ GPU_VectorLength()

DECLSPEC float SDLCALL GPU_VectorLength ( const float *  vec3)

Returns the magnitude (length) of the given vector.

◆ GPU_VectorNormalize()

DECLSPEC void SDLCALL GPU_VectorNormalize ( float *  vec3)

Modifies the given vector so that it has a new length of 1.