Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CollisionSegment Class Reference

A finite line segment, with two specific endpoints but no thickness. More...

#include <collisionSegment.h>

Inheritance diagram for CollisionSegment:

CollisionSolid TypedWritableReferenceCount BoundedObject TypedWritable ReferenceCount TypedObject List of all members.

Public Types

enum  BoundingVolumeType { BVT_static, BVT_dynamic_sphere }

Public Member Functions

 CollisionSegment ()
 Creates an invalid segment.

 CollisionSegment (const LPoint3f &a, const LPoint3f &db)
 CollisionSegment (float ax, float ay, float az, float bx, float by, float bz)
 CollisionSegment (const CollisionSegment &copy)
virtual CollisionSolidmake_copy ()
virtual PointerTo< CollisionEntrytest_intersection (const CollisionEntry &entry) const
 Tests for a collision between this object (which is also the "from" object in the entry) and the "into" object.

virtual void xform (const LMatrix4f &mat)
 Transforms the solid by the indicated matrix.

virtual LPoint3f get_collision_origin () const
 Returns the point in space deemed to be the "origin" of the solid for collision purposes.

virtual void output (ostream &out) const
void set_point_a (const LPoint3f &a)
void set_point_a (float x, float y, float z)
const LPoint3f & get_point_a () const
void set_point_b (const LPoint3f &b)
void set_point_b (float x, float y, float z)
const LPoint3f & get_point_b () const
bool set_from_lens (LensNode *camera, const LPoint2f &point)
 Accepts a LensNode and a 2-d point in the range [-1,1].

bool set_from_lens (LensNode *camera, float px, float py)
 Accepts a LensNode and a 2-d point in the range [-1,1].

virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
void set_tangible (bool tangible)
 Sets the current state of the 'tangible' flag.

bool is_tangible () const
 Returns whether the solid is considered 'tangible' or not.

GeomNodeget_viz () const
 Returns a GeomNode that may be rendered to visualize the CollisionSolid.

virtual void write (ostream &out, int indent_level=0) const
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

virtual void finalize ()
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.

int get_ref_count () const
 Returns the current reference count.

int ref () const
 Explicitly increments the reference count.

int unref () const
 Explicitly decrements the reference count.

void test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.

void set_bound (BoundingVolumeType type)
 Sets the type of the bounding volume that will be dynamically computed for this particular node.

void set_bound (const BoundingVolume &volume)
 Explicitly sets a new bounding volume on this node.

const BoundingVolumeget_bound () const
 Returns the current bounding volume on this node, possibly forcing a recompute.

bool mark_bound_stale ()
 Marks the current bounding volume as stale, so that it will be recomputed later.

void force_bound_stale ()
 Marks the current volume as stale and propagates the effect at least one level, even if it had already been marked stale.

bool is_bound_stale () const
 Returns true if the bound is currently marked stale and will be recomputed the next time get_bound() is called.

void set_final (bool flag)
 Sets the "final" flag on this BoundedObject.

bool is_final () const
 Returns the current state of the "final" flag.


Static Public Member Functions

void register_with_read_factory ()
 Tells the BamReader how to create objects of type CollisionSegment.

TypeHandle get_class_type ()
void init_type ()

Static Public Attributes

TypedWritable *const Null = (TypedWritable*)0L

Protected Member Functions

virtual BoundingVolumerecompute_bound ()
 Recomputes the dynamic bounding volume for this object.

virtual void fill_viz_geom ()
 Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.

void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new CollisionSegment.

virtual PointerTo< CollisionEntrytest_intersection_from_sphere (const CollisionEntry &entry) const
 This is part of the double-dispatch implementation of test_intersection().

virtual PointerTo< CollisionEntrytest_intersection_from_ray (const CollisionEntry &entry) const
 This is part of the double-dispatch implementation of test_intersection().

virtual PointerTo< CollisionEntrytest_intersection_from_segment (const CollisionEntry &entry) const
 This is part of the double-dispatch implementation of test_intersection().

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.

ConstPointerTo< RenderStateget_solid_viz_state ()
 Returns a RenderState for rendering collision visualizations in solid.

ConstPointerTo< RenderStateget_wireframe_viz_state ()
 Returns a RenderState for rendering collision visualizations in wireframe.

