Panda3D
odeSurfaceParameters.h
1 // Filename: odeSurfaceParameters.h
2 // Created by: joswilso (27Dec06)
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 ODESURFACEPARAMETERS_H
16 #define ODESURFACEPARAMETERS_H
17 
18 #include "pandabase.h"
19 #include "typedObject.h"
20 #include "luse.h"
21 
22 #include "ode_includes.h"
23 
24 class OdeContact;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : OdeSurfaceParameters
28 // Description :
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAODE OdeSurfaceParameters : public TypedObject {
31  friend class OdeContact;
32 
33 protected:
34  OdeSurfaceParameters(const dSurfaceParameters &surface_parameters);
35 
36 PUBLISHED:
37  enum ModeFlags { MF_contact_mu2 = 0x001,
38  MF_contactFDir1 = 0x002,
39  MF_contactBounce = 0x004,
40  MF_contactSoftERP = 0x008,
41  MF_contactSoftCFM = 0x010,
42  MF_contactMotion1 = 0x020,
43  MF_contactMotion2 = 0x040,
44  MF_contactSlip1 = 0x080,
45  MF_contactSlip2 = 0x100,
46 
47  MF_contactApprox0 = 0x0000,
48  MF_contactApprox1_1 = 0x1000,
49  MF_contactApprox1_2 = 0x2000,
50  MF_contactApprox1 = 0x3000 };
51 
52  /*
53  // Interrogate doesn't seem to handle this so well
54  enum ModeFlags { MF_contact_mu2 = dContactMu2,
55  MF_contactFDir1 = dContactFDir1,
56  MF_contactBounce = dContactBounce,
57  MF_contactSoftERP = dContactSoftERP,
58  MF_contactSoftCFM = dContactSoftCFM,
59  MF_contactMotion1 = dContactMotion1,
60  MF_contactMotion2 = dContactMotion2,
61  MF_contactSlip1 = dContactSlip1,
62  MF_contactSlip2 = dContactSlip2,
63  // MF_contactApprox0 = dContactApprox0,
64  MF_contactApprox1_1 = dContactApprox1_1,
65  MF_contactApprox1_2 = dContactApprox1_2,
66  MF_contactApprox1 = dContactApprox1 };
67  */
68 
69  OdeSurfaceParameters(int mode = 0, dReal mu = 0);
70  virtual ~OdeSurfaceParameters();
71 
72  INLINE void set_mode(int mode);
73  INLINE void set_mu(dReal mu);
74  INLINE void set_mu2(dReal mu2);
75  INLINE void set_bounce(dReal bounce);
76  INLINE void set_bounce_vel(dReal bounce_vel);
77  INLINE void set_soft_erp(dReal soft_erp);
78  INLINE void set_soft_cfm(dReal soft_cfm);
79  INLINE void set_motion1(dReal motion);
80  INLINE void set_motion2(dReal motion);
81  INLINE void set_slip1(dReal slip);
82  INLINE void set_slip2(dReal slip);
83 
84  INLINE int get_mode() const;
85  INLINE dReal get_mu() const;
86  INLINE dReal get_mu2() const;
87  INLINE dReal get_bounce() const;
88  INLINE dReal get_bounce_vel() const;
89  INLINE dReal get_soft_erp() const;
90  INLINE dReal get_soft_cfm() const;
91  INLINE dReal get_motion1() const;
92  INLINE dReal get_motion2() const;
93  INLINE dReal get_slip1() const;
94  INLINE dReal get_slip2() const;
95 
96 public:
97  const dSurfaceParameters *get_surface_parameters_ptr() const;
98 
99 private:
100  void operator = (const OdeSurfaceParameters &copy);
101  dSurfaceParameters _surface_parameters;
102 
103 public:
104  static TypeHandle get_class_type() {
105  return _type_handle;
106  }
107  static void init_type() {
109  register_type(_type_handle, "OdeSurfaceParameters",
110  TypedObject::get_class_type());
111  }
112  virtual TypeHandle get_type() const {
113  return get_class_type();
114  }
115  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
116 
117 private:
118  static TypeHandle _type_handle;
119 };
120 
121 #include "odeSurfaceParameters.I"
122 
123 #endif
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition: typedObject.cxx:52
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition: typedObject.h:98
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85