CollisionHandlerPhysical
from panda3d.core import CollisionHandlerPhysical
- class CollisionHandlerPhysical
Bases:
Bases:
CollisionHandlerEventThe abstract base class for a number of
CollisionHandlersthat have some physical effect on their moving bodies: they need to update the nodes’ positions based on the effects of the collision.Inheritance diagram
- addCollider(collider: NodePath, target: NodePath)
Adds a new collider to the list with a
NodePaththat will be updated with the collider’s new position, or updates the existing collider with a newNodePathobject.
- addCollider(collider: NodePath, target: NodePath, drive_interface: DriveInterface)
Adds a new collider to the list with a
NodePaththat will be updated with the collider’s new position, or updates the existing collider with a newNodePathobject.The indicated
DriveInterfacewill also be updated with the target’s new transform each frame. This method should be used when the target is directly controlled by aDriveInterface.
- property center NodePath
- Getter
Returns the
NodePathspecified withsetCenter(), or the emptyNodePathif nothing has been specified.- Setter
Specifies an arbitrary
NodePaththat the handler is always considered to be facing. It does not detect collisions with surfaces that appear to be facing away from thisNodePath. This works best when the collision surfaces in question are polygons.
- clearCenter()
Clears the center
NodePathspecified withsetCenter().
- clearColliders()
Completely empties the list of colliders this handler knows about.
- getCenter() NodePath
Returns the
NodePathspecified withsetCenter(), or the emptyNodePathif nothing has been specified.
- static getClassType() TypeHandle
- hasCenter() bool
Returns true if a
NodePathhas been specified withsetCenter(), false otherwise.
- hasCollider(collider: NodePath) bool
Returns true if the handler knows about the indicated collider, false otherwise.
- hasContact() bool
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.
