# panda3d.core.CollisionSolid¶

class CollisionSolid

The abstract base class for all things that can collide with other things in the world, and all the things they can collide with (except geometry).

This class and its derivatives really work very similarly to the way BoundingVolume and all of its derivatives work. There’s a different subclass for each basic shape of solid, and double-dispatch function calls handle the subset of the N*N intersection tests that we care about.

Inheritance diagram

getCollisionOrigin() → LPoint3
Return type

LPoint3

setTangible(tangible: bool) → None

Sets the current state of the ‘tangible’ flag. Set this true to make the solid tangible, so that a CollisionHandlerPusher will not allow another object to intersect it, or false to make it intangible, so that a CollisionHandlerPusher will ignore it except to throw an event.

isTangible() → bool

Returns whether the solid is considered ‘tangible’ or not. An intangible solid has no effect in a CollisionHandlerPusher (except to throw an event); it’s useful for defining ‘trigger’ planes and spheres, that cause an effect when passed through.

setEffectiveNormal(effective_normal: LVector3) → None

Records a false normal for this CollisionSolid that will be reported by the collision system with all collisions into it, instead of its actual normal. This is useful as a workaround for the problem of an avatar wanting to stand on a sloping ground; by storing a false normal, the ground appears to be perfectly level, and the avatar does not tend to slide down it.

clearEffectiveNormal() → None

Removes the normal previously set by setEffectiveNormal().

hasEffectiveNormal() → bool

Returns true if a special normal was set by setEffectiveNormal(), false otherwise.

getEffectiveNormal() → LVector3

Returns the normal that was set by setEffectiveNormal(). It is an error to call this unless hasEffectiveNormal() returns true.

Return type

LVector3

setRespectEffectiveNormal(respect_effective_normal: bool) → None

This is only meaningful for CollisionSolids that will be added to a traverser as colliders. It is normally true, but if set false, it means that this particular solid does not care about the “effective” normal of other solids it meets, but rather always uses the true normal.

getRespectEffectiveNormal() → bool
getBounds() → BoundingVolume

Returns the solid’s bounding volume.

Return type

BoundingVolume

setBounds(bounding_volume: BoundingVolume) → None

Returns the solid’s bounding volume.

output(out: ostream) → None
write(out: ostream, indent_level: int) → None
static getClassType() → TypeHandle
Return type

TypeHandle

property collision_origin
Return type

LPoint3

property tangible
Getter

Returns whether the solid is considered ‘tangible’ or not. An intangible solid has no effect in a CollisionHandlerPusher (except to throw an event); it’s useful for defining ‘trigger’ planes and spheres, that cause an effect when passed through.

Setter

Sets the current state of the ‘tangible’ flag. Set this true to make the solid tangible, so that a CollisionHandlerPusher will not allow another object to intersect it, or false to make it intangible, so that a CollisionHandlerPusher will ignore it except to throw an event.

Return type

bool

property respect_effective_normal
Getter
Setter

This is only meaningful for CollisionSolids that will be added to a traverser as colliders. It is normally true, but if set false, it means that this particular solid does not care about the “effective” normal of other solids it meets, but rather always uses the true normal.

Return type

bool

property bounds
Getter

Returns the solid’s bounding volume.

Setter

Returns the solid’s bounding volume.

Return type

ConstPointerTo_BoundingVolume