Panda3D
|
This defines a parabolic arc, or subset of an arc, similar to the path of a projectile or falling object. More...
#include "collisionParabola.h"
Public Member Functions | |
CollisionParabola () | |
Creates an invalid parabola. | |
CollisionParabola (const LParabola ¶bola, PN_stdfloat t1, PN_stdfloat t2) | |
Creates a parabola with the endpoints between t1 and t2 in the parametric space of the parabola. | |
CollisionParabola (const CollisionParabola ©) | |
virtual TypeHandle | force_init_type () |
virtual LPoint3 | get_collision_origin () const |
Returns the point in space deemed to be the "origin" of the solid for collision purposes. | |
const LParabola & | get_parabola () const |
Returns the parabola specified by this solid. | |
PN_stdfloat | get_t1 () const |
Returns the starting point on the parabola. | |
PN_stdfloat | get_t2 () const |
Returns the ending point on the parabola. | |
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. | |
virtual CollisionSolid * | make_copy () |
virtual void | output (ostream &out) const |
virtual | PT (CollisionEntry) test_intersection(const CollisionEntry &entry) const |
void | set_parabola (const LParabola ¶bola) |
Replaces the parabola specified by this solid. | |
void | set_t1 (PN_stdfloat t1) |
Changes the starting point on the parabola. | |
void | set_t2 (PN_stdfloat 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 LMatrix4 &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 TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
Factory method to generate a CollisionParabola object. |
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.
CollisionParabola::CollisionParabola | ( | ) | [inline] |
Creates an invalid parabola.
Definition at line 22 of file collisionParabola.I.
Referenced by make_from_bam().
CollisionParabola::CollisionParabola | ( | const LParabola & | parabola, |
PN_stdfloat | t1, | ||
PN_stdfloat | 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.
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_data3(), GeomVertexWriter::add_data4(), 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_stdfloat().
Referenced by make_from_bam().
LPoint3 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 LParabola & CollisionParabola::get_parabola | ( | ) | const [inline] |
Returns the parabola specified by this solid.
Definition at line 70 of file collisionParabola.I.
PN_stdfloat CollisionParabola::get_t1 | ( | ) | const [inline] |
Returns the starting point on the parabola.
Definition at line 92 of file collisionParabola.I.
PN_stdfloat 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 LParabola & | 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 | ( | PN_stdfloat | 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 | ( | PN_stdfloat | 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_stdfloat().
void CollisionParabola::xform | ( | const LMatrix4 & | 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().