pspsdk-1.0+beta2
pspgum.h File Reference
#include <psptypes.h>
Include dependency graph for pspgum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sceGumDrawArray (int prim, int vtype, int count, const void *indices, const void *vertices)
void sceGumDrawArrayN (int prim, int vtype, int count, int a3, const void *indices, const void *vertices)
void sceGumDrawBezier (int vtype, int ucount, int vcount, const void *indices, const void *vertices)
void sceGumDrawSpline (int vtype, int ucount, int vcount, int uedge, int vedge, const void *indices, const void *vertices)
void sceGumLoadIdentity (void)
 Load identity matrix.
void sceGumLoadMatrix (const ScePspFMatrix4 *m)
 Load matrix.
void sceGumLookAt (ScePspFVector3 *eye, ScePspFVector3 *center, ScePspFVector3 *up)
void sceGumMatrixMode (int mode)
 Select which matrix stack to operate on.
void sceGumMultMatrix (const ScePspFMatrix4 *m)
 Multiply current matrix with input.
void sceGumOrtho (float left, float right, float bottom, float top, float near, float far)
 Apply ortho projection matrix.
void sceGumPerspective (float fovy, float aspect, float near, float far)
 Apply perspective projection matrix.
void sceGumPopMatrix (void)
 Pop matrix from stack.
void sceGumPushMatrix (void)
 Push current matrix onto stack.
void sceGumRotateX (float angle)
 Rotate around the X axis.
void sceGumRotateY (float angle)
 Rotate around the Y axis.
void sceGumRotateZ (float angle)
 Rotate around the Z axis.
void sceGumRotateXYZ (const ScePspFVector3 *v)
 Rotate around all 3 axis in order X, Y, Z.
void sceGumRotateZYX (const ScePspFVector3 *v)
 Rotate around all 3 axis in order Z, Y, X.
void sceGumScale (const ScePspFVector3 *v)
 Scale matrix.
void sceGumStoreMatrix (ScePspFMatrix4 *m)
 Store current matrix in the stack.
void sceGumTranslate (const ScePspFVector3 *v)
 Translate coordinate system.
void sceGumUpdateMatrix (void)
 Explicitly flush dirty matrices to the hardware.
void sceGumFullInverse ()
 Invert 4x4 matrix.
void sceGumFastInverse ()
 Invert orthonogal 4x4 matrix.
void sceGumBeginObject (int vtype, int count, const void *indices, const void *vertices)
 Stack-aware version of sceGuBeginObject() (look in pspgu.h for description)
void sceGumEndObject ()
 Stack-aware version of sceGuEndObject()
void gumInit (void)
void gumLoadIdentity (ScePspFMatrix4 *m)
 Load matrix with identity.
void gumLoadMatrix (ScePspFMatrix4 *r, const ScePspFMatrix4 *a)
void gumLookAt (ScePspFMatrix4 *m, ScePspFVector3 *eye, ScePspFVector3 *center, ScePspFVector3 *up)
void gumMultMatrix (ScePspFMatrix4 *result, const ScePspFMatrix4 *a, const ScePspFMatrix4 *b)
void gumOrtho (ScePspFMatrix4 *m, float left, float right, float bottom, float top, float near, float far)
void gumPerspective (ScePspFMatrix4 *m, float fovy, float aspect, float near, float far)
void gumRotateX (ScePspFMatrix4 *m, float angle)
void gumRotateXYZ (ScePspFMatrix4 *m, const ScePspFVector3 *v)
void gumRotateY (ScePspFMatrix4 *m, float angle)
void gumRotateZ (ScePspFMatrix4 *m, float angle)
void gumRotateZYX (ScePspFMatrix4 *m, const ScePspFVector3 *v)
void gumScale (ScePspFMatrix4 *m, const ScePspFVector3 *v)
void gumTranslate (ScePspFMatrix4 *m, const ScePspFVector3 *v)
void gumFullInverse (ScePspFMatrix4 *r, const ScePspFMatrix4 *a)
void gumFastInverse (ScePspFMatrix4 *r, const ScePspFMatrix4 *a)
 Invert orthonogal 4x4 matrix.
void gumCrossProduct (ScePspFVector3 *r, const ScePspFVector3 *a, const ScePspFVector3 *b)
float gumDotProduct (const ScePspFVector3 *a, const ScePspFVector3 *b)
void gumNormalize (ScePspFVector3 *v)

Function Documentation

void gumCrossProduct ( ScePspFVector3 r,
const ScePspFVector3 a,
const ScePspFVector3 b 
)
float gumDotProduct ( const ScePspFVector3 a,
const ScePspFVector3 b 
)
void gumFastInverse ( ScePspFMatrix4 r,
const ScePspFMatrix4 a 
)

Invert orthonogal 4x4 matrix.

Note that the matrix in the stack has to be orthonogal (that is, all rotational axises must be unit length & orthonogal against the others), otherwise the result of the function cannot be depended on. If you need to invert a matrix that is not orthonogal, use gumFullInverse().

Parameters
r- Matrix receiving result
a- Orthonogal matrix that is to be inverted
void gumFullInverse ( ScePspFMatrix4 r,
const ScePspFMatrix4 a 
)
void gumInit ( void  )
void gumLoadIdentity ( ScePspFMatrix4 m)

Load matrix with identity.

Parameters
m- Matrix to load with identity
void gumLoadMatrix ( ScePspFMatrix4 r,
const ScePspFMatrix4 a 
)
void gumLookAt ( ScePspFMatrix4 m,
ScePspFVector3 eye,
ScePspFVector3 center,
ScePspFVector3 up 
)
void gumMultMatrix ( ScePspFMatrix4 result,
const ScePspFMatrix4 a,
const ScePspFMatrix4 b 
)
void gumNormalize ( ScePspFVector3 v)
void gumOrtho ( ScePspFMatrix4 m,
float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)
void gumPerspective ( ScePspFMatrix4 m,
float  fovy,
float  aspect,
float  near,
float  far 
)
void gumRotateX ( ScePspFMatrix4 m,
float  angle 
)
void gumRotateXYZ ( ScePspFMatrix4 m,
const ScePspFVector3 v 
)
void gumRotateY ( ScePspFMatrix4 m,
float  angle 
)
void gumRotateZ ( ScePspFMatrix4 m,
float  angle 
)
void gumRotateZYX ( ScePspFMatrix4 m,
const ScePspFVector3 v 
)
void gumScale ( ScePspFMatrix4 m,
const ScePspFVector3 v 
)
void gumTranslate ( ScePspFMatrix4 m,
const ScePspFVector3 v 
)
void sceGumBeginObject ( int  vtype,
int  count,
const void *  indices,
const void *  vertices 
)

Stack-aware version of sceGuBeginObject() (look in pspgu.h for description)

Note
NOT YET IMPLEMENTED
Parameters
vtype- Vertex type to process
count- Number of vertices to test
indices- Optional index-list
vertices- Vertex-list
void sceGumDrawArray ( int  prim,
int  vtype,
int  count,
const void *  indices,
const void *  vertices 
)
void sceGumDrawArrayN ( int  prim,
int  vtype,
int  count,
int  a3,
const void *  indices,
const void *  vertices 
)
void sceGumDrawBezier ( int  vtype,
int  ucount,
int  vcount,
const void *  indices,
const void *  vertices 
)
void sceGumDrawSpline ( int  vtype,
int  ucount,
int  vcount,
int  uedge,
int  vedge,
const void *  indices,
const void *  vertices 
)
void sceGumEndObject ( )

Stack-aware version of sceGuEndObject()

Note
NOT YET IMPLEMENTED
void sceGumFastInverse ( )

Invert orthonogal 4x4 matrix.

Note that the matrix in the stack has to be orthonogal (that is, all rotational axises must be unit length & orthonogal against the others), otherwise the result of the function cannot be depended on. If you need to invert a matrix that is not orthonogal, use sceGumFullInverse().

void sceGumFullInverse ( )

Invert 4x4 matrix.

This invert algorithm can operate on matrices that are not orthongal (See sceGumFastInverse())

void sceGumLoadIdentity ( void  )

Load identity matrix.

[1 0 0 0] [0 1 0 0] [0 0 1 0] [0 0 0 1]

void sceGumLoadMatrix ( const ScePspFMatrix4 m)

Load matrix.

Parameters
m- Matrix to load into stack
void sceGumLookAt ( ScePspFVector3 eye,
ScePspFVector3 center,
ScePspFVector3 up 
)
void sceGumMatrixMode ( int  mode)

Select which matrix stack to operate on.

Available matrix modes are:

  • GU_PROJECTION
  • GU_VIEW
  • GU_MODEL
  • GU_TEXTURE
Parameters
mode- Matrix mode to use
void sceGumMultMatrix ( const ScePspFMatrix4 m)

Multiply current matrix with input.

Parameters
m- Matrix to multiply stack with
void sceGumOrtho ( float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Apply ortho projection matrix.

Note
The matrix loses its orthonogal status after executing this function.
void sceGumPerspective ( float  fovy,
float  aspect,
float  near,
float  far 
)

Apply perspective projection matrix.

Note
The matrix loses its orthonogal status after executing this function.
void sceGumPopMatrix ( void  )

Pop matrix from stack.

void sceGumPushMatrix ( void  )

Push current matrix onto stack.

void sceGumRotateX ( float  angle)

Rotate around the X axis.

Parameters
angle- Angle in radians
void sceGumRotateXYZ ( const ScePspFVector3 v)

Rotate around all 3 axis in order X, Y, Z.

Parameters
v- Pointer to vector containing angles
void sceGumRotateY ( float  angle)

Rotate around the Y axis.

Parameters
angle- Angle in radians
void sceGumRotateZ ( float  angle)

Rotate around the Z axis.

Parameters
angle- Angle in radians
void sceGumRotateZYX ( const ScePspFVector3 v)

Rotate around all 3 axis in order Z, Y, X.

Parameters
v- Pointer to vector containing angles
void sceGumScale ( const ScePspFVector3 v)

Scale matrix.

Note
The matrix loses its orthonogal status after executing this function.
void sceGumStoreMatrix ( ScePspFMatrix4 m)

Store current matrix in the stack.

Parameters
m- Matrix to write result to
void sceGumTranslate ( const ScePspFVector3 v)

Translate coordinate system.

Parameters
v- Translation coordinates
void sceGumUpdateMatrix ( void  )

Explicitly flush dirty matrices to the hardware.