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;
341 INLINE CPT(TransformState) CollisionEntry::
342 get_wrt_space()
const {
352 INLINE CPT(TransformState) CollisionEntry::
353 get_inv_wrt_space()
const {
365 INLINE CPT(TransformState) CollisionEntry::
366 get_wrt_prev_space()
const {
370 return get_wrt_space();
380 INLINE
const LMatrix4 &CollisionEntry::
381 get_wrt_mat()
const {
382 return get_wrt_space()->get_mat();
391 INLINE
const LMatrix4 &CollisionEntry::
392 get_inv_wrt_mat()
const {
393 return get_inv_wrt_space()->get_mat();
404 INLINE
const LMatrix4 &CollisionEntry::
405 get_wrt_prev_mat()
const {
406 return get_wrt_prev_space()->get_mat();
417 get_into_clip_planes()
const {
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();
bool has_surface_point() const
Returns true if the surface point has been specified, false otherwise.
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...
NodePath get_into_node_path() const
Returns the NodePath that represents the specific CollisionNode or GeomNode instance that was collide...
bool wants_all_potential_collidees() const
Returns true if handler wants to know about all solids that are within the collider's bounding volume...
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_normal() const
Returns true if the contact normal has been specified, false otherwise.
void set_contact_normal(const LVector3 &normal)
Stores the surface normal of the "into" object at the contact pos.
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
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This functions similarly to a LightAttrib.
void set_t(PN_stdfloat t)
Sets a 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 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.
const CollisionSolid * get_into() const
Returns the CollisionSolid pointer for the particular solid was collided into.
This is a 4-by-4 transform matrix.
Defines a single collision event.
PN_stdfloat get_t() const
returns time value for this collision relative to other CollisionEntries
CollisionNode * get_from_node() const
Returns the node that contains the CollisionSolid that triggered this collision.
bool has_contact_pos() const
Returns true if the contact position 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...
A node in the scene graph that can hold any number of CollisionSolids.
bool has_interior_point() const
Returns true if the interior point has been specified, false otherwise.
PandaNode * get_into_node() const
Returns the node that contains the CollisionSolid that was collided into.
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() .
const TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
void set_surface_point(const LPoint3 &point)
Stores the point, on the surface of the "into" object, at which a collision is detected.
bool get_respect_prev_transform() const
Returns true if the collision was detected by a CollisionTraverser whose respect_prev_transform flag ...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
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 TransformState * get_prev_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the transform that has been set as this node's "previous" position.
const CollisionSolid * get_from() const
Returns the CollisionSolid pointer for the particular solid that triggered this collision.