16 #ifndef COLLISIONBOX_H 17 #define COLLISIONBOX_H 19 #include "pandabase.h" 20 #include "collisionSolid.h" 24 #include "clipPlaneAttrib.h" 33 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
36 virtual LPoint3 get_collision_origin()
const;
39 INLINE CollisionBox();
42 INLINE CollisionBox(
const CollisionBox ©);
47 virtual void xform(
const LMatrix4 &mat);
52 virtual void output(ostream &out)
const;
54 virtual LPoint3 get_approx_center()
const;
55 virtual LPoint3 get_min()
const;
56 virtual LPoint3 get_max()
const;
58 INLINE
static void flush_level();
62 INLINE_MATHUTIL
int get_num_points()
const;
63 INLINE_MATHUTIL
LPoint3 get_point_aabb(
int n)
const;
64 INLINE_MATHUTIL
LPoint3 get_point(
int n)
const;
65 INLINE_MATHUTIL
int get_num_planes()
const;
66 INLINE_MATHUTIL LPlane set_plane(
int n)
const;
67 INLINE_MATHUTIL LPlane get_plane(
int n)
const;
68 INLINE
void set_center(
const LPoint3 ¢er);
69 INLINE
void set_center(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
70 INLINE
const LPoint3 &get_center()
const;
71 INLINE PN_stdfloat get_radius()
const;
84 virtual void fill_viz_geom();
90 PN_stdfloat _x, _y, _z, _radius;
94 static const int plane_def[6][4];
101 INLINE
static PN_stdfloat dist_to_line(
const LPoint2 &p,
103 static PN_stdfloat dist_to_line_segment(
const LPoint2 &p,
111 INLINE PointDef(PN_stdfloat x, PN_stdfloat y);
112 INLINE PointDef(
const PointDef ©);
113 INLINE
void operator = (
const PointDef ©);
120 static void compute_vectors(Points &points);
122 const Points &points)
const;
124 bool point_is_inside(
const LPoint2 &p,
const Points &points)
const;
125 PN_stdfloat dist_to_polygon(
const LPoint2 &p,
const Points &points)
const;
127 void setup_points(
const LPoint3 *begin,
const LPoint3 *end,
int plane);
129 INLINE
void calc_to_3d_mat(
LMatrix4 &to_3d_mat,
int plane)
const;
130 INLINE
void rederive_to_3d_mat(
LMatrix4 &to_3d_mat,
int plane)
const;
133 bool clip_polygon(Points &new_points,
const Points &source_points,
134 const LPlane &plane,
int plane_no)
const;
136 const TransformState *net_transform,
int plane_no)
const;
143 INLINE Points get_plane_points(
int n );
146 static void register_with_read_factory();
157 static void init_type() {
158 CollisionSolid::init_type();
159 register_type(_type_handle,
"CollisionBox",
160 CollisionSolid::get_class_type());
163 return get_class_type();
165 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
171 #include "collisionBox.I" This is the base class for all three-component vectors and points.
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).
A cuboid collision volume or object.
Base class for objects that can be written to and read from Bam files.
This functions similarly to a LightAttrib.
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 ...
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.
Defines a single collision event.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is the base class for all two-component vectors and points.
This is a two-component vector offset.
virtual PStatCollector & get_test_pcollector()
Returns a PStatCollector that is used to count the number of intersection tests made against a solid ...
A class to retrieve the individual data elements previously stored in a Datagram. ...
This is a two-component point in space.
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 ...
A node that holds Geom objects, renderable pieces of geometry.