class TdGfxPfIntersectionTest : public TcGfxIntersectionTest

Performer Cavelib Intersection Test

Inheritance:


Public Classes

enum Sensor
Sensor enum

Public Methods

TdGfxPfIntersectionTest(const TcUtString &isectName, const TdGfxPfIntersectionTest::Sensor sensor, TcGfxComponent &rootNode, const unsigned int &isectMask, const unsigned int &activeMask = 0x01, const int &modeMask = PFTRAV_IS_PATH | PFTRAV_IS_GSET | PFTRAV_IS_CULL_BACK)
Constructor
~TdGfxPfIntersectionTest()
Destructor.
void setActiveSegments(const int &numSegs = 1)
This sets the number of active segments as consecutive bits in the active mask
void setIsectMask(const unsigned int &isectMask)
Sets the mask to search for in the graphics hierarchy.
void setMode(const int &modeMask)
Determines the behavior of the intersection test.
void setRayLength(const float &rayLength, const int &segNum = 0)
Sets the length of a segment
virtual IsectState doTcIntersectionTest()
updates the intersection test based on its current state
const TcUtVector3f& getIsectNormal(const int &segNum = 0)
returns the normal of the last successful intersection
const TcUtVector3f& getLastIsectPoint(const CoordType &type = LOCAL, const int &segNum = 0)
returns the position of the last successful intersection
void setRayStartPositionFromWand(const int &segNum = 0)
Set the start position for a given segment number from the wand sensor
void setRayDirectionFromWand(const int &segNum = 0)
Set the direction for a given segment number from the wand sensor
void setRayStartPositionFromHead(const int &segNum = 0)
Set the start position for a given segment from the head sensor
void setRayDirectionFromHead(const int &segNum = 0)
Set the start direction for a given segment from the head sensor
void setRayStartPosition(const TcUtVector3f &vector, const CoordType &type = WORLD, const int &segNum = 0)
Set the start position for the segment number from the given vector position
void setRayDirection(const TcUtVector3f &vector, const CoordType &type = WORLD, const int &segNum = 0)
Set the start direction for the segment number from the given vector orientation
void setCurSeg(const int &num)
Sets the segment number doTcIntersectionTest will operate on

Inherited from TcGfxIntersectionTest:

Public Classes

enum IsectState
enum CoordType

Public Methods

const TcUtString& getIsectId() const
void setIsectId(const TcUtString &)
const IsectState& getLastUpdateState() const
const TcUtString& getLastIsectName() const

Protected Methods

void setIsectState(const IsectState &T)
void setIsectName(const TcUtString &T)

Documentation

Performer Cavelib Intersection Test. This class provides an interface to Performer's pfSegSet. It can be automatically updated by passing it to the intersection manager, or the client can chose to update the intersection.
enum Sensor
Sensor enum
Parameters:
HEAD - Set the intersection test from the head sensor.
WAND - Set the intersection test from the wand sensor.
NONE - Manually set the intersection position and direction.

TdGfxPfIntersectionTest(const TcUtString &isectName, const TdGfxPfIntersectionTest::Sensor sensor, TcGfxComponent &rootNode, const unsigned int &isectMask, const unsigned int &activeMask = 0x01, const int &modeMask = PFTRAV_IS_PATH | PFTRAV_IS_GSET | PFTRAV_IS_CULL_BACK)
Constructor
Parameters:
isectName - This string is used to retrieve an intersection test from the intersection manager.
sensor - Determines whether doTcIntersection automatically updates the intersection test from a sensor position and direction.
rootNode - Sets the subtree in the graphics hierarchy that the intersection is tested from.
isectMask - Sets a bit field mask to test for.
activeMask - Sets the initial number of segments that are to be tested. This is a bitfield that determines which intersection segments are active.
modeMask - This is a Performer mask that determines the behavior of the intersection test. See pfSegSet.

~TdGfxPfIntersectionTest()
Destructor.

void setActiveSegments(const int &numSegs = 1)
This sets the number of active segments as consecutive bits in the active mask. For instance 5 active segments would cause the first 5 bits to be set to 1 in the activeMask.
Parameters:
numSegs - Determines the number of consecutive bits that are active.

void setIsectMask(const unsigned int &isectMask)
Sets the mask to search for in the graphics hierarchy.

void setMode(const int &modeMask)
Determines the behavior of the intersection test.

void setRayLength(const float &rayLength, const int &segNum = 0)
Sets the length of a segment
Parameters:
rayLength - A float value determining ray length.
segNum - Determines the segment to apply this length to. This must be less than the number of active segments.

virtual IsectState doTcIntersectionTest()
updates the intersection test based on its current state. Sensor (HEAD, WAND) based intersection tests automatically update intersection start position and direction. This method is called once per iteration if the intersection test is managed by the intersection manager.
Parameters:
Returns - ISECT_FOUND, ISECT_NOTFOUND

const TcUtVector3f& getIsectNormal(const int &segNum = 0)
returns the normal of the last successful intersection. This value is not cleared after an update in which no intersection is found.
Parameters:
type - Returns the normal for a given line segment.

const TcUtVector3f& getLastIsectPoint(const CoordType &type = LOCAL, const int &segNum = 0)
returns the position of the last successful intersection. This value is not cleared after an update in which no intersection is found.
Parameters:
type - Returns the point in local or world coordinates.
segNum - Returns the point for the given line segment. This is a number starting from 0 and must be within the range of the active segments.

void setRayStartPositionFromWand(const int &segNum = 0)
Set the start position for a given segment number from the wand sensor
Parameters:
segNum - This is a number starting from 0 and must be within the range of the active segments.

void setRayDirectionFromWand(const int &segNum = 0)
Set the direction for a given segment number from the wand sensor
Parameters:
segNum - This is a number starting from 0 and must be within the range of the active segments.

void setRayStartPositionFromHead(const int &segNum = 0)
Set the start position for a given segment from the head sensor
Parameters:
segNum - This is a number starting from 0 and must be within the range of the active segments.

void setRayDirectionFromHead(const int &segNum = 0)
Set the start direction for a given segment from the head sensor
Parameters:
segNum - This is a number starting from 0 and must be within the range of the active segments.

void setRayStartPosition(const TcUtVector3f &vector, const CoordType &type = WORLD, const int &segNum = 0)
Set the start position for the segment number from the given vector position
Parameters:
vector - a positional vector.
type - Currently if type is WORLD it will be converted to the viewpoint (local) coord system (CAVEConvertWorldToNav). This assumes the intersection starts from pfScene node.
segNum - This is a number starting from 0 and must be within the range of the active segments.

void setRayDirection(const TcUtVector3f &vector, const CoordType &type = WORLD, const int &segNum = 0)
Set the start direction for the segment number from the given vector orientation
Parameters:
vector - a directional vector.
type - Currently if type is WORLD it will be converted to the viewpoint (local) coord system (CAVEConvertVectorWorldToNav). This assumes the intersection starts from pfScene node.
segNum - This is a number starting from 0 and must be within the range of the active segments.

void setCurSeg(const int &num)
Sets the segment number doTcIntersectionTest will operate on. This must be greater than 0 and less than the number of active segments.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de