Panda3D
collisionGeom.h
1 // Filename: collisionGeom.h
2 // Created by: drose (01Mar06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef COLLISIONGEOM_H
16 #define COLLISIONGEOM_H
17 
18 #include "pandabase.h"
19 
20 #include "collisionPolygon.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : CollisionGeom
24 // Description : A special CollisionPolygon created just for the
25 // purpose of detecting collision against geometry.
26 // This kind of object does not have any persistance in
27 // the scene graph; it is created on-the-fly.
28 //
29 // You should not attempt to create one of these
30 // directly; it is created only by the
31 // CollisionTraverser, as needed.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDA_COLLIDE CollisionGeom : public CollisionPolygon {
34 private:
35  INLINE CollisionGeom(const LVecBase3 &a, const LVecBase3 &b,
36  const LVecBase3 &c);
37  INLINE CollisionGeom(const CollisionGeom &copy);
38 
39 public:
40  virtual CollisionSolid *make_copy();
41 
44 
45  virtual void output(ostream &out) const;
46 
47 private:
48  static PStatCollector _volume_pcollector;
49  static PStatCollector _test_pcollector;
50 
51 public:
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  CollisionPolygon::init_type();
57  register_type(_type_handle, "CollisionGeom",
58  CollisionPolygon::get_class_type());
59  }
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64 
65 private:
66  static TypeHandle _type_handle;
67 
68  friend class CollisionTraverser;
69 };
70 
71 #include "collisionGeom.I"
72 
73 #endif
74 
75 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
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).
virtual PStatCollector & get_test_pcollector()
Returns a PStatCollector that is used to count the number of intersection tests made against a solid ...
A lightweight class that represents a single element that may be timed and/or counted via stats...
A special CollisionPolygon created just for the purpose of detecting collision against geometry...
Definition: collisionGeom.h:33
This class manages the traversal through the scene graph to detect collisions.
virtual PStatCollector & get_volume_pcollector()
Returns a PStatCollector that is used to count the number of bounding volume tests made against a sol...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85