15 #ifndef COLLISIONSPHERE_H
16 #define COLLISIONSPHERE_H
18 #include "pandabase.h"
19 #include "collisionSolid.h"
21 #include "collisionBox.h"
30 INLINE CollisionSphere(PN_stdfloat cx, PN_stdfloat cy, PN_stdfloat cz, PN_stdfloat radius);
32 virtual LPoint3 get_collision_origin()
const;
35 INLINE CollisionSphere();
38 INLINE CollisionSphere(
const CollisionSphere ©);
49 virtual void output(ostream &out)
const;
51 INLINE
static void flush_level();
54 INLINE
void set_center(
const LPoint3 ¢er);
55 INLINE
void set_center(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
56 INLINE
const LPoint3 &get_center()
const;
58 INLINE
void set_radius(PN_stdfloat radius);
59 INLINE PN_stdfloat get_radius()
const;
73 test_intersection_from_parabola(
const CollisionEntry &entry)
const;
77 virtual void fill_viz_geom();
80 bool intersects_line(
double &t1,
double &t2,
82 PN_stdfloat inflate_radius)
const;
83 bool intersects_parabola(
double &t,
const LParabola ¶bola,
86 LVertex compute_point(PN_stdfloat latitude, PN_stdfloat longitude)
const;
96 static void register_with_read_factory();
107 static void init_type() {
108 CollisionSolid::init_type();
109 register_type(_type_handle,
"CollisionSphere",
110 CollisionSolid::get_class_type());
113 return get_class_type();
115 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
121 #include "collisionSphere.I"
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
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).
Base class for objects that can be written to and read from Bam files.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A spherical collision volume or object.
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
A lightweight class that represents a single element that may be timed and/or counted via stats...
This is a 4-by-4 transform matrix.
virtual PStatCollector & get_volume_pcollector()
Returns a PStatCollector that is used to count the number of bounding volume tests made against a sol...
Defines a single collision event.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual PStatCollector & get_test_pcollector()
Returns a PStatCollector that is used to count the number of intersection tests made against a solid ...
virtual void xform(const LMatrix4 &mat)
Transforms the solid by the indicated matrix.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...