21 INLINE CollisionEntry::
107 return _from_node_path;
123 return _into_node_path;
159 return ((0.f <= _t) && (_t <= 1.f));
182 return (_flags & F_respect_prev_transform) != 0;
197 nassertv(!point.
is_nan());
198 _surface_point = point;
199 _flags |= F_has_surface_point;
213 nassertv(!normal.
is_nan());
214 _surface_normal = normal;
215 _flags |= F_has_surface_normal;
233 nassertv(!point.
is_nan());
234 _interior_point = point;
235 _flags |= F_has_interior_point;
248 return (_flags & F_has_surface_point) != 0;
261 return (_flags & F_has_surface_normal) != 0;
274 return (_flags & F_has_interior_point) != 0;
290 _flags |= F_has_contact_pos;
304 nassertv(!normal.
is_nan());
305 _contact_normal = normal;
306 _flags |= F_has_contact_normal;
319 return (_flags & F_has_contact_pos) != 0;
332 return (_flags & F_has_contact_normal) != 0;
342 get_wrt_space()
const {
343 return _from_node_path.get_transform(_into_node_path);
353 get_inv_wrt_space()
const {
354 return _into_node_path.get_transform(_from_node_path);
366 get_wrt_prev_space()
const {
367 if (get_respect_prev_transform()) {
368 return _from_node_path.get_prev_transform(_into_node_path);
370 return get_wrt_space();
382 return get_wrt_space()->get_mat();
393 return get_inv_wrt_space()->get_mat();
406 return get_wrt_prev_space()->get_mat();
418 if ((_flags & F_checked_clip_planes) == 0) {
421 return _into_clip_planes;
433 INLINE
void CollisionEntry::
437 #ifdef DO_COLLISION_RECORDING
438 if (trav->has_recorder()) {
440 trav->get_recorder()->collision_tested(*result,
true);
442 trav->get_recorder()->collision_tested(*
this,
false);
445 #endif // DO_COLLISION_RECORDING
453 result->reset_collided();
A basic node of the scene graph or data graph.
The abstract interface to a number of classes that decide what to do when a collision is detected...
CollisionNode * get_from_node() const
Returns the node that contains the CollisionSolid that triggered this collision.
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).
bool has_contact_pos() const
Returns true if the contact position has been specified, false otherwise.
void set_contact_normal(const LVector3 &normal)
Stores the surface normal of the "into" object at the contact pos.
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.
This functions similarly to a LightAttrib.
const LMatrix4 & get_wrt_mat() const
Returns the relative transform of the from node as seen from the into node.
void set_t(PN_stdfloat t)
Sets a time value for this collision relative to other CollisionEntries.
PN_stdfloat get_t() const
returns time value for this collision relative to other CollisionEntries
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
void set_interior_point(const LPoint3 &point)
Stores the point, within the interior of the "into" object, which represents the depth to which the "...
bool get_respect_prev_transform() const
Returns true if the collision was detected by a CollisionTraverser whose respect_prev_transform flag ...
const ClipPlaneAttrib * get_into_clip_planes() const
Returns the ClipPlaneAttrib, if any, that is applied to the into_node_path, or NULL if there is no cl...
bool has_contact_normal() const
Returns true if the contact normal has been specified, false otherwise.
This is a 4-by-4 transform matrix.
Defines a single collision event.
const CollisionSolid * get_into() const
Returns the CollisionSolid pointer for the particular solid was collided into.
PandaNode * get_into_node() const
Returns the node that contains the CollisionSolid that was collided into.
bool has_surface_point() const
Returns true if the surface point has been specified, false otherwise.
const LMatrix4 & get_wrt_prev_mat() const
Returns the relative transform of the from node as seen from the into node, as of the previous frame ...
bool has_surface_normal() const
Returns true if the surface normal has been specified, false otherwise.
void set_contact_pos(const LPoint3 &pos)
Stores the position of the "from" object at the instant at which the collision is first detected...
NodePath get_into_node_path() const
Returns the NodePath that represents the specific CollisionNode or GeomNode instance that was collide...
A node in the scene graph that can hold any number of CollisionSolids.
NodePath get_from_node_path() const
Returns the NodePath that represents the CollisionNode that contains the CollisionSolid that triggere...
This class manages the traversal through the scene graph to detect collisions.
virtual void add_entry(CollisionEntry *entry)
Called between a begin_group() .
bool collided() const
returns true if this represents an actual collision as opposed to a potential collision, needed for iterative collision resolution where path of collider changes mid-frame
bool has_interior_point() const
Returns true if the interior point has been specified, false otherwise.
void set_surface_point(const LPoint3 &point)
Stores the point, on the surface of the "into" object, at which a collision is detected.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
bool wants_all_potential_collidees() const
Returns true if handler wants to know about all solids that are within the collider's bounding volume...
void set_surface_normal(const LVector3 &normal)
Stores the surface normal of the "into" object at the point of the intersection.
void reset_collided()
prepare for another collision test
const LMatrix4 & get_inv_wrt_mat() const
Returns the relative transform of the into node as seen from the from node.
bool has_into() const
Returns true if the "into" solid is, in fact, a CollisionSolid, and its pointer is known (in which ca...