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...
Public Member Functions | |
addCollider (NodePath const collider, NodePath const 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. | |
addCollider (NodePath const collider, NodePath const 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. | |
clearCenter () | |
Clears the center NodePath specified with set_center. | |
clearColliders () | |
Completely empties the list of colliders this handler knows about. | |
NodePath const | getCenter () |
Returns the NodePath specified with set_center, or the empty NodePath if nothing has been specified. | |
bool | hasCenter () |
Returns true if a NodePath has been specified with set_center(), false otherwise. | |
bool | hasCollider (NodePath const collider) |
Returns true if the handler knows about the indicated collider, false otherwise. | |
bool | hasContact () |
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 | removeCollider (NodePath const collider) |
Removes the collider from the list of colliders that this handler knows about. | |
setCenter (NodePath const center) | |
Specifies an arbitrary NodePath that the handler is always considered to be facing. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
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.
addCollider | ( | NodePath const | collider, |
NodePath const | target | ||
) |
addCollider | ( | NodePath const | collider, |
NodePath const | 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.
The indicated DriveInterface will also be updated with the target's new transform each frame. This method should be used when the target is directly controlled by a DriveInterface.
clearCenter | ( | ) |
Clears the center NodePath specified with set_center.
clearColliders | ( | ) |
Completely empties the list of colliders this handler knows about.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from CollisionHandlerEvent.
Reimplemented in CollisionHandlerGravity, CollisionHandlerFluidPusher, CollisionHandlerPusher, and CollisionHandlerFloor.
bool hasCenter | ( | ) |
Returns true if a NodePath has been specified with set_center(), false otherwise.
bool hasCollider | ( | NodePath const | collider | ) |
Returns true if the handler knows about the indicated collider, false otherwise.
bool hasContact | ( | ) |
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.
bool removeCollider | ( | NodePath const | collider | ) |
Removes the collider from the list of colliders that this handler knows about.