ConstPointerTo< RenderStateget_other_viz_state ()
 Returns a RenderState for rendering collision visualizations for things that are neither solid nor exactly wireframe, like rays and segments.

virtual void propagate_stale_bound ()
 Called by BoundedObject::mark_bound_stale(), this should make sure that all bounding volumes that depend on this one are marked stale also.

const BoundingVolumeget_bound_ptr () const
 Returns the state of the _bound pointer.

BoundingVolumeset_bound_ptr (BoundingVolume *bound)
 Changes the _bound pointer.


Static Protected Member Functions

TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type CollisionSegment is encountered in the Bam file.

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.

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.


Protected Attributes

PointerTo< GeomNode_viz_geom
bool _viz_geom_stale
bool _tangible

Private Attributes

LPoint3f _a
LPoint3f _b

Static Private Attributes

TypeHandle _type_handle

Detailed Description

A finite line segment, with two specific endpoints but no thickness.

It's similar to a CollisionRay, except it does not continue to infinity.

It does have an ordering, from point A to point B. If more than a single point of the segment is intersecting a solid, the reported intersection point is generally the closest on the segment to point A.

Definition at line 52 of file collisionSegment.h.


Member Enumeration Documentation

enum BoundedObject::BoundingVolumeType [inherited]
 

Enumeration values:
BVT_static 
BVT_dynamic_sphere 

Definition at line 58 of file boundedObject.h.


Constructor & Destructor Documentation

CollisionSegment::CollisionSegment  )  [inline]
 

Creates an invalid segment.

This isn't terribly useful; it's expected that the user will subsequently adjust the segment via set_origin()/set_direction() or set_from_lens().

Definition at line 37 of file collisionSegment.I.

References _a, _b, INLINE, and nassertv.

CollisionSegment::CollisionSegment const LPoint3f &  a,
const LPoint3f &  db
[inline]
 

Definition at line 51 of file collisionSegment.I.

References _a, _b, INLINE, and nassertv.

CollisionSegment::CollisionSegment float  ax,
float  ay,
float  az,
float  bx,
float  by,
float  bz
[inline]
 

Definition at line 65 of file collisionSegment.I.

CollisionSegment::CollisionSegment const CollisionSegment &  copy  )  [inline]
 

Definition at line 80 of file collisionSegment.I.


Member Function Documentation

int TypedWritable::complete_pointers TypedWritable **  p_list,
BamReader manager
[virtual, inherited]
 

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in AnimBundleNode, AnimGroup, PartBundleNode, PartGroup, Character, CharacterJoint, CollisionNode, GeomSprite, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, RenderEffects, RenderState, TextureAttrib, Person, and Child.

Definition at line 94 of file typedWritable.cxx.

Referenced by RenderState::do_invert_compose().

void CollisionSegment::fill_viz_geom  )  [protected, virtual]
 

Fills the _viz_geom GeomNode up with Geoms suitable for rendering this solid.

Reimplemented from CollisionSolid.

Definition at line 188 of file collisionSegment.cxx.

References _a, _b, and CollisionSolid::write_datagram().

void CollisionSegment::fillin DatagramIterator scan,
BamReader manager
[protected]
 

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new CollisionSegment.

Reimplemented from CollisionSolid.

Definition at line 279 of file collisionSegment.cxx.

void TypedWritable::finalize void   )  [virtual, inherited]
 

Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

Reimplemented in PartBundle, RenderAttrib, RenderEffect, RenderEffects, RenderState, and TransformState.

Definition at line 112 of file typedWritable.cxx.

Referenced by BamReader::skip_pointer().

void BoundedObject::force_bound_stale  )  [inline, inherited]
 

Marks the current volume as stale and propagates the effect at least one level, even if it had already been marked stale.

Definition at line 188 of file boundedObject.I.

References BoundedObject::_cycler, BoundedObject::F_final, and INLINE.

Referenced by PandaNode::remove_child().

virtual TypeHandle CollisionSegment::force_init_type void   )  [inline, virtual]
 

Reimplemented from CollisionSolid.

Definition at line 112 of file collisionSegment.h.

const BoundingVolume & BoundedObject::get_bound  )  const [inherited]
 

Returns the current bounding volume on this node, possibly forcing a recompute.

A node's bounding volume encloses only the node itself, irrespective of the nodes above or below it in the graph. This is different from the bounding volumes on the arcs, which enclose all geometry below them.

Reimplemented in PandaNode.

Definition at line 59 of file boundedObject.cxx.

Referenced by PandaNode::clear_effect(), PandaNode::get_state(), and CollisionLevelState::reserve().

const BoundingVolume * BoundedObject::get_bound_ptr  )  const [inline, protected, inherited]
 

Returns the state of the _bound pointer.

To be used only internally by derived classes.

This returns a const pointer only; the bounding volume should not be modified directly, because that might interfere with pipelining. Instead, create a new copy with make_copy(), modify the copy, and set_bound_ptr() with the copy.

Alternatively, if you have just called recompute_bound(), which is guaranteed to reset the pointer, just use the return value from that as a non-const BoundingVolume pointer.

Definition at line 318 of file boundedObject.I.

TypeHandle CollisionSegment::get_class_type void   )  [inline, static]
 

Reimplemented from CollisionSolid.

Definition at line 101 of file collisionSegment.h.

LPoint3f CollisionSegment::get_collision_origin  )  const [virtual]
 

Returns the point in space deemed to be the "origin" of the solid for collision purposes.

The closest intersection point to this origin point is considered to be the most significant.

Implements CollisionSolid.

Definition at line 97 of file collisionSegment.cxx.

ConstPointerTo< RenderState > CollisionSolid::get_other_viz_state  )  [protected, inherited]
 

Returns a RenderState for rendering collision visualizations for things that are neither solid nor exactly wireframe, like rays and segments.

Definition at line 447 of file collisionSolid.cxx.

const LPoint3f & CollisionSegment::get_point_a  )  const [inline]
 

Definition at line 124 of file collisionSegment.I.

References INLINE, set_point_b(), x, and y.

Referenced by CollisionPolygon::test_intersection_from_ray(), and xform().

const LPoint3f & CollisionSegment::get_point_b  )  const [inline]
 

Definition at line 163 of file collisionSegment.I.

Referenced by CollisionPolygon::test_intersection_from_ray().

int ReferenceCount::get_ref_count  )  const [inline, inherited]
 

Returns the current reference count.

Definition at line 183 of file referenceCount.I.

Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture().

ConstPointerTo< RenderState > CollisionSolid::get_solid_viz_state  )  [protected, inherited]
 

Returns a RenderState for rendering collision visualizations in solid.

This automatically returns the appropriate state according to the setting of _tangible.

Definition at line 359 of file collisionSolid.cxx.

References CPT, TransparencyAttrib::M_alpha, CullFaceAttrib::M_cull_clockwise, RenderModeAttrib::M_filled, TransparencyAttrib::make(), RenderModeAttrib::make(), CullFaceAttrib::make(), RenderState::make(), and NULL.

Referenced by CollisionPolygon::test_intersection_from_segment().

virtual TypeHandle CollisionSegment::get_type void   )  const [inline, virtual]
 

Reimplemented from CollisionSolid.

Definition at line 109 of file collisionSegment.h.

int TypedObject::get_type_index  )  const [inline, inherited]
 

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

GeomNode * CollisionSolid::get_viz  )  const [inherited]
 

Returns a GeomNode that may be rendered to visualize the CollisionSolid.

This is used during the cull traversal to render the CollisionNodes that have been made visible.

Definition at line 118 of file collisionSolid.cxx.

References indent().

Referenced by CollisionNode::combine_with().

ConstPointerTo< RenderState > CollisionSolid::get_wireframe_viz_state  )  [protected, inherited]
 

Returns a RenderState for rendering collision visualizations in wireframe.

This automatically returns the appropriate state according to the setting of _tangible.

Definition at line 404 of file collisionSolid.cxx.

Referenced by CollisionPolygon::test_intersection_from_segment().

void CollisionSegment::init_type void   )  [inline, static]
 

Reimplemented from CollisionSolid.

Definition at line 104 of file collisionSegment.h.

bool BoundedObject::is_bound_stale  )  const [inline, inherited]
 

Returns true if the bound is currently marked stale and will be recomputed the next time get_bound() is called.

This function is defined up at the top of this file, because several of the inline functions below reference it.

Definition at line 217 of file boundedObject.I.

References BoundedObject::_cycler, and INLINE.

Referenced by BoundedObject::~BoundedObject().

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is the indicated type exactly.

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

bool BoundedObject::is_final  )  const [inline, inherited]
 

Returns the current state of the "final" flag.

Initially, this flag is off (false), but it may be changed by an explicit call to set_final(). See set_final().

Definition at line 280 of file boundedObject.I.

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is or derives from the indicated type.

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

bool CollisionSolid::is_tangible  )  const [inline, inherited]
 

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.

Definition at line 66 of file collisionSolid.I.

CollisionSolid * CollisionSegment::make_copy void   )  [virtual]
 

Implements CollisionSolid.

Definition at line 50 of file collisionSegment.cxx.

References CollisionEntry::get_into(), and CollisionSolid::test_intersection_from_segment().

TypedWritable * CollisionSegment::make_from_bam const FactoryParams params  )  [static, protected]
 

This function is called by the BamReader's factory when a new object of type CollisionSegment is encountered in the Bam file.

It should create the CollisionSegment and extract its information from the file.

Definition at line 255 of file collisionSegment.cxx.

bool BoundedObject::mark_bound_stale  )  [inline, inherited]
 

Marks the current bounding volume as stale, so that it will be recomputed later.

This may have a cascading effect up to the root of all graphs of which the node is a part. Returns true if the setting was changed, or false if it was already marked stale (or if it is a static bounding volume).

Definition at line 162 of file boundedObject.I.

References BoundedObject::_cycler, BoundedObject::F_bound_stale, and INLINE.

Referenced by CollisionSphere::CollisionSphere(), GeomNode::combine_with(), CollisionPlane::get_normal(), PGItem::instance_to_state_def(), CollisionPlane::make_copy(), PGItem::set_active(), CollisionSphere::set_center(), TextNode::set_coordinate_system(), PandaNode::set_effect(), CollisionNode::set_from_collide_mask(), GeomNode::set_geom_state(), CollisionRay::set_origin(), set_point_a(), CollisionSphere::test_intersection(), test_intersection(), CollisionRay::test_intersection(), and CollisionNode::xform().

void CollisionSolid::mark_viz_stale  )  [inline, protected, inherited]
 

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.

Definition at line 85 of file collisionSolid.I.

Referenced by CollisionSphere::CollisionSphere(), CollisionPlane::get_normal(), CollisionPlane::make_copy(), CollisionSphere::set_center(), CollisionRay::set_origin(), set_point_a(), CollisionSphere::test_intersection(), test_intersection(), and CollisionRay::test_intersection().

void CollisionSegment::output ostream &  out  )  const [virtual]
 

Reimplemented from CollisionSolid.

Definition at line 109 of file collisionSegment.cxx.

References _a, and _b.

void BoundedObject::propagate_stale_bound  )  [protected, virtual, inherited]
 

Called by BoundedObject::mark_bound_stale(), this should make sure that all bounding volumes that depend on this one are marked stale also.

Reimplemented in dDrawable, and PandaNode.

Definition at line 108 of file boundedObject.cxx.

BoundingVolume * CollisionSegment::recompute_bound  )  [protected, virtual]
 

Recomputes the dynamic bounding volume for this object.

The default behavior is the compute an empty bounding volume; this may be overridden to extend it to create a nonempty bounding volume. However, after calling this function, it is guaranteed that the _bound pointer will not be shared with any other stage of the pipeline, and this new pointer is returned.

Reimplemented from BoundedObject.

Definition at line 160 of file collisionSegment.cxx.

References CollisionSolid::_viz_geom.

int ReferenceCount::ref  )  const [inline, inherited]
 

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 225 of file referenceCount.I.

Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering().

void CollisionSegment::register_with_read_factory void   )  [static]
 

Tells the BamReader how to create objects of type CollisionSegment.

Definition at line 219 of file collisionSegment.cxx.

References _a, _b, and CollisionSolid::fillin().

void CollisionSolid::report_undefined_from_intersection TypeHandle  from_type  )  [static, protected, inherited]
 

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 276 of file collisionSolid.cxx.

Referenced by CollisionSolid::~CollisionSolid().

void CollisionSolid::report_undefined_intersection_test TypeHandle  from_type,
TypeHandle  into_type
[static, protected, inherited]
 

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 243 of file collisionSolid.cxx.

References CollisionSolid::_tangible, and Datagram::add_uint8().

Referenced by CollisionSolid::write().

void BoundedObject::set_bound const BoundingVolume volume  )  [inline, inherited]
 

Explicitly sets a new bounding volume on this node.

This will be a static bounding volume that will no longer be recomputed automatically.

Reimplemented in PandaNode.

Definition at line 135 of file boundedObject.I.

References BoundedObject::F_bound_stale.

void BoundedObject::set_bound BoundedObject::BoundingVolumeType  type  )  [inline, inherited]
 

Sets the type of the bounding volume that will be dynamically computed for this particular node.

Presently, this should only be BVT_dynamic_sphere.

Definition at line 115 of file boundedObject.I.

BoundingVolume * BoundedObject::set_bound_ptr BoundingVolume bound  )  [inline, protected, inherited]
 

Changes the _bound pointer.

To be used only internally by derived classes, usually in recompute_bound(). The return value is the same pointer passed in, as a convenience (it will now be reference counted).

Definition at line 340 of file boundedObject.I.

void BoundedObject::set_final bool  flag  )  [inline, inherited]
 

Sets the "final" flag on this BoundedObject.

If this is true, than no bounding volume need be tested below it; a positive intersection with this bounding volume is deemed to be a positive intersection with all geometry inside.

This is useful to quickly force a larger bounding volume around a node when the GeomNodes themselves are inaccurate for some reason, without forcing a recompute of every nested bounding volume. It's also helpful when the bounding volume is tricked by some special properties, like billboards, that may move geometry out of its bounding volume otherwise.

Definition at line 256 of file boundedObject.I.

bool CollisionSegment::set_from_lens LensNode camera,
float  px,
float  py
[inline]
 

Accepts a LensNode and a 2-d point in the range [-1,1].

Sets the CollisionSegment so that it begins at the LensNode's near plane and extends to the far plane, making it suitable for picking objects from the screen given a camera and a mouse location.

Definition at line 184 of file collisionSegment.I.

bool CollisionSegment::set_from_lens LensNode camera,
const LPoint2f &  point
 

Accepts a LensNode and a 2-d point in the range [-1,1].

Sets the CollisionSegment so that it begins at the LensNode's near plane and extends to the far plane, making it suitable for picking objects from the screen given a camera and a mouse location.

Returns true if the point was acceptable, false otherwise.

Definition at line 136 of file collisionSegment.cxx.

void CollisionSegment::set_point_a float  x,
float  y,
float  z
[inline]
 

Definition at line 112 of file collisionSegment.I.

References _a, _b, INLINE, BoundedObject::mark_bound_stale(), CollisionSolid::mark_viz_stale(), and nassertv.

void CollisionSegment::set_point_a const LPoint3f &  a  )  [inline]
 

Definition at line 95 of file collisionSegment.I.

void CollisionSegment::set_point_b float  x,
float  y,
float  z
[inline]
 

Definition at line 151 of file collisionSegment.I.

void CollisionSegment::set_point_b const LPoint3f &  b  )  [inline]
 

Definition at line 136 of file collisionSegment.I.

References _b.

Referenced by get_point_a().

void CollisionSolid::set_tangible bool  tangible  )  [inline, inherited]
 

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 42 of file collisionSolid.I.

References CollisionSolid::_tangible, and INLINE.

Referenced by EggLoader::make_collision_sphere().

PointerTo< CollisionEntry > CollisionSegment::test_intersection const CollisionEntry entry  )  const [virtual]
 

Tests for a collision between this object (which is also the "from" object in the entry) and the "into" object.

If a collision is detected, returns a new CollisionEntry object that records the collision; otherwise, returns NULL.

Reimplemented from CollisionSolid.

Definition at line 62 of file collisionSegment.cxx.

References _a, _b, BoundedObject::mark_bound_stale(), and CollisionSolid::mark_viz_stale().

PointerTo< CollisionEntry > CollisionSolid::test_intersection_from_ray const CollisionEntry entry  )  const [protected, virtual, inherited]
 

This is part of the double-dispatch implementation of test_intersection().

It is called when the "from" object is a ray.

Reimplemented in CollisionPlane, CollisionPolygon, and CollisionSphere.

Definition at line 187 of file collisionSolid.cxx.

Referenced by CollisionRay::make_copy().

PointerTo< CollisionEntry > CollisionSolid::test_intersection_from_segment const CollisionEntry entry  )  const [protected, virtual, inherited]
 

This is part of the double-dispatch implementation of test_intersection().

It is called when the "from" object is a segment.

Reimplemented in CollisionPolygon, and CollisionSphere.

Definition at line 206 of file collisionSolid.cxx.

Referenced by make_copy().

PointerTo< CollisionEntry > CollisionSolid::test_intersection_from_sphere const CollisionEntry entry  )  const [protected, virtual, inherited]
 

This is part of the double-dispatch implementation of test_intersection().

It is called when the "from" object is a sphere.

Reimplemented in CollisionPlane, CollisionPolygon, and CollisionSphere.

Definition at line 168 of file collisionSolid.cxx.

References NULL.

Referenced by CollisionSphere::make_copy().

void ReferenceCount::test_ref_count_integrity  )  const [inline, inherited]
 

Does some easy checks to make sure that the reference count isn't completely bogus.

Definition at line 328 of file referenceCount.I.

References INLINE.

Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount().

int ReferenceCount::unref  )  const [inline, inherited]
 

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 293 of file referenceCount.I.

References INLINE.

Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds().

void CollisionSolid::write ostream &  out,
int  indent_level = 0
const [virtual, inherited]
 

Definition at line 151 of file collisionSolid.cxx.

References CollisionRay::get_class_type(), CollisionSolid::get_type(), NULL, and CollisionSolid::report_undefined_intersection_test().

void CollisionSegment::write_datagram BamWriter manager,
Datagram dg
[virtual]
 

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from CollisionSolid.

Definition at line 234 of file collisionSegment.cxx.

void CollisionSegment::xform const LMatrix4f &  mat  )  [virtual]
 

Transforms the solid by the indicated matrix.

Implements CollisionSolid.

Definition at line 75 of file collisionSegment.cxx.

References get_point_a().


Member Data Documentation

LPoint3f CollisionSegment::_a [private]
 

Definition at line 90 of file collisionSegment.h.

Referenced by CollisionSegment(), fill_viz_geom(), output(), register_with_read_factory(), set_point_a(), and test_intersection().

LPoint3f CollisionSegment::_b [private]
 

Definition at line 90 of file collisionSegment.h.

Referenced by CollisionSegment(), fill_viz_geom(), output(), register_with_read_factory(), set_point_a(), set_point_b(), and test_intersection().

bool CollisionSolid::_tangible [protected, inherited]
 

Definition at line 112 of file collisionSolid.h.

Referenced by CollisionSolid::report_undefined_intersection_test(), and CollisionSolid::set_tangible().

TypeHandle CollisionSegment::_type_handle [static, private]
 

Reimplemented from CollisionSolid.

Definition at line 39 of file collisionSegment.cxx.

PointerTo< GeomNode > CollisionSolid::_viz_geom [protected, inherited]
 

Definition at line 110 of file collisionSolid.h.

Referenced by recompute_bound(), CollisionSolid::test_intersection(), and CollisionPolygon::test_intersection_from_segment().

bool CollisionSolid::_viz_geom_stale [protected, inherited]
 

Definition at line 111 of file collisionSolid.h.

Referenced by CollisionSolid::CollisionSolid().

TypedWritable *const TypedWritable::Null = (TypedWritable*)0L [static, inherited]
 

Definition at line 25 of file typedWritable.cxx.

Referenced by Child::complete_pointers(), Parent::complete_pointers(), Person::complete_pointers(), LoaderFileTypeBam::get_extension(), PartGroup::pick_channel_index(), BamReader::read_pointer(), and AnimGroup::write_datagram().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:48:36 2003 for Panda by doxygen1.3