#include <collisionLevelState.h>
Public Member Functions | |
CollisionLevelState (const NodePath &node_path) | |
CollisionLevelState (const CollisionLevelState &parent, PandaNode *child) | |
This constructor goes to the next child node in the traversal. | |
void | clear () |
void | reserve (int max_colliders) |
void | prepare_collider (const ColliderDef &def) |
Adds the indicated Collider to the set of Colliders in the current level state. | |
bool | any_in_bounds () |
Checks the bounding volume of the current node against each of our colliders. | |
void | apply_transform () |
Applies the inverse transform from the current node, if any, onto all the colliders in the level state. | |
NodePath | get_node_path () const |
Returns the NodePath representing the node instance we have traversed to. | |
PandaNode * | node () const |
Returns the PandaNode pointer of the node we have traversed to. | |
int | get_num_colliders () const |
bool | has_collider (int n) const |
Returns true if the nth collider in the LevelState is still part of the level. | |
bool | has_collider_with_geom (int n) const |
Returns true if the nth collider in the LevelState is still part of the level, and it has the "collide_geom" flag set. | |
bool | has_any_collider () const |
bool | has_any_collide_geom () const |
Returns true if any Collider in the level state has the "collide_geom" flag set, false otherwise. | |
void | reached_collision_node () |
Called by the traverser when we reach a CollisionNode in the traversal. | |
CollisionSolid * | get_collider (int n) const |
CollisionNode * | get_node (int n) const |
const LMatrix4f & | get_space (int n) const |
const LMatrix4f & | get_inv_space (int n) const |
const GeometricBoundingVolume * | get_local_bound (int n) const |
Returns the bounding volume of the indicated collider, transformed into the current node's transform space. | |
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. | |
void | omit_collider (int n) |
Private Types | |
typedef int | ColliderMask |
typedef PointerToArray< ColliderDef > | Colliders |
typedef PointerToArray< ConstPointerTo< GeometricBoundingVolume > > | BoundingVolumes |
Private Member Functions | |
ColliderMask | get_mask (int n) const |
Returns a single bit associated with the nth collider. | |
Private Attributes | |
WorkingNodePath | _node_path |
Colliders | _colliders |
ColliderMask | _current |
ColliderMask | _colliders_with_geom |
BoundingVolumes | _local_bounds |
BoundingVolumes | _parent_bounds |
Definition at line 49 of file collisionLevelState.h.
|
Definition at line 107 of file collisionLevelState.h. |
|
Definition at line 96 of file collisionLevelState.h. |
|
Definition at line 102 of file collisionLevelState.h. |
|
Definition at line 31 of file collisionLevelState.I. References INLINE. |
|
This constructor goes to the next child node in the traversal.
Definition at line 47 of file collisionLevelState.I. References _node_path, WorkingNodePath::get_node_path(), and INLINE. |
|
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 122 of file collisionLevelState.cxx. References NULL. |
|
Applies the inverse transform from the current node, if any, onto all the colliders in the level state.
Definition at line 207 of file collisionLevelState.cxx. |
|
Definition at line 34 of file collisionLevelState.cxx. |
|
Definition at line 188 of file collisionLevelState.I. References _colliders. |
|
Definition at line 233 of file collisionLevelState.I. References _colliders, _current, get_mask(), has_collider(), INLINE, and nassertv. |
|
Returns the bounding volume of the indicated collider, transformed into the current node's transform space.
Definition at line 253 of file collisionLevelState.I. |
|
Returns a single bit associated with the nth collider.
Definition at line 322 of file collisionLevelState.I. Referenced by get_inv_space(), get_num_colliders(), and node(). |
|
Definition at line 203 of file collisionLevelState.I. References _local_bounds. |
|
Returns the NodePath representing the node instance we have traversed to.
Definition at line 67 of file collisionLevelState.I. |
|
Definition at line 94 of file collisionLevelState.I. References _colliders, _colliders_with_geom, _current, get_mask(), INLINE, and nassertr. |
|
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 287 of file collisionLevelState.I. |
|
Definition at line 218 of file collisionLevelState.I. References _colliders, _parent_bounds, has_collider(), INLINE, nassertr, NULL, and PointerToArray< ConstPointerTo< GeometricBoundingVolume > >::size(). |
|
Returns true if any Collider in the level state has the "collide_geom" flag set, false otherwise.
Definition at line 155 of file collisionLevelState.I. References _colliders, has_collider(), INLINE, nassertr, and NULL. |
|
Definition at line 140 of file collisionLevelState.I. References _colliders, has_collider(), INLINE, nassertr, and NULL. |
|
Returns true if the nth collider in the LevelState is still part of the level.
Definition at line 109 of file collisionLevelState.I. References _current, and INLINE. Referenced by get_inv_space(), get_space(), has_any_collide_geom(), and has_any_collider(). |
|
Returns true if the nth collider in the LevelState is still part of the level, and it has the "collide_geom" flag set.
Definition at line 127 of file collisionLevelState.I. References _colliders_with_geom, and INLINE. |
|
Returns the PandaNode pointer of the node we have traversed to.
Definition at line 82 of file collisionLevelState.I. References _colliders, _current, get_mask(), INLINE, and nassertr. |
|
Definition at line 304 of file collisionLevelState.I. |
|
Adds the indicated Collider to the set of Colliders in the current level state.
Definition at line 66 of file collisionLevelState.cxx. References CollisionLevelState::ColliderDef::_node, GeometricBoundingVolume::extend_by(), and CollisionNode::get_velocity(). |
|
Called by the traverser when we reach a CollisionNode in the traversal. At this point, we zero out our set of colliders with the "collide_geom" flag set, because no colliders will test against geometry parented beneath a CollisionNode. Definition at line 176 of file collisionLevelState.I. |
|
|
Definition at line 103 of file collisionLevelState.h. Referenced by get_collider(), get_inv_space(), get_num_colliders(), get_space(), has_any_collide_geom(), has_any_collider(), node(), and reserve(). |
|
Definition at line 105 of file collisionLevelState.h. Referenced by get_num_colliders(), and has_collider_with_geom(). |
|
Definition at line 104 of file collisionLevelState.h. Referenced by get_inv_space(), get_num_colliders(), has_collider(), and node(). |
|
Definition at line 108 of file collisionLevelState.h. Referenced by get_node(), and reserve(). |
|
Definition at line 100 of file collisionLevelState.h. Referenced by CollisionLevelState(). |
|
Definition at line 109 of file collisionLevelState.h. Referenced by get_space(). |