Panda3D

Loading...
Searching...
No Matches
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.
| CollisionLevelState (const NodePath &node_path)
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.
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.
| 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.
const GeometricBoundingVolume * | get_local_bound (int n) const
| Returns the bounding volume of the indicated collider, transformed into the current node's transform space.
NodePath | get_node_path () const
| Returns the NodePath representing the node instance we have traversed to.
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.
PandaNode * | node () const
| Returns the PandaNode pointer of the node we have traversed to.
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.
void | reserve (int num_colliders)
| Indicates an intention to add the indicated number of colliders to the level state.
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.

## 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.
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() [1/3]

template<class MaskType>

CollisionLevelState< MaskType >::CollisionLevelState | ( | const NodePath & | node_path | ) |
| inline

Definition at line 19 of file collisionLevelState.I.

## ◆ CollisionLevelState() [2/3]

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.

## ◆ CollisionLevelState() [3/3]

template<class MaskType>

CollisionLevelState< MaskType >::CollisionLevelState | ( | const CollisionLevelState< MaskType > & | copy | ) |
| inline

Definition at line 45 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 GeometricBoundingVolume::contains(), PandaNode::get_bounds(), CollisionNode::get_from_collide_mask, CollisionLevelStateBase::get_local_bound(), PandaNode::get_net_collide_mask(), has_collider(), indent(), and CollisionLevelStateBase::node().

## ◆ 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 CollisionLevelStateBase::get_local_bound(), TransformState::get_mat, has_collider(), TransformState::is_identity(), and CollisionLevelStateBase::node().

## ◆ clear()

template<class MaskType>

void CollisionLevelState< MaskType >::clear | ( |  | ) |
| inline

Definition at line 70 of file collisionLevelState.I.

## ◆ 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.

## ◆ has_any_collider()

template<class MaskType>

bool CollisionLevelState< MaskType >::has_any_collider | ( |  | ) | const
| inline

Definition at line 321 of file collisionLevelState.I.

## ◆ 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.

Referenced by any_in_bounds(), and apply_transform().

## ◆ 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.

## ◆ omit_collider()

template<class MaskType>

void CollisionLevelState< MaskType >::omit_collider | ( | int | n | ) |
| inline

Definition at line 332 of file collisionLevelState.I.

## ◆ operator=()

template<class MaskType>

void CollisionLevelState< MaskType >::operator= | ( | const CollisionLevelState< MaskType > & | copy | ) |
| inline

Definition at line 58 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.

References CollisionLevelStateBase::prepare_collider().

## Friends And Related Symbol Documentation

## ◆ CollisionTraverser

template<class MaskType>

friend class CollisionTraverser
| friend

Definition at line 67 of file collisionLevelState.h.

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

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