16 #include "collisionHandlerHighestEvent.h"
17 #include "config_collide.h"
19 #include "eventParameter.h"
20 #include "throw_event.h"
23 TypeHandle CollisionHandlerHighestEvent::_type_handle;
46 if (collide_cat.is_spam()) {
50 _last_colliding.clear();
51 if (_closest_collider) {
52 _last_colliding.insert(_closest_collider);
54 _current_colliding.clear();
55 _collider_distance = 0;
56 _closest_collider = NULL;
70 entry->
get_from()->get_collision_origin();
72 if (_closest_collider == NULL || dist < _collider_distance) {
73 _collider_distance = dist;
74 _closest_collider = entry;
88 if (_closest_collider) {
89 _current_colliding.insert(_closest_collider);
virtual bool end_group()
Called by the CollisionTraverser at the completion of all collision detections for this traversal...
virtual bool end_group()
Called by the CollisionTraverser at the completion of all collision detections for this traversal...
float length_squared() const
Returns the square of the vector's length, cheap and easy.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
const CollisionSolid * get_from() const
Returns the CollisionSolid pointer for the particular solid that triggered this collision.
LPoint3 get_surface_point(const NodePath &space) const
Returns the point, on the surface of the "into" object, at which a collision is detected.
Defines a single collision event.
virtual void begin_group()
Will be called by the CollisionTraverser before a new traversal is begun.
virtual void add_entry(CollisionEntry *entry)
Called between a begin_group() .
CollisionHandlerHighestEvent()
The default CollisionHandlerEvent will throw no events.
NodePath get_from_node_path() const
Returns the NodePath that represents the CollisionNode that contains the CollisionSolid that triggere...
TypeHandle is the identifier used to differentiate C++ class types.