G3_BoxTest

# G3*_BoxTest

## C Specification

      #include <nitro/gx/g3imm.h>
      #include <nitro/gx/g3b.h>
      #include <nitro/gx/g3c.h>

      void G3_BoxTest(const GXBoxTestParam * box);

      // Below are APIs for creating the display list (command list):
      void G3BS_BoxTest(GXDLInfo * info, const GXBoxTestParam * box);
      void G3B_BoxTest(GXDLInfo * info, const GXBoxTestParam * box);
      void G3CS_BoxTest(GXDLInfo * info, const GXBoxTestParam * box);
      void G3C_BoxTest(GXDLInfo * info, const GXBoxTestParam * box);

## Arguments

box | Pointer to the coordinate data of the box to test

## Return Values

None.

## Description

This function tests the result of applying the current matrix to the `box` passed in the argument to determine whether the box is in the view volume.*Set the box data to `*box`. Results are obtained with `G3X_GetBoxTestResult`. When calling this function, the FAR plane intersecting clipping flag and 1-dot polygon display flag for the polygon attribute must first be set to 1. When either of these flags are set to 0, the test result may be incorrect. The polygon attribute is reflected when the Begin command is issued, so the BoxTest should be performed in this order:

`PolygonAttr` -> `Begin` -> `End` -> `BoxTest`

    typedef union
    {
    u32 val[3];
    struct
        {
    fx16 x;           // X coordinate of reference vertex
    fx16 y;           // y coordinate of reference vertex
    fx16 z;           // x coordinate of reference vertex
    fx16 width;       // width of the box to be tested
    fx16 height;      // height of the box to be tested
    fx16 depth;       // depth of the box to be tested
        };
    }
    GXBoxTestParam;

## See Also

`G3_PositionTest, G3_VectorTest, G3X_GetBoxTestResult`

## Revision History

07/29/2004 Added description of the polygon attribute setting
01/19/2004 Initial Version