15 #include "collisionLevelStateBase.h" 16 #include "collisionSolid.h" 17 #include "collisionNode.h" 18 #include "config_collide.h" 21 PStatCollector CollisionLevelStateBase::_node_volume_pcollector(
"Collision Volumes:PandaNode");
23 TypeHandle CollisionLevelStateBase::_type_handle;
30 void CollisionLevelStateBase::
33 _local_bounds.clear();
34 _parent_bounds.clear();
45 _colliders.reserve(num_colliders);
46 _local_bounds.reserve(num_colliders);
57 _colliders.push_back(def);
61 if (!bv->is_of_type(GeometricBoundingVolume::get_class_type())) {
67 DCAST_INTO_V(gbv, bv->make_copy());
73 if (bv->as_bounding_sphere()) {
90 gbv_prev->xform(inv_trans);
96 gbv->xform(rel_transform->get_mat());
97 _local_bounds.push_back(gbv);
100 _parent_bounds = _local_bounds;
static LMatrix4f translate_mat(const LVecBase3f &trans)
Returns a matrix that applies the indicated translation.
The abstract base class for all things that can collide with other things in the world, and all the things they can collide with (except geometry).
static const LVector3f & zero()
Returns a zero-length vector.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
LVector3 get_pos_delta() const
Returns the delta vector from this node's position in the previous frame (according to set_prev_trans...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
A lightweight class that represents a single element that may be timed and/or counted via stats...
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
This is a 4-by-4 transform matrix.
void reserve(int num_colliders)
Indicates an intention to add the indicated number of colliders to the level state.
void prepare_collider(const ColliderDef &def, const NodePath &root)
Adds the indicated Collider to the set of Colliders in the current level state.
NodePath get_parent(Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath to the parent of the referenced node: that is, this NodePath, shortened by one node.
TypeHandle is the identifier used to differentiate C++ class types.
const TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
bool extend_by(const GeometricBoundingVolume *vol)
Increases the size of the volume to include the given volume.