Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions

CollisionParabola Class Reference

This defines a parabolic arc, or subset of an arc, similar to the path of a projectile or falling object. More...

#include "collisionParabola.h"

Inheritance diagram for CollisionParabola:
CollisionSolid CopyOnWriteObject CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 CollisionParabola ()
 Creates an invalid parabola.
 CollisionParabola (const Parabolaf &parabola, float t1, float t2)
 Creates a parabola with the endpoints between t1 and t2 in the parametric space of the parabola.
 CollisionParabola (const CollisionParabola &copy)
virtual TypeHandle force_init_type ()
virtual LPoint3f get_collision_origin () const
 Returns the point in space deemed to be the "origin" of the solid for collision purposes.
const Parabolaf & get_parabola () const
 Returns the parabola specified by this solid.
float get_t1 () const
 Returns the starting point on the parabola.
float get_t2 () const
 Returns the ending point on the parabola.
virtual PStatCollectorget_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 PStatCollectorget_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.
virtual CollisionSolidmake_copy ()
virtual void output (ostream &out) const
virtual PT (CollisionEntry) test_intersection(const CollisionEntry &entry) const
void set_parabola (const Parabolaf &parabola)
 Replaces the parabola specified by this solid.
void set_t1 (float t1)
 Changes the starting point on the parabola.
void set_t2 (float t2)
 Changes the ending point on the parabola.
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Function to write the important information in the particular object to a Datagram.
virtual void xform (const LMatrix4f &mat)
 Transforms the solid by the indicated matrix.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Factory method to generate a CollisionParabola object.

Protected Member Functions

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.
virtual PT (BoundingVolume) compute_internal_bounds() const

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 Factory method to generate a CollisionParabola object.

Detailed Description

This defines a parabolic arc, or subset of an arc, similar to the path of a projectile or falling object.

It is finite, having a specific beginning and end, but it is infinitely thin.

Think of it as a wire bending from point t1 to point t2 along the path of a pre-defined parabola.

Definition at line 35 of file collisionParabola.h.


Constructor & Destructor Documentation

CollisionParabola::CollisionParabola ( ) [inline]

Creates an invalid parabola.

Definition at line 22 of file collisionParabola.I.

Referenced by make_from_bam().

CollisionParabola::CollisionParabola ( const Parabolaf &  parabola,
float  t1,
float  t2 
) [inline]

Creates a parabola with the endpoints between t1 and t2 in the parametric space of the parabola.

Definition at line 34 of file collisionParabola.I.


Member Function Documentation

void CollisionParabola::fill_viz_geom ( ) [protected, virtual]

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

Reimplemented from CollisionSolid.

Definition at line 192 of file collisionParabola.cxx.

References GeomVertexWriter::add_data3f(), GeomVertexWriter::add_data4f(), and GeomVertexFormat::get_v3cp().

void CollisionParabola::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

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 CollisionSolid.

Definition at line 274 of file collisionParabola.cxx.

References DatagramIterator::get_float32().

Referenced by make_from_bam().

LPoint3f CollisionParabola::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 42 of file collisionParabola.cxx.

const Parabolaf & CollisionParabola::get_parabola ( ) const [inline]

Returns the parabola specified by this solid.

Definition at line 70 of file collisionParabola.I.

float CollisionParabola::get_t1 ( ) const [inline]

Returns the starting point on the parabola.

Definition at line 92 of file collisionParabola.I.

float CollisionParabola::get_t2 ( ) const [inline]

Returns the ending point on the parabola.

Definition at line 114 of file collisionParabola.I.

PStatCollector & CollisionParabola::get_test_pcollector ( ) [virtual]

Returns a PStatCollector that is used to count the number of intersection tests made against a solid of this type in a given frame.

Reimplemented from CollisionSolid.

Definition at line 100 of file collisionParabola.cxx.

PStatCollector & CollisionParabola::get_volume_pcollector ( ) [virtual]

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.

Reimplemented from CollisionSolid.

Definition at line 88 of file collisionParabola.cxx.

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

Factory method to generate a CollisionParabola object.

Definition at line 255 of file collisionParabola.cxx.

References CollisionParabola(), and fillin().

Referenced by register_with_read_factory().

void CollisionParabola::register_with_read_factory ( ) [static]

Factory method to generate a CollisionParabola object.

Definition at line 231 of file collisionParabola.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

void CollisionParabola::set_parabola ( const Parabolaf &  parabola) [inline]

Replaces the parabola specified by this solid.

Definition at line 58 of file collisionParabola.I.

References CollisionSolid::mark_internal_bounds_stale(), and CollisionSolid::mark_viz_stale().

void CollisionParabola::set_t1 ( float  t1) [inline]

Changes the starting point on the parabola.

Definition at line 80 of file collisionParabola.I.

References CollisionSolid::mark_internal_bounds_stale(), and CollisionSolid::mark_viz_stale().

void CollisionParabola::set_t2 ( float  t2) [inline]

Changes the ending point on the parabola.

Definition at line 102 of file collisionParabola.I.

References CollisionSolid::mark_internal_bounds_stale(), and CollisionSolid::mark_viz_stale().

void CollisionParabola::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Function to write the important information in the particular object to a Datagram.

Reimplemented from CollisionSolid.

Definition at line 242 of file collisionParabola.cxx.

References Datagram::add_float32().

void CollisionParabola::xform ( const LMatrix4f mat) [virtual]

Transforms the solid by the indicated matrix.

Reimplemented from CollisionSolid.

Definition at line 73 of file collisionParabola.cxx.

References CollisionSolid::mark_internal_bounds_stale(), and CollisionSolid::mark_viz_stale().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations