|
|
|
Defines a single collision event.
More...
#include "collisionEntry.h"
List of all members.
Public Member Functions |
|
| CollisionEntry (const CollisionEntry ©) |
| 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
|
|
| CPT (TransformState) get_wrt_space() const |
|
| CPT (TransformState) get_inv_wrt_space() const |
|
| CPT (TransformState) get_wrt_prev_space() const |
|
virtual TypeHandle | force_init_type () |
| 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 the indicated coordinate space.
|
| 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 coordinate space.
|
| LVector3 | get_contact_normal (const NodePath &space) const |
| | Returns the surface normal of the "into" object at the contact position.
|
| LPoint3 | get_contact_pos (const NodePath &space) const |
| | Returns the position of the "from" object at the instant that a collision is first detected.
|
| const CollisionSolid * | get_from () const |
| | Returns the CollisionSolid pointer for the particular solid that triggered this collision.
|
| CollisionNode * | get_from_node () const |
| | Returns the node that contains the CollisionSolid that triggered this collision.
|
| NodePath | get_from_node_path () const |
| | Returns the NodePath that represents the CollisionNode that contains the CollisionSolid that triggered this collision.
|
| 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 "from" object has penetrated.
|
| const CollisionSolid * | get_into () const |
| | Returns the CollisionSolid pointer for the particular solid was collided into.
|
| 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 clip plane in effect.
|
| PandaNode * | get_into_node () const |
| | Returns the node that contains the CollisionSolid that was collided into.
|
| NodePath | get_into_node_path () const |
| | Returns the NodePath that represents the specific CollisionNode or GeomNode instance that was collided into.
|
| const LMatrix4 & | get_inv_wrt_mat () const |
| | Returns the relative transform of the into node as seen from the from node.
|
| bool | get_respect_prev_transform () const |
| | Returns true if the collision was detected by a CollisionTraverser whose respect_prev_transform flag was set true, meaning we should consider motion significant in evaluating collisions.
|
| 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.
|
| LPoint3 | get_surface_point (const NodePath &space) const |
| | Returns the point, on the surface of the "into" object, at which a collision is detected.
|
| PN_stdfloat | get_t () const |
| | returns time value for this collision relative to other CollisionEntries
|
|
virtual TypeHandle | get_type () const |
| const LMatrix4 & | get_wrt_mat () const |
| | Returns the relative transform of the from node as seen from the into node.
|
| 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 (according to set_prev_transform(), set_fluid_pos(), etc.)
|
| bool | has_contact_normal () const |
| | Returns true if the contact normal has been specified, false otherwise.
|
| bool | has_contact_pos () const |
| | Returns true if the contact position has been specified, false otherwise.
|
| bool | has_interior_point () const |
| | Returns true if the interior point has been specified, false otherwise.
|
| bool | has_into () const |
| | Returns true if the "into" solid is, in fact, a CollisionSolid, and its pointer is known (in which case get_into() may be called to retrieve it).
|
| bool | has_surface_normal () const |
| | Returns true if the surface normal has been specified, false otherwise.
|
| bool | has_surface_point () const |
| | Returns true if the surface point has been specified, false otherwise.
|
|
void | operator= (const CollisionEntry ©) |
|
void | output (ostream &out) const |
| void | reset_collided () |
| | prepare for another collision test
|
| void | set_contact_normal (const LVector3 &normal) |
| | Stores the surface normal of the "into" object at the contact pos.
|
| void | set_contact_pos (const LPoint3 &pos) |
| | Stores the position of the "from" object at the instant at which the collision is first detected.
|
| void | set_interior_point (const LPoint3 &point) |
| | Stores the point, within the interior of the "into" object, which represents the depth to which the "from" object has penetrated.
|
| void | set_surface_normal (const LVector3 &normal) |
| | Stores the surface normal of the "into" object at the point of the intersection.
|
| void | set_surface_point (const LPoint3 &point) |
| | Stores the point, on the surface of the "into" object, at which a collision is detected.
|
| void | set_t (PN_stdfloat t) |
| | Sets a time value for this collision relative to other CollisionEntries.
|
|
void | write (ostream &out, int indent_level=0) const |
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Friends |
|
class | CollisionHandlerFluidPusher |
|
class | CollisionTraverser |
Detailed Description
Defines a single collision event.
One of these is created for each collision detected by a CollisionTraverser, to be dealt with by the CollisionHandler.
A CollisionEntry provides slots for a number of data values (such as intersection point and normal) that might or might not be known for each collision. It is up to the handler to determine what information is known and to do the right thing with it.
Definition at line 46 of file collisionEntry.h.
Member Function Documentation
Returns the point, within the interior of the "into" object, which represents the depth to which the "from" object has penetrated.
This can also be described as the intersection point on the surface of the "from" object (which is inside the "into" object). It can be thought of as the deepest point of intersection.
The point will be converted into whichever coordinate space the caller specifies.
Definition at line 118 of file collisionEntry.cxx.
References get_surface_point(), NodePath::get_transform(), and has_interior_point().
Returns the relative transform of the into node as seen from the from node.
Definition at line 392 of file collisionEntry.I.
Returns true if the collision was detected by a CollisionTraverser whose respect_prev_transform flag was set true, meaning we should consider motion significant in evaluating collisions.
Definition at line 181 of file collisionEntry.I.
Returns the relative transform of the from node as seen from the into node.
Definition at line 381 of file collisionEntry.I.
Returns the relative transform of the from node as seen from the into node, as of the previous frame (according to set_prev_transform(), set_fluid_pos(), etc.)
Definition at line 405 of file collisionEntry.I.
Stores the surface normal of the "into" object at the contact pos.
This normal is specified in the coordinate space of the "into" object.
Definition at line 303 of file collisionEntry.I.
References LVecBase3f::is_nan().
Stores the position of the "from" object at the instant at which the collision is first detected.
This position is specified in the coordinate space of the "into" object.
Definition at line 287 of file collisionEntry.I.
References LVecBase3f::is_nan().
Stores the point, within the interior of the "into" object, which represents the depth to which the "from" object has penetrated.
This can also be described as the intersection point on the surface of the "from" object (which is inside the "into" object).
This point is specified in the coordinate space of the "into" object.
Definition at line 232 of file collisionEntry.I.
References LVecBase3f::is_nan().
Stores the surface normal of the "into" object at the point of the intersection.
This normal is specified in the coordinate space of the "into" object.
Definition at line 212 of file collisionEntry.I.
References LVecBase3f::is_nan().
Stores the point, on the surface of the "into" object, at which a collision is detected.
This point is specified in the coordinate space of the "into" object.
Definition at line 196 of file collisionEntry.I.
References LVecBase3f::is_nan().
Sets a time value for this collision relative to other CollisionEntries.
Definition at line 133 of file collisionEntry.I.
The documentation for this class was generated from the following files:
| | |