Track::OcclusionTester Class Reference

Tests if an object can be seen. More...

#include <OcclusionTester.h>

List of all members.

Public Types

 VS_OUT = 0
 completely outside of view area (don't draw)
 VS_IN = 1
 completey inside view area (draw, including all sub volumes)
 VS_PARTIAL = 2
 partially inside view area (draw, but you could test sub volumes individually.)
enum  ViewState { VS_OUT = 0, VS_IN = 1, VS_PARTIAL = 2 }
 Value returned by an. More...

Public Member Functions

 OcclusionTester ()
virtual ~OcclusionTester ()
ViewState operator() (const AxisAlignedBoundingBox &aabb) const
 Test if an axis aligned bounding box is in view.

Public Attributes

btVector3 plane_vectors [5]
 Plane normal vectors.
btScalar plane_distances [5]
 Plane distances from the origin.

Protected Member Functions

bool in_half_space (const btVector3 &point, const unsigned plane_index) const
 test if a point is in a half space defined by a plane equation.


Detailed Description

Tests if an object can be seen.

It knows the camera angle it is being tested against. The camera's view frustum is passed to this class as 5 planes: we ignore the back plane. Objects may use OcclusionTester to test if a bounding volume is in view.

Definition at line 27 of file OcclusionTester.h.


Member Enumeration Documentation

enum Track::OcclusionTester::ViewState

Value returned by an.

Enumerator:
VS_OUT  completely outside of view area (don't draw)
VS_IN  completey inside view area (draw, including all sub volumes)
VS_PARTIAL  partially inside view area (draw, but you could test sub volumes individually.)

Definition at line 31 of file OcclusionTester.h.


Constructor & Destructor Documentation

Track::OcclusionTester::OcclusionTester (  ) 

Definition at line 17 of file OcclusionTester.cpp.

Track::OcclusionTester::~OcclusionTester (  )  [virtual]

Definition at line 21 of file OcclusionTester.cpp.


Member Function Documentation

bool Track::OcclusionTester::in_half_space ( const btVector3 &  point,
const unsigned  plane_index 
) const [inline, protected]

test if a point is in a half space defined by a plane equation.

Definition at line 73 of file OcclusionTester.cpp.

OcclusionTester::ViewState Track::OcclusionTester::operator() ( const AxisAlignedBoundingBox aabb  )  const

Test if an axis aligned bounding box is in view.

Todo:
more testing. It could be outside still, if partially inside two half spaces.

Definition at line 25 of file OcclusionTester.cpp.


Member Data Documentation

btScalar Track::OcclusionTester::plane_distances[5]

Plane distances from the origin.

Definition at line 45 of file OcclusionTester.h.

btVector3 Track::OcclusionTester::plane_vectors[5]

Plane normal vectors.

A point p is in view if p dot plane_vector[i] < plane_distance[i] for all planes i.

Definition at line 42 of file OcclusionTester.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:18 2010 by Doxygen version 1.4.7 for Racer version svn335.