Panda3D
collisionGeom.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file collisionGeom.h
10  * @author drose
11  * @date 2006-03-01
12  */
13 
14 #ifndef COLLISIONGEOM_H
15 #define COLLISIONGEOM_H
16 
17 #include "pandabase.h"
18 
19 #include "collisionPolygon.h"
20 
21 /**
22  * A special CollisionPolygon created just for the purpose of detecting
23  * collision against geometry. This kind of object does not have any
24  * persistance in the scene graph; it is created on-the-fly.
25  *
26  * You should not attempt to create one of these directly; it is created only
27  * by the CollisionTraverser, as needed.
28  */
29 class EXPCL_PANDA_COLLIDE CollisionGeom : public CollisionPolygon {
30 private:
31  INLINE CollisionGeom(const LVecBase3 &a, const LVecBase3 &b,
32  const LVecBase3 &c);
33  INLINE CollisionGeom(const CollisionGeom &copy);
34 
35 public:
36  virtual CollisionSolid *make_copy();
37 
40 
41  virtual void output(std::ostream &out) const;
42 
43 private:
44  static PStatCollector _volume_pcollector;
45  static PStatCollector _test_pcollector;
46 
47 public:
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  CollisionPolygon::init_type();
53  register_type(_type_handle, "CollisionGeom",
54  CollisionPolygon::get_class_type());
55  }
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60 
61 private:
62  static TypeHandle _type_handle;
63 
64  friend class CollisionTraverser;
65 };
66 
67 #include "collisionGeom.I"
68 
69 #endif
The abstract base class for all things that can collide with other things in the world,...
virtual PStatCollector & get_test_pcollector()
Returns a PStatCollector that is used to count the number of intersection tests made against a solid ...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:29
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:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.