17 INLINE CollisionEntry::
41 return (_into !=
nullptr);
84 return _from_node_path;
96 return _into_node_path;
103 set_t(PN_stdfloat t) {
123 return ((0.f <= _t) && (_t <= 1.f));
141 return (_flags & F_respect_prev_transform) != 0;
153 nassertv(!point.is_nan());
154 _surface_point = point;
155 _flags |= F_has_surface_point;
166 nassertv(!normal.is_nan());
167 _surface_normal = normal;
168 _flags |= F_has_surface_normal;
181 nassertv(!point.is_nan());
182 _interior_point = point;
183 _flags |= F_has_interior_point;
193 return (_flags & F_has_surface_point) != 0;
203 return (_flags & F_has_surface_normal) != 0;
213 return (_flags & F_has_interior_point) != 0;
224 nassertv(!pos.is_nan());
226 _flags |= F_has_contact_pos;
236 nassertv(!normal.is_nan());
237 _contact_normal = normal;
238 _flags |= F_has_contact_normal;
248 return (_flags & F_has_contact_pos) != 0;
258 return (_flags & F_has_contact_normal) != 0;
265 get_wrt_space()
const {
273 get_inv_wrt_space()
const {
283 get_wrt_prev_space()
const {
287 return get_wrt_space();
294 INLINE
const LMatrix4 &CollisionEntry::
295 get_wrt_mat()
const {
296 return get_wrt_space()->get_mat();
302 INLINE
const LMatrix4 &CollisionEntry::
303 get_inv_wrt_mat()
const {
304 return get_inv_wrt_space()->get_mat();
312 INLINE
const LMatrix4 &CollisionEntry::
313 get_wrt_prev_mat()
const {
314 return get_wrt_prev_space()->get_mat();
322 get_into_clip_planes()
const {
323 if ((_flags & F_checked_clip_planes) == 0) {
326 return _into_clip_planes;
335 INLINE
void CollisionEntry::
339 #ifdef DO_COLLISION_RECORDING
340 if (trav->has_recorder()) {
341 if (result !=
nullptr) {
342 trav->get_recorder()->collision_tested(*result,
true);
344 trav->get_recorder()->collision_tested(*
this,
false);
354 if (record->wants_all_potential_collidees() && result ==
nullptr) {
356 result->reset_collided();
358 if (result !=
nullptr) {
359 record->add_entry(result);
363 INLINE std::ostream &
This functions similarly to a LightAttrib.
Defines a single collision event.
get_from_node
Returns the node that contains the CollisionSolid that triggered this collision.
get_respect_prev_transform
Returns true if the collision was detected by a CollisionTraverser whose respect_prev_transform flag ...
get_t
returns time value for this collision relative to other CollisionEntries
void reset_collided()
prepare for another collision test
bool has_contact_normal() const
Returns true if the contact normal has been specified, false otherwise.
get_into
Returns the CollisionSolid pointer for the particular solid was collided into.
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.
bool has_into() const
Returns true if the "into" solid is, in fact, a CollisionSolid, and its pointer is known (in which ca...
get_from_node_path
Returns the NodePath that represents the CollisionNode that contains the CollisionSolid that triggere...
bool collided() const
returns true if this represents an actual collision as opposed to a potential collision,...
bool has_surface_point() const
Returns true if the surface point has been specified, false otherwise.
get_into_node_path
Returns the NodePath that represents the specific CollisionNode or GeomNode instance that was collide...
void set_surface_normal(const LVector3 &normal)
Stores the surface normal of the "into" object at the point of the intersection.
get_into_node
Returns the node that contains the CollisionSolid that was collided into.
bool has_interior_point() const
Returns true if the interior point has been specified, 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 "...
set_t
Sets a time value for this collision relative to other CollisionEntries.
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.
get_from
Returns the CollisionSolid pointer for the particular solid that triggered this collision.
void set_surface_point(const LPoint3 &point)
Stores the point, on the surface of the "into" object, at which a collision is detected.
The abstract interface to a number of classes that decide what to do when a collision is detected.
A node in the scene graph that can hold any number of CollisionSolids.
The abstract base class for all things that can collide with other things in the world,...
This class manages the traversal through the scene graph to detect collisions.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
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 TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
A basic node of the scene graph or data graph.
CPT(TransformState) CollisionEntry
Returns the relative transform of the from node as seen from the into node.