Panda3D
Public Member Functions | Static Public Member Functions | List of all members
PhysicsCollisionHandler Class Reference

A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into solid walls. This also puts forces onto the physics objects. More...

Inheritance diagram for PhysicsCollisionHandler:
CollisionHandlerPusher CollisionHandlerPhysical CollisionHandlerEvent CollisionHandler TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Public Member Functions

 __init__ ()
 
float getAlmostStationarySpeed ()
 
float getDynamicFrictionCoef ()
 
float getStaticFrictionCoef ()
 
 setAlmostStationarySpeed (float speed)
 These setters and getter are a bit of a hack: More...
 
 setDynamicFrictionCoef (float coef)
 
 setStaticFrictionCoef (float coef)
 
- Public Member Functions inherited from CollisionHandlerPusher
 __init__ ()
 
bool getHorizontal ()
 
 setHorizontal (bool flag)
 
- Public Member Functions inherited from CollisionHandlerPhysical
 addCollider (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. More...
 
 addCollider (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. More...
 
 clearCenter ()
 Clears the center NodePath specified with set_center. More...
 
 clearColliders ()
 Completely empties the list of colliders this handler knows about. More...
 
const NodePath getCenter ()
 Returns the NodePath specified with set_center, or the empty NodePath if nothing has been specified. More...
 
bool hasCenter ()
 Returns true if a NodePath has been specified with set_center(), false otherwise. More...
 
bool hasCollider (const NodePath collider)
 Returns true if the handler knows about the indicated collider, false otherwise. More...
 
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. More...
 
bool removeCollider (const NodePath collider)
 Removes the collider from the list of colliders that this handler knows about. More...
 
 setCenter (const NodePath center)
 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. More...
 
- Public Member Functions inherited from CollisionHandlerEvent
 __init__ ()
 The default CollisionHandlerEvent will throw no events. Its pattern strings must first be set via a call to add_in_pattern() and/or add_out_pattern(). More...
 
 addAgainPattern (str again_pattern)
 Adds the pattern string that indicates how the event names are generated when a collision between two particular nodes is still detected. This event is thrown each consecutive time a collision between two particular nodes is detected, starting with the second time. More...
 
 addInPattern (str in_pattern)
 Adds a pattern string to the list of events that will be generated in response to a collision. The pattern string describes how the event name will be composed. It is a string that may contain any of the following: More...
 
 addOutPattern (str out_pattern)
 Adds the pattern string that indicates how the event names are generated when a collision between two particular nodes is no longer detected. More...
 
 clear ()
 Empties the list of elements that all colliders are known to be colliding with. No "out" events will be thrown; if the same collision is detected next frame, a new "in" event will be thrown for each collision. More...
 
 clearAgainPatterns ()
 Removes all of the previously-added in patterns. See add_again_pattern. More...
 
 clearInPatterns ()
 Removes all of the previously-added in patterns. See add_in_pattern. More...
 
 clearOutPatterns ()
 Removes all of the previously-added in patterns. See add_out_pattern. More...
 
 flush ()
 Same as clear() except "out" events are thrown. More...
 
str getAgainPattern (int n)
 Returns the nth pattern string that indicates how the event names are generated for each collision detected. See add_again_pattern(). More...
 
list getAgainPatterns ()
 
str getInPattern (int n)
 Returns the nth pattern string that indicates how the event names are generated for each collision detected. See add_in_pattern(). More...
 
list getInPatterns ()
 
int getNumAgainPatterns ()
 Returns the number of in pattern strings that have been added. More...
 
int getNumInPatterns ()
 Returns the number of in pattern strings that have been added. More...
 
int getNumOutPatterns ()
 Returns the number of in pattern strings that have been added. More...
 
str getOutPattern (int n)
 Returns the nth pattern string that indicates how the event names are generated for each collision detected. See add_out_pattern(). More...
 
list getOutPatterns ()
 
 setAgainPattern (str again_pattern)
 This method is deprecated; it completely replaces all the in patterns that have previously been set with the indicated pattern. More...
 
 setInPattern (str in_pattern)
 This method is deprecated; it completely replaces all the in patterns that have previously been set with the indicated pattern. More...
 
 setOutPattern (str out_pattern)
 This method is deprecated; it completely replaces all the in patterns that have previously been set with the indicated pattern. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 Derived classes should override this function to return get_class_type(). More...
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise. More...
 
bool unref ()
 Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete(). More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from CollisionHandlerPusher
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from CollisionHandlerPhysical
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from CollisionHandlerEvent
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from CollisionHandler
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Detailed Description

A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into solid walls. This also puts forces onto the physics objects.

Member Function Documentation

◆ __init__()

__init__ ( )

◆ getAlmostStationarySpeed()

float getAlmostStationarySpeed ( )

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getDynamicFrictionCoef()

float getDynamicFrictionCoef ( )

◆ getStaticFrictionCoef()

float getStaticFrictionCoef ( )

◆ setAlmostStationarySpeed()

setAlmostStationarySpeed ( float  speed)

These setters and getter are a bit of a hack:

◆ setDynamicFrictionCoef()

setDynamicFrictionCoef ( float  coef)

◆ setStaticFrictionCoef()

setStaticFrictionCoef ( float  coef)