libnds
Functions
postest.h File Reference

Position Test Functions. More...

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

Functions

static void PosTest (v16 x, v16 y, v16 z)
 Performs a position test. More...
 
static void PosTest_Asynch (v16 x, v16 y, v16 z)
 Starts a position test asynchronously. More...
 
static bool PosTestBusy (void)
 Checks if a position test is being performed. More...
 
static int32_t PosTestWresult (void)
 Returns the distance from the camera of the last position test. More...
 
static int32_t PosTestXresult (void)
 Returns the absolute X position of the last position test (location if the modelview matrix was identity) More...
 
static int32_t PosTestYresult (void)
 Returns the absolute Y position of the last position test (location if the modelview matrix was identity). More...
 
static int32_t PosTestZresult (void)
 Returns the 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 10 times faster than a box test.

Function Documentation

◆ PosTest()

static void PosTest ( v16  x,
v16  y,
v16  z 
)
inlinestatic

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.

◆ PosTest_Asynch()

static void PosTest_Asynch ( v16  x,
v16  y,
v16  z 
)
inlinestatic

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.

◆ PosTestBusy()

static bool PosTestBusy ( void  )
inlinestatic

Checks if a position test is being performed.

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

◆ PosTestWresult()

static int32_t PosTestWresult ( void  )
inlinestatic

Returns the distance from the camera of the last position test.

Returns
W magnitude

◆ PosTestXresult()

static int32_t PosTestXresult ( void  )
inlinestatic

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

Returns
Absolute X position

◆ PosTestYresult()

static int32_t PosTestYresult ( void  )
inlinestatic

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

Returns
Absolute Y position.

◆ PosTestZresult()

static int32_t PosTestZresult ( void  )
inlinestatic

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

Returns
Absolute Z position.