19 TypeHandle CollisionHandlerPhysical::_type_handle;
25 CollisionHandlerPhysical::
26 CollisionHandlerPhysical() {
33 CollisionHandlerPhysical::
34 ~CollisionHandlerPhysical() {
45 _from_entries.clear();
55 nassertv(entry !=
nullptr);
58 if (entry->
get_from()->is_tangible() &&
70 if (point.dot(normal) > 0) {
87 bool result = handle_entries();
101 nassertv(validate_target(target));
102 _colliders[collider].set_target(target);
118 nassertv(validate_target(target));
119 _colliders[collider].set_target(target, drive_interface);
128 Colliders::iterator ci = _colliders.find(collider);
129 if (ci == _colliders.end()) {
132 _colliders.erase(ci);
142 Colliders::const_iterator ci = _colliders.find(target);
143 return (ci != _colliders.end());
158 bool CollisionHandlerPhysical::
159 validate_target(
const NodePath &target) {
160 nassertr_always(!target.
is_empty(),
false);
virtual bool end_group()
Called by the CollisionTraverser at the completion of all collision detections for this traversal.
bool has_surface_point() const
Returns true if the surface point has been specified, false otherwise.
virtual bool end_group()
Called by the CollisionTraverser at the completion of all collision detections for this traversal.
get_from_node_path
Returns the NodePath that represents the CollisionNode that contains the CollisionSolid that triggere...
LPoint3 get_surface_point(const NodePath &space) const
Returns the point, on the surface of the "into" object, at which a collision is detected.
This is a TFormer, similar to Trackball, that moves around a transform matrix in response to mouse in...
LVector3 get_surface_normal(const NodePath &space) const
Returns the surface normal of the "into" object at the point at which a collision is detected.
bool is_empty() const
Returns true if the NodePath contains no nodes.
virtual void begin_group()
Will be called by the CollisionTraverser before a new traversal is begun.
bool has_into() const
Returns true if the "into" solid is, in fact, a CollisionSolid, and its pointer is known (in which ca...
bool has_surface_normal() const
Returns true if the surface normal has been specified, false otherwise.
virtual void begin_group()
Will be called by the CollisionTraverser before a new traversal is begun.
void clear_colliders()
Completely empties the list of colliders this handler knows about.
virtual bool is_collision_node() const
A simple downcast check.
Defines a single collision event.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool remove_collider(const NodePath &collider)
Removes the collider from the list of colliders that this handler knows about.
has_center
Returns true if a NodePath has been specified with set_center(), false otherwise.
virtual void add_entry(CollisionEntry *entry)
Called between a begin_group() .
PandaNode * node() const
Returns the referenced node of the path.
get_into
Returns the CollisionSolid pointer for the particular solid was collided into.
get_from
Returns the CollisionSolid pointer for the particular solid that triggered this collision.
bool has_collider(const NodePath &collider) const
Returns true if the handler knows about the indicated collider, false otherwise.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
void add_collider(const NodePath &collider, const NodePath &target)
Adds a new collider to the list with a NodePath that will be updated with the collider's new position...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
virtual void add_entry(CollisionEntry *entry)
Called between a begin_group() .