nds/arm9/postest.h File Reference

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. More...

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

Functions

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


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:
x specifies x offset from the current modelview matrix
y specifies y offset from the current modelview matrix
z specifies z offset from the current modelview matrix
00058                                                 {
00059         PosTest_Asynch(x,y,z);
00060         while(PosTestBusy());
00061 }

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

Starts a position test asynchronously.

Parameters:
x specifies x offset from the current modelview matrix
y specifies y offset from the current modelview matrix
z specifies z offset from the current modelview matrix
00049                                                       {
00050         GFX_POS_TEST = VERTEX_PACK(x, y);
00051         GFX_POS_TEST = z;
00052 }

GL_STATIC_INL bool PosTestBusy (  ) 

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

Returns:
whether a test is being performed
00036                                  {
00037         return (GFX_STATUS & BIT(0))!=0;
00038 }

GL_STATIC_INL int32 PosTestWresult (  ) 

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

Returns:
W magnitude
00065                                      {
00066         return GFX_POS_RESULT[3];
00067 }

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
00071                                      {
00072         return GFX_POS_RESULT[0];
00073 }

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
00077                                      {
00078         return GFX_POS_RESULT[1];
00079 }

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
00083                                      {
00084         return GFX_POS_RESULT[2];
00085 }


Generated on Tue Jan 22 15:48:55 2008 for libnds(ARM9) by  doxygen 1.5.4