CollisionHandlerPhysical¶
from acron.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
digraph inheritancefb3e607aed { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "CollisionHandler" [URL="acron.core.CollisionHandler.html#acron.core.CollisionHandler",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "CollisionHandler" [arrowsize=0.75,style=""]; "CollisionHandlerEvent" [URL="acron.core.CollisionHandlerEvent.html#acron.core.CollisionHandlerEvent",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "CollisionHandler" -> "CollisionHandlerEvent" [arrowsize=0.75,style=""]; "CollisionHandlerPhysical" [URL="acron.core.CollisionHandlerPhysical.html#acron.core.CollisionHandlerPhysical",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "CollisionHandlerEvent" -> "CollisionHandlerPhysical" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }- __reduce__()¶
- __setstate__()¶
- add_collider()¶
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.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 withset_center(), 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.
- clear_center()¶
Clears the center
NodePathspecified withset_center().
- clear_colliders()¶
Completely empties the list of colliders this handler knows about.
- get_center()¶
Returns the
NodePathspecified withset_center(), or the emptyNodePathif nothing has been specified.
- static get_class_type()¶
- has_center()¶
Returns true if a
NodePathhas been specified withset_center(), false otherwise.
- has_collider()¶
Returns true if the handler knows about the indicated collider, false otherwise.
- has_contact()¶
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.
- remove_collider()¶
Removes the collider from the list of colliders that this handler knows about.