This is the state information the CollisionTraverser retains for each level during traversal. More...
#include "collisionLevelState.h"
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. More... | |
CollisionLevelState (const CollisionLevelState< MaskType > ©) | |
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 > ©) |
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 NodePath &node_path) | |
CollisionLevelStateBase (const CollisionLevelStateBase &parent, PandaNode *child) | |
This constructor goes to the next child node in the traversal. More... | |
CollisionLevelStateBase (const CollisionLevelStateBase ©) | |
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 ©) |
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 |
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.
|
inline |
This constructor goes to the next child node in the traversal.
Definition at line 33 of file collisionLevelState.I.
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 103 of file collisionLevelState.I.
References indent().
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 220 of file collisionLevelState.I.
References TransformState::is_identity().
|
inlinestatic |
Returns the maximum number of colliders that may be added to the CollisionLevelStateBase at any one time.
Definition at line 298 of file collisionLevelState.I.
|
inline |
Returns true if the nth collider in the LevelState is still part of the level.
Definition at line 310 of file collisionLevelState.I.
|
inlinestatic |
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 286 of file collisionLevelState.I.
|
inline |
Adds the indicated Collider to the set of Colliders in the current level state.
Definition at line 84 of file collisionLevelState.I.