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