Panda3D

Public Member Functions | Static Public Member Functions | Friends | List of all members
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 >:

## Public Member Functions
| CollisionLevelState (const CollisionLevelState< MaskType > &copy)
| CollisionLevelState (const CollisionLevelState< MaskType > &parent, PandaNode *child)
| This constructor goes to the next child node in the traversal. More...
| CollisionLevelState (const NodePath &node_path)
bool | any_in_bounds ()
| Checks the bounding volume of the current node against each of our colliders. More...
bool | apply_transform ()
| Applies the inverse transform from the current node, if any, onto all the colliders in the level state. More...
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. More...
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. More...
Public Member Functions inherited from CollisionLevelStateBase
| CollisionLevelStateBase (const CollisionLevelStateBase &copy)
| CollisionLevelStateBase (const CollisionLevelStateBase &parent, PandaNode *child)
| This constructor goes to the next child node in the traversal. More...
| CollisionLevelStateBase (const NodePath &node_path)
void | clear ()
const CollisionSolid * | get_collider (int n) const
CollisionNode * | get_collider_node (int n) const
NodePath | get_collider_node_path (int n) const
CollideMask | get_include_mask () const
| Returns the mask that is applied to the into CollideMask of nodes in the scene graph before testing for bits in common with the from CollideMask of colliders. More...
const GeometricBoundingVolume * | get_local_bound (int n) const
| Returns the bounding volume of the indicated collider, transformed into the current node's transform space. More...
NodePath | get_node_path () const
| Returns the NodePath representing the node instance we have traversed to. More...
int | get_num_colliders () const
const GeometricBoundingVolume * | get_parent_bound (int n) const
| Returns the bounding volume of the indicated collider, transformed into the previous node's transform space, but not transformed by the current node's transform. More...
PandaNode * | node () const
| Returns the PandaNode pointer of the node we have traversed to. More...
void | operator= (const CollisionLevelStateBase &copy)
void | prepare_collider (const ColliderDef &def, const NodePath &root)
| Adds the indicated Collider to the set of Colliders in the current level state. More...
void | reserve (int num_colliders)
| Indicates an intention to add the indicated number of colliders to the level state. More...
void | set_include_mask (CollideMask include_mask)
| Specifies the mask that is applied to the into CollideMask of nodes in the scene graph before testing for bits in common with the from CollideMask of colliders. More...

## 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. More...
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. More...
Static Public Member Functions inherited from CollisionLevelStateBase
static TypeHandle | get_class_type ()
static void | init_type ()

## 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 33 of file collisionLevelState.h.

## Constructor & Destructor Documentation

## ◆ CollisionLevelState()

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 32 of file collisionLevelState.I.

## Member Function Documentation

## ◆ any_in_bounds()

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 102 of file collisionLevelState.I.

References indent().

## ◆ apply_transform()

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 219 of file collisionLevelState.I.

References TransformState::is_identity().

## ◆ get_max_colliders()

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 297 of file collisionLevelState.I.

Referenced by CollisionTraverser::traverse().

## ◆ has_collider()

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 309 of file collisionLevelState.I.

## ◆ has_max_colliders()

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 285 of file collisionLevelState.I.

## ◆ prepare_collider()

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.

Definition at line 83 of file collisionLevelState.I.

The documentation for this class was generated from the following files:

- panda/src/collide/collisionLevelState.h
- panda/src/collide/collisionLevelState.I