Panda3D
Public Member Functions | Static Public Member Functions | Friends

CollisionLevelState< MaskType > Class Template Reference

This is the state information the CollisionTraverser retains for each level during traversal. More...

#include "collisionLevelState.h"

Inheritance diagram for CollisionLevelState< MaskType >:
CollisionLevelStateBase

List of all members.

Public Member Functions

 CollisionLevelState (const NodePath &node_path)
 CollisionLevelState (const CollisionLevelState< MaskType > &parent, PandaNode *child)
 This constructor goes to the next child node in the traversal.
 CollisionLevelState (const CollisionLevelState< MaskType > &copy)
bool any_in_bounds ()
 Checks the bounding volume of the current node against each of our colliders.
bool apply_transform ()
 Applies the inverse transform from the current node, if any, onto all the colliders in the level state.
void clear ()
bool has_any_collider () const
bool has_collider (int n) const
 Returns true if the nth collider in the LevelState is still part of the level.
void omit_collider (int n)
void operator= (const CollisionLevelState< MaskType > &copy)
void prepare_collider (const ColliderDef &def, const NodePath &root)
 Adds the indicated Collider to the set of Colliders in the current level state.

Static Public Member Functions

static int get_max_colliders ()
 Returns the maximum number of colliders that may be added to the CollisionLevelStateBase at any one time.
static bool has_max_colliders ()
 Returns true if there is any the maximum number of colliders that may be added to the CollisionLevelStateBase at any one time.

Friends

class CollisionTraverser

Detailed Description

template<class MaskType>
class CollisionLevelState< MaskType >

This is the state information the CollisionTraverser retains for each level during traversal.

This is the template class that specifies the CurrentMask type: the type of bitmask that is used to keep track of the set of active colliders for each node.

Definition at line 37 of file collisionLevelState.h.


Constructor & Destructor Documentation

template<class MaskType >
CollisionLevelState< MaskType >::CollisionLevelState ( const CollisionLevelState< MaskType > &  parent,
PandaNode child 
) [inline]

This constructor goes to the next child node in the traversal.

Definition at line 39 of file collisionLevelState.I.


Member Function Documentation

template<class MaskType >
bool CollisionLevelState< MaskType >::any_in_bounds ( )

Checks the bounding volume of the current node against each of our colliders.

Eliminates from the current collider list any that are outside of the bounding volume. Returns true if any colliders remain, false if all of them fall outside this node's bounding volume.

Definition at line 121 of file collisionLevelState.I.

References GeometricBoundingVolume::contains(), CollisionNode::get_from_collide_mask(), CollisionTraverser::get_num_colliders(), and CollisionTraverser::has_collider().

template<class MaskType >
bool CollisionLevelState< MaskType >::apply_transform ( )

Applies the inverse transform from the current node, if any, onto all the colliders in the level state.

Returns true if the inverse transform is valid, or false if it is not valid (e.g. the transform has a scale to zero). If the inverse transform is not valid, the caller should not visit this node.

Definition at line 240 of file collisionLevelState.I.

References CollisionTraverser::get_num_colliders(), CollisionTraverser::has_collider(), and TransformState::is_identity().

template<class MaskType >
int CollisionLevelState< MaskType >::get_max_colliders ( ) [inline, static]

Returns the maximum number of colliders that may be added to the CollisionLevelStateBase at any one time.

Definition at line 325 of file collisionLevelState.I.

template<class MaskType >
bool CollisionLevelState< MaskType >::has_collider ( int  n) const [inline]

Returns true if the nth collider in the LevelState is still part of the level.

Definition at line 339 of file collisionLevelState.I.

template<class MaskType >
bool CollisionLevelState< MaskType >::has_max_colliders ( ) [inline, static]

Returns true if there is any the maximum number of colliders that may be added to the CollisionLevelStateBase at any one time.

Definition at line 311 of file collisionLevelState.I.

template<class MaskType >
void CollisionLevelState< MaskType >::prepare_collider ( const ColliderDef def,
const NodePath root 
) [inline]

Adds the indicated Collider to the set of Colliders in the current level state.

Reimplemented from CollisionLevelStateBase.

Definition at line 98 of file collisionLevelState.I.

References CollisionLevelStateBase::prepare_collider().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations