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.
GL_STATIC_INL void PosTest_Asynch (v16 x, v16 y, v16 z)
 Starts a position test asynchronously.
GL_STATIC_INL bool PosTestBusy ()
 true if the hardware is currently performing a position/vertex/box 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:
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
Examples:
Graphics/3D/Picking/source/main.cpp.
GL_STATIC_INL bool PosTestBusy ( )

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

Returns:
whether a test is being performed
Examples:
Graphics/3D/Picking/source/main.cpp.
GL_STATIC_INL int32 PosTestWresult ( )

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

Returns:
W magnitude
Examples:
Graphics/3D/Picking/source/main.cpp.
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
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines