|
|
|
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).
More...
#include "collisionSolid.h"
List of all members.
Public Member Functions |
|
| CollisionSolid (const CollisionSolid ©) |
| void | clear_effective_normal () |
| | Removes the normal previously set by set_effective_normal().
|
|
| CPT (BoundingVolume) get_bounds() const |
|
virtual TypeHandle | force_init_type () |
|
virtual LPoint3 | get_collision_origin () const =0 |
| const LVector3 & | get_effective_normal () const |
| | Returns the normal that was set by set_effective_normal().
|
| bool | get_respect_effective_normal () const |
| | See set_respect_effective_normal().
|
| virtual PStatCollector & | get_test_pcollector () |
| | Returns a PStatCollector that is used to count the number of intersection tests made against a solid of this type in a given frame.
|
|
virtual TypeHandle | get_type () const |
| virtual PStatCollector & | get_volume_pcollector () |
| | Returns a PStatCollector that is used to count the number of bounding volume tests made against a solid of this type in a given frame.
|
| bool | has_effective_normal () const |
| | Returns true if a special normal was set by set_effective_normal(), false otherwise.
|
| bool | is_tangible () const |
| | Returns whether the solid is considered 'tangible' or not.
|
|
virtual CollisionSolid * | make_copy ()=0 |
|
virtual void | output (ostream &out) const |
|
virtual | PT (CollisionEntry) test_intersection(const CollisionEntry &entry) const |
|
virtual | PT (PandaNode) get_viz(const CullTraverser *trav |
| void | set_bounds (const BoundingVolume &bounding_volume) |
| | Returns the solid's bounding volume.
|
| void | set_effective_normal (const LVector3 &effective_normal) |
| | 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.
|
| void | set_respect_effective_normal (bool respect_effective_normal) |
| | This is only meaningful for CollisionSolids that will be added to a traverser as colliders.
|
| void | set_tangible (bool tangible) |
| | Sets the current state of the 'tangible' flag.
|
|
virtual void | write (ostream &out, int indent_level=0) const |
| virtual void | write_datagram (BamWriter *manager, Datagram &me) |
| | Function to write the important information in the particular object to a Datagram.
|
| virtual void | xform (const LMatrix4 &mat) |
| | Transforms the solid by the indicated matrix.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Public Attributes |
virtual const
CullTraverserData bool
bounds_only | const |
|
virtual const CullTraverserData & | data |
Protected Member Functions |
|
| CPT (RenderState) get_solid_viz_state() |
|
| CPT (RenderState) get_wireframe_viz_state() |
|
| CPT (RenderState) get_other_viz_state() |
|
| CPT (RenderState) get_solid_bounds_viz_state() |
|
| CPT (RenderState) get_wireframe_bounds_viz_state() |
|
| CPT (RenderState) get_other_bounds_viz_state() |
| bool | do_has_effective_normal () const |
| | Returns true if a special normal was set by set_effective_normal(), false otherwise.
|
| bool | do_is_tangible () const |
| | Returns whether the solid is considered 'tangible' or not.
|
| virtual void | fill_viz_geom () |
| | Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.
|
| void | fillin (DatagramIterator &scan, BamReader *manager) |
| | Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.
|
| void | mark_internal_bounds_stale () |
| | Should be called by a derived class to mark the internal bounding volume stale, so that recompute_internal_bounds() will be called when the bounding volume is next requested.
|
| void | mark_viz_stale () |
| | Called internally when the visualization may have been compromised by some change to internal state and will need to be recomputed the next time it is rendered.
|
|
virtual | PT (CopyOnWriteObject) make_cow_copy() |
|
virtual | PT (BoundingVolume) compute_internal_bounds() const |
|
virtual | PT (CollisionEntry) test_intersection_from_sphere(const CollisionEntry &entry) const |
|
virtual | PT (CollisionEntry) test_intersection_from_line(const CollisionEntry &entry) const |
|
virtual | PT (CollisionEntry) test_intersection_from_ray(const CollisionEntry &entry) const |
|
virtual | PT (CollisionEntry) test_intersection_from_segment(const CollisionEntry &entry) const |
|
virtual | PT (CollisionEntry) test_intersection_from_parabola(const CollisionEntry &entry) const |
|
virtual | PT (CollisionEntry) test_intersection_from_box(const CollisionEntry &entry) const |
|
| PT (GeomNode) _viz_geom |
|
| PT (GeomNode) _bounds_viz_geom |
Static Protected Member Functions |
| static void | report_undefined_from_intersection (TypeHandle from_type) |
| | Outputs a message the first time an intersection test is attempted that isn't defined, and explains a bit about what it means.
|
| static void | report_undefined_intersection_test (TypeHandle from_type, TypeHandle into_type) |
| | Outputs a message the first time an intersection test is attempted that isn't defined, and explains a bit about what it means.
|
Friends |
|
class | CollisionBox |
|
class | CollisionHandlerFluidPusher |
|
class | CollisionLine |
|
class | CollisionParabola |
|
class | CollisionRay |
|
class | CollisionSegment |
|
class | CollisionSphere |
Detailed Description
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.
Definition at line 50 of file collisionSolid.h.
Member Function Documentation
Returns whether the solid is considered 'tangible' or not.
Assumes the lock is already held.
Definition at line 149 of file collisionSolid.I.
Referenced by is_tangible().
Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.
Reimplemented in CollisionPolygon, CollisionFloorMesh, CollisionBox, CollisionTube, CollisionSphere, CollisionPlane, CollisionSegment, CollisionParabola, CollisionRay, CollisionInvSphere, and CollisionLine.
Definition at line 430 of file collisionSolid.cxx.
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.
Reimplemented from TypedWritable.
Reimplemented in CollisionBox, CollisionPolygon, CollisionTube, CollisionSphere, CollisionFloorMesh, CollisionPlane, CollisionParabola, CollisionSegment, CollisionRay, CollisionInvSphere, and CollisionLine.
Definition at line 411 of file collisionSolid.cxx.
References DatagramIterator::get_uint8(), and LVecBase3f::read_datagram().
Outputs a message the first time an intersection test is attempted that isn't defined, and explains a bit about what it means.
Definition at line 368 of file collisionSolid.cxx.
Outputs a message the first time an intersection test is attempted that isn't defined, and explains a bit about what it means.
Definition at line 340 of file collisionSolid.cxx.
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.
Definition at line 65 of file collisionSolid.I.
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.
Definition at line 120 of file collisionSolid.I.
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.
Definition at line 27 of file collisionSolid.I.
Function to write the important information in the particular object to a Datagram.
Reimplemented from TypedWritable.
Reimplemented in CollisionBox, CollisionPolygon, CollisionTube, CollisionFloorMesh, CollisionSphere, CollisionPlane, CollisionParabola, CollisionSegment, CollisionRay, CollisionInvSphere, and CollisionLine.
Definition at line 392 of file collisionSolid.cxx.
References Datagram::add_uint8(), and LVecBase3f::write_datagram().
The documentation for this class was generated from the following files:
| | |