CollisionHandlerPhysical
-
class CollisionHandlerPhysical
Bases:
CollisionHandlerEvent
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.Inheritance diagram
-
void add_collider(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 newNodePath
object.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 newNodePath
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 aDriveInterface
.
-
void clear_center(void)
Clears the center
NodePath
specified withset_center
.
-
void clear_colliders(void)
Completely empties the list of colliders this handler knows about.
-
NodePath const &get_center(void) const
Returns the
NodePath
specified withset_center
, or the emptyNodePath
if nothing has been specified.
-
static TypeHandle get_class_type(void)
-
bool has_center(void) const
Returns true if a
NodePath
has been specified withset_center()
, false otherwise.
-
bool has_collider(NodePath const &collider) const
Returns true if the handler knows about the indicated collider, false otherwise.
-
bool has_contact(void) 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. out of bounds). That is the original use of this call.
-
void add_collider(NodePath const &collider, NodePath const &target, DriveInterface *drive_interface)