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

A specialized kind of CollisionHandler that sets the Z height of the collider to a fixed linear offset from the highest detected collision point each frame. More...

Inheritance diagram for CollisionHandlerFloor:
CollisionHandlerPhysical CollisionHandlerEvent CollisionHandler TypedReferenceCount TypedObject ReferenceCount

Public Member Functions

 __init__ ()
 
float getMaxVelocity ()
 Retrieves the maximum speed at which the object will be allowed to descend towards a floor below it, in units per second. More...
 
float getOffset ()
 Returns the linear offset to add to (or subtract from) the highest detected collision point to determine the actual height at which to set the collider. More...
 
float getReach ()
 Returns the reach to add to (or subtract from) the highest collision point. More...
 
 setMaxVelocity (float max_vel)
 Sets the maximum speed at which the object will be allowed to descend towards a floor below it, in units per second. More...
 
 setOffset (float offset)
 Sets the linear offset to add to (or subtract from) the highest detected collision point to determine the actual height at which to set the collider. More...
 
 setReach (float reach)
 Sets the reach to add to (or subtract from) the highest collision point. More...
 
- 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. 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. More...
 
- Public Member Functions inherited from CollisionHandlerEvent
 __init__ ()
 The default CollisionHandlerEvent will throw no events. More...
 
 __init__ (const CollisionHandlerEvent)
 
 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. More...
 
 addInPattern (str in_pattern)
 Adds a pattern string to the list of events that will be generated in response to a collision. 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. More...
 
 clearAgainPatterns ()
 Removes all of the previously-added in patterns. More...
 
 clearInPatterns ()
 Removes all of the previously-added in patterns. More...
 
 clearOutPatterns ()
 Removes all of the previously-added in patterns. 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. More...
 
list getAgainPatterns ()
 
str getInPattern (int n)
 Returns the nth pattern string that indicates how the event names are generated for each collision detected. 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. 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 CollisionHandler
 __init__ (const CollisionHandler)
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. 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. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 

Static Public Member Functions

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 ()
 

Public Attributes

float max_velocity
 Retrieves the maximum speed at which the object will be allowed to descend towards a floor below it, in units per second. More...
 
float offset
 Returns the linear offset to add to (or subtract from) the highest detected collision point to determine the actual height at which to set the collider. More...
 
float reach
 Returns the reach to add to (or subtract from) the highest collision point. More...
 
- Public Attributes inherited from CollisionHandlerPhysical
const NodePath center
 Returns the NodePath specified with set_center, or the empty NodePath if nothing has been specified. More...
 
- Public Attributes inherited from CollisionHandlerEvent
String again_patterns []
 
String in_patterns []
 
String out_patterns []
 
- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 

Detailed Description

A specialized kind of CollisionHandler that sets the Z height of the collider to a fixed linear offset from the highest detected collision point each frame.

It's intended to implement walking around on a floor of varying height by casting a ray down from the avatar's head.

Member Function Documentation

◆ __init__()

__init__ ( )

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getMaxVelocity()

float getMaxVelocity ( )

Retrieves the maximum speed at which the object will be allowed to descend towards a floor below it, in units per second.

See set_max_velocity().

◆ getOffset()

float getOffset ( )

Returns the linear offset to add to (or subtract from) the highest detected collision point to determine the actual height at which to set the collider.

◆ getReach()

float getReach ( )

Returns the reach to add to (or subtract from) the highest collision point.

◆ setMaxVelocity()

setMaxVelocity ( float  max_vel)

Sets the maximum speed at which the object will be allowed to descend towards a floor below it, in units per second.

Set this to zero to allow it to instantly teleport any distance.

◆ setOffset()

setOffset ( float  offset)

Sets the linear offset to add to (or subtract from) the highest detected collision point to determine the actual height at which to set the collider.

◆ setReach()

setReach ( float  reach)

Sets the reach to add to (or subtract from) the highest collision point.

Member Data Documentation

◆ max_velocity

float max_velocity

Retrieves the maximum speed at which the object will be allowed to descend towards a floor below it, in units per second.

See set_max_velocity().

◆ offset

float offset

Returns the linear offset to add to (or subtract from) the highest detected collision point to determine the actual height at which to set the collider.

◆ reach

float reach

Returns the reach to add to (or subtract from) the highest collision point.