Panda3D
odeCollisionEntry.h
1 // Filename: odeCollisionEntry.h
2 // Created by: pro-rsoft (05Mar09)
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 ODECOLLISIONENTRY_H
16 #define ODECOLLISIONENTRY_H
17 
18 #include "pandabase.h"
19 #include "typedReferenceCount.h"
20 
21 #include "odeContactGeom.h"
22 
23 class OdeUtil;
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : OdeCollisionEntry
27 // Description : A class used to hold information about a collision
28 // that has occurred.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAODE OdeCollisionEntry : public TypedReferenceCount {
31 PUBLISHED:
32  virtual ~OdeCollisionEntry();
33 
34  INLINE OdeGeom get_geom1() const;
35  INLINE OdeGeom get_geom2() const;
36  INLINE OdeBody get_body1() const;
37  INLINE OdeBody get_body2() const;
38 
39  INLINE size_t get_num_contacts() const;
40  INLINE LPoint3f get_contact_point(size_t n) const;
41  INLINE OdeContactGeom get_contact_geom(size_t n) const;
42  INLINE OdeContactGeom operator [] (size_t n) const;
43  MAKE_SEQ(get_contact_points, get_num_contacts, get_contact_point);
44  MAKE_SEQ(get_contact_geoms, get_num_contacts, get_contact_geom);
45 
46  INLINE operator bool () const;
47  INLINE bool is_empty() const;
48 
49 private:
50  INLINE OdeCollisionEntry();
51  dGeomID _geom1, _geom2;
52  dBodyID _body1, _body2;
53  size_t _num_contacts;
54  OdeContactGeom *_contact_geoms;
55 
56 public:
57  static TypeHandle get_class_type() {
58  return _type_handle;
59  }
60  static void init_type() {
61  TypedReferenceCount::init_type();
62  register_type(_type_handle, "OdeCollisionEntry",
63  TypedReferenceCount::get_class_type());
64  }
65  virtual TypeHandle get_type() const {
66  return get_class_type();
67  }
68  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
69 
70 private:
71 
72  static TypeHandle _type_handle;
73 
74  friend class OdeSpace;
75  friend class OdeUtil;
76 };
77 
78 #include "odeCollisionEntry.I"
79 
80 #endif
81 
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
A class used to hold information about a collision that has occurred.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85