|
|
|
The abstract base class for a number of CollisionHandlers that have some physical effect on their moving bodies: they need to update the nodes' positions based on the effects of the collision.
More...
#include "collisionHandlerPhysical.h"
List of all members.
Classes |
| class | ColliderDef |
Public Member Functions |
| void | add_collider (const NodePath &collider, const NodePath &target) |
| | Adds a new collider to the list with a NodePath that will be updated with the collider's new position, or updates the existing collider with a new NodePath object.
|
| void | add_collider (const NodePath &collider, const NodePath &target, DriveInterface *drive_interface) |
| | Adds a new collider to the list with a NodePath that will be updated with the collider's new position, or updates the existing collider with a new NodePath object.
|
| virtual void | add_entry (CollisionEntry *entry) |
| | Called between a begin_group() .
|
| virtual void | begin_group () |
| | Will be called by the CollisionTraverser before a new traversal is begun.
|
| void | clear_center () |
| | Clears the center NodePath specified with set_center.
|
| void | clear_colliders () |
| | Completely empties the list of colliders this handler knows about.
|
| virtual bool | end_group () |
| | Called by the CollisionTraverser at the completion of all collision detections for this traversal.
|
|
virtual TypeHandle | force_init_type () |
| const NodePath & | get_center () const |
| | Returns the NodePath specified with set_center, or the empty NodePath if nothing has been specified.
|
|
virtual TypeHandle | get_type () const |
| bool | has_center () const |
| | Returns true if a NodePath has been specified with set_center(), false otherwise.
|
| bool | has_collider (const NodePath &collider) const |
| | Returns true if the handler knows about the indicated collider, false otherwise.
|
| bool | has_contact () const |
| | Did the handler make any contacts with anything on the last collision pass? Depending on how your world is setup, this can be used to tell if the handler is out of the world (i.e.
|
| bool | remove_collider (const NodePath &collider) |
| | Removes the collider from the list of colliders that this handler knows about.
|
| void | set_center (const NodePath ¢er) |
| | Specifies an arbitrary NodePath that the handler is always considered to be facing.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
Protected Types |
typedef pmap< NodePath,
ColliderDef > | Colliders |
|
typedef pvector< PT(CollisionEntry) > | Entries |
|
typedef pmap< NodePath, Entries > | FromEntries |
Protected Member Functions |
|
virtual void | apply_linear_force (ColliderDef &def, const LVector3f &force)=0 |
|
virtual bool | handle_entries ()=0 |
| virtual bool | validate_target (const NodePath &target) |
| | Called internally to validate the target passed to add_collider().
|
Protected Attributes |
|
NodePath | _center |
|
Colliders | _colliders |
|
FromEntries | _from_entries |
|
bool | _has_contact |
Detailed Description
The abstract base class for a number of CollisionHandlers that have some physical effect on their moving bodies: they need to update the nodes' positions based on the effects of the collision.
Definition at line 34 of file collisionHandlerPhysical.h.
Member Function Documentation
| void CollisionHandlerPhysical::add_collider |
( |
const NodePath & |
collider, |
|
|
const NodePath & |
target |
|
) |
| |
| void CollisionHandlerPhysical::add_entry |
( |
CollisionEntry * |
entry | ) |
[virtual] |
| void CollisionHandlerPhysical::begin_group |
( |
| ) |
[virtual] |
| void CollisionHandlerPhysical::clear_center |
( |
| ) |
[inline] |
| void CollisionHandlerPhysical::clear_colliders |
( |
| ) |
|
| bool CollisionHandlerPhysical::end_group |
( |
| ) |
[virtual] |
| const NodePath & CollisionHandlerPhysical::get_center |
( |
| ) |
const [inline] |
| bool CollisionHandlerPhysical::has_center |
( |
| ) |
const [inline] |
| bool CollisionHandlerPhysical::has_collider |
( |
const NodePath & |
collider | ) |
const |
| bool CollisionHandlerPhysical::has_contact |
( |
| ) |
const [inline] |
Did the handler make any contacts with anything on the last collision pass? Depending on how your world is setup, this can be used to tell if the handler is out of the world (i.e.
out of bounds). That is the original use of this call.
Definition at line 72 of file collisionHandlerPhysical.I.
| static void CollisionHandlerPhysical::init_type |
( |
| ) |
[inline, static] |
| bool CollisionHandlerPhysical::remove_collider |
( |
const NodePath & |
collider | ) |
|
| void CollisionHandlerPhysical::set_center |
( |
const NodePath & |
center | ) |
[inline] |
Specifies an arbitrary NodePath that the handler is always considered to be facing.
It does not detect collisions with surfaces that appear to be facing away from this NodePath. This works best when the collision surfaces in question are polygons.
Definition at line 26 of file collisionHandlerPhysical.I.
| bool CollisionHandlerPhysical::validate_target |
( |
const NodePath & |
target | ) |
[protected, virtual] |
The documentation for this class was generated from the following files:
| | |