Panda3D
|
This is the state information the CollisionTraverser retains for each level during traversal. More...
#include "collisionLevelStateBase.h"
Classes | |
class | ColliderDef |
Public Member Functions | |
CollisionLevelStateBase (const NodePath &node_path) | |
CollisionLevelStateBase (const CollisionLevelStateBase &parent, PandaNode *child) | |
This constructor goes to the next child node in the traversal. | |
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. | |
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 ©) |
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 TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
typedef | PTA (ColliderDef) Colliders |
typedef | PTA (CPT(GeometricBoundingVolume)) BoundingVolumes |
Protected Attributes | |
Colliders | _colliders |
CollideMask | _include_mask |
BoundingVolumes | _local_bounds |
WorkingNodePath | _node_path |
BoundingVolumes | _parent_bounds |
Static Protected Attributes | |
static PStatCollector | _node_volume_pcollector |
Friends | |
class | CollisionTraverser |
This is the state information the CollisionTraverser retains for each level during traversal.
The CollisionLevelStateBase is the non-template base class. The template version further specifies this on CurrentMask type.
Definition at line 47 of file collisionLevelStateBase.h.
CollisionLevelStateBase::CollisionLevelStateBase | ( | const CollisionLevelStateBase & | parent, |
PandaNode * | child | ||
) | [inline] |
This constructor goes to the next child node in the traversal.
Definition at line 36 of file collisionLevelStateBase.I.
CollideMask CollisionLevelStateBase::get_include_mask | ( | ) | const [inline] |
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.
See set_include_mask().
Definition at line 210 of file collisionLevelStateBase.I.
const GeometricBoundingVolume * CollisionLevelStateBase::get_local_bound | ( | int | n | ) | const [inline] |
Returns the bounding volume of the indicated collider, transformed into the current node's transform space.
Definition at line 149 of file collisionLevelStateBase.I.
NodePath CollisionLevelStateBase::get_node_path | ( | ) | const [inline] |
Returns the NodePath representing the node instance we have traversed to.
Definition at line 80 of file collisionLevelStateBase.I.
References WorkingNodePath::get_node_path().
const GeometricBoundingVolume * CollisionLevelStateBase::get_parent_bound | ( | int | n | ) | const [inline] |
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.
This is appropriate for testing against the bounding volume of the current node (which does not have its own transform applied to it).
Definition at line 173 of file collisionLevelStateBase.I.
PandaNode * CollisionLevelStateBase::node | ( | ) | const [inline] |
Returns the PandaNode pointer of the node we have traversed to.
Definition at line 91 of file collisionLevelStateBase.I.
References WorkingNodePath::node().
void CollisionLevelStateBase::prepare_collider | ( | const ColliderDef & | def, |
const NodePath & | root | ||
) |
Adds the indicated Collider to the set of Colliders in the current level state.
Reimplemented in CollisionLevelState< MaskType >.
Definition at line 56 of file collisionLevelStateBase.cxx.
References GeometricBoundingVolume::extend_by(), NodePath::get_parent(), NodePath::get_pos_delta(), NodePath::get_transform(), LMatrix4f::translate_mat(), and LVector3f::zero().
Referenced by CollisionLevelState< MaskType >::prepare_collider().
void CollisionLevelStateBase::reserve | ( | int | num_colliders | ) |
Indicates an intention to add the indicated number of colliders to the level state.
Definition at line 44 of file collisionLevelStateBase.cxx.
void CollisionLevelStateBase::set_include_mask | ( | CollideMask | include_mask | ) | [inline] |
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.
This is normally all bits on, but you may set it to some other mask to restrict certain bits from consideration.
This is used by the CollisionTraverser to restrict collision with geometry except under the lowest level of LOD.
Definition at line 196 of file collisionLevelStateBase.I.