panda3d.core.CollisionHandlerFloor

class CollisionHandlerFloor

Bases: CollisionHandlerPhysical

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.

Inheritance diagram

Inheritance diagram of CollisionHandlerFloor

__init__() → None
static getClassType() → TypeHandle
Return type

TypeHandle

getMaxVelocity() → float

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

getOffset() → float

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

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

property max_velocity
Getter

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

Setter

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.

Return type

float

property offset
Getter

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.

Setter

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.

Return type

float

property reach
Getter

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

Setter

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

Return type

float

setMaxVelocity(max_vel: float) → None

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(offset: float) → None

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(reach: float) → None

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