libnds
Functions
postest.h File Reference

Position Test Functions.
More...

#include <nds/arm9/video.h>
#include <nds/arm9/videoGL.h>

Functions

GL_STATIC_INL void PosTest (v16 x, v16 y, v16 z)
 Performs a position test. More...
 
GL_STATIC_INL void PosTest_Asynch (v16 x, v16 y, v16 z)
 Starts a position test asynchronously. More...
 
GL_STATIC_INL bool PosTestBusy ()
 true if the hardware is currently performing a position/vertex/box test. More...
 
GL_STATIC_INL int32 PosTestWresult ()
 Returns the distance from the camera of the last position test, pretty darn useful. More...
 
GL_STATIC_INL int32 PosTestXresult ()
 Returns absolute X position of the last position test (location if the modelview matrix was identity) More...
 
GL_STATIC_INL int32 PosTestYresult ()
 Returns absolute Y position of the last position test (location if the modelview matrix was identity) More...
 
GL_STATIC_INL int32 PosTestZresult ()
 Returns absolute Z position of the last position test (location if the modelview matrix was identity) More...
 

Detailed Description

Position Test Functions.

The position test multiplies a given vector by the position matrix and returns the coords(x,y,z,w). The position test is really quick, about 10x faster than a box test.

Function Documentation

GL_STATIC_INL void PosTest ( v16  x,
v16  y,
v16  z 
)

Performs a position test.

Parameters
xspecifies x offset from the current modelview matrix
yspecifies y offset from the current modelview matrix
zspecifies z offset from the current modelview matrix
GL_STATIC_INL void PosTest_Asynch ( v16  x,
v16  y,
v16  z 
)

Starts a position test asynchronously.

Parameters
xspecifies x offset from the current modelview matrix
yspecifies y offset from the current modelview matrix
zspecifies z offset from the current modelview matrix
GL_STATIC_INL bool PosTestBusy ( )

true if the hardware is currently performing a position/vertex/box test.

Returns
whether a test is being performed
GL_STATIC_INL int32 PosTestWresult ( )

Returns the distance from the camera of the last position test, pretty darn useful.

Returns
W magnitude
GL_STATIC_INL int32 PosTestXresult ( )

Returns absolute X position of the last position test (location if the modelview matrix was identity)

Returns
Absolute X position
GL_STATIC_INL int32 PosTestYresult ( )

Returns absolute Y position of the last position test (location if the modelview matrix was identity)

Returns
Absolute Y position
GL_STATIC_INL int32 PosTestZresult ( )

Returns absolute Z position of the last position test (location if the modelview matrix was identity)

Returns
Absolute Z position