AI_SDB_VisitorFlags Struct Reference

#include <AI_SDB_VisitorBase.h>

List of all members.


Detailed Description

AI_SDB_VisitorFlags helper struct.

This class contains a boolean flag, for specifying that a primitive is visible or contained or whatever. There is also a "antitest" flag that says an object is certainly NOT visible or contained, for when you want that information.

Also within the class is a bunch of bits that be used by the visitor for transferring state between calls to the visitor. Using the view frustum visitor as an example, if you call VisibilityTest() for a bounding box and that bbox is found to be totally on the 'inside' of one of the frustum sides, the bit flags for that side will be turned off in the returned AI_SDB_VisitorFlags value. For nested data structures, you can use this updated AI_SDB_VisitorFlags when doing VisibilityTest() calls on enclosed nodes; because of the bit flags, these child nodes won't require the full set of AI_Plane tests.

You can of course ignore all this for simplicity and always pass in the default constructed AI_SDB_VisitorFlags. The visitor should still work and return the exact same set of elements, it will just be a bit slower because it is doing some redundant tests. You may also want to avoid the whole bitflag thing when using simple heirarchy elements or debugging scaffolding elements.

The exact meaning of the activeflags varies with the visitor, so don't try to take the AI_SDB_VisitorFlags result from one visitor and use it in another visitor...

Public Types

enum  { MAXVISITORFLAGS = 15 }

Public Member Functions

 AI_SDB_VisitorFlags (bool c=true, bool d=false, int initflags=~0)
 by default test=true, antitest=false, such that objects are rejected only if they are known not to be visible
 AI_SDB_VisitorFlags (const AI_SDB_VisitorFlags &copyme)
bool TestResult ()
bool AntiTestResult ()

Public Attributes

bool m_test
bool m_antitest
unsigned short m_activeflags


Member Enumeration Documentation

anonymous enum

Enumerator:
MAXVISITORFLAGS 


Constructor & Destructor Documentation

AI_SDB_VisitorFlags::AI_SDB_VisitorFlags ( bool  c = true,
bool  d = false,
int  initflags = ~0 
) [inline]

by default test=true, antitest=false, such that objects are rejected only if they are known not to be visible

AI_SDB_VisitorFlags::AI_SDB_VisitorFlags ( const AI_SDB_VisitorFlags copyme  )  [inline]


Member Function Documentation

bool AI_SDB_VisitorFlags::TestResult (  )  [inline]

bool AI_SDB_VisitorFlags::AntiTestResult (  )  [inline]


Member Data Documentation


The documentation for this struct was generated from the following file: