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
BoundingVolumeand 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.
LVector3 const &get_effective_normal(void) const
bool has_effective_normal(void) const
Returns true if a special normal was set by
set_effective_normal(), false otherwise.
bool is_tangible(void) const
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.
virtual void output(std::ostream &out) const
void set_effective_normal(LVector3 const &effective_normal)
Records a false normal for this
CollisionSolidthat 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.
void set_respect_effective_normal(bool respect_effective_normal)
This is only meaningful for
CollisionSolidsthat 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.
void set_tangible(bool tangible)
Sets the current state of the ‘tangible’ flag. Set this true to make the solid tangible, so that a
CollisionHandlerPusherwill not allow another object to intersect it, or false to make it intangible, so that a
CollisionHandlerPusherwill ignore it except to throw an event.
virtual void write(std::ostream &out, int indent_level = 0) const
- LVector3 const &get_effective_normal(void) const