14#ifndef COLLISIONENTRY_H
15#define COLLISIONENTRY_H
42class EXPCL_PANDA_COLLIDE CollisionEntry :
public TypedWritableReferenceCount {
44 INLINE CollisionEntry();
45 CollisionEntry(
const CollisionEntry ©);
46 void operator = (
const CollisionEntry ©);
58 INLINE
void set_t(PN_stdfloat t);
59 INLINE PN_stdfloat
get_t()
const;
83 LPoint3 &surface_point,
84 LVector3 &surface_normal,
85 LPoint3 &interior_point)
const;
91 LVector3 &contact_normal)
const;
93 void output(std::ostream &out)
const;
94 void write(std::ostream &out,
int indent_level = 0)
const;
112 INLINE
const LMatrix4 &get_wrt_mat()
const;
113 INLINE
const LMatrix4 &get_inv_wrt_mat()
const;
114 INLINE
const LMatrix4 &get_wrt_prev_mat()
const;
120 const CollisionTraverser *trav)
const;
121 void check_clip_planes();
134 F_has_surface_point = 0x0001,
135 F_has_surface_normal = 0x0002,
136 F_has_interior_point = 0x0004,
137 F_respect_prev_transform = 0x0008,
138 F_checked_clip_planes = 0x0010,
139 F_has_contact_pos = 0x0020,
140 F_has_contact_normal = 0x0040,
145 LPoint3 _surface_point;
146 LVector3 _surface_normal;
147 LPoint3 _interior_point;
149 LPoint3 _contact_pos;
150 LVector3 _contact_normal;
156 static void init_type() {
157 TypedWritableReferenceCount::init_type();
159 TypedWritableReferenceCount::get_class_type());
161 virtual TypeHandle get_type()
const {
162 return get_class_type();
164 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
167 static TypeHandle _type_handle;
169 friend class CollisionTraverser;
170 friend class CollisionHandlerFluidPusher;
173INLINE std::ostream &operator << (std::ostream &out,
const CollisionEntry &entry);
This functions similarly to a LightAttrib.
Defines a single collision event.
LPoint3 get_contact_pos(const NodePath &space) const
Returns the position of the "from" object at the instant that a collision is first detected.
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.
LVector3 get_contact_normal(const NodePath &space) const
Returns the surface normal of the "into" object at the contact position.
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...
LPoint3 get_surface_point(const NodePath &space) const
Returns the point, on the surface of the "into" object, at which a collision is detected.
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.
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.
get_into_node_path
Returns the NodePath that represents the specific CollisionNode or GeomNode instance that was collide...
LPoint3 get_interior_point(const NodePath &space) const
Returns the point, within the interior of the "into" object, which represents the depth to which the ...
void set_surface_normal(const LVector3 &normal)
Stores the surface normal of the "into" object at the point of the intersection.
bool get_all(const NodePath &space, LPoint3 &surface_point, LVector3 &surface_normal, LPoint3 &interior_point) const
Simultaneously transforms the surface point, surface normal, and interior point of the collision into...
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 "...
bool get_all_contact_info(const NodePath &space, LPoint3 &contact_pos, LVector3 &contact_normal) const
Simultaneously transforms the contact position and contact normal of the collision into the indicated...
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,...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A basic node of the scene graph or data graph.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.