Panda3D
|
00001 // Filename: odeSurfaceParameters.h 00002 // Created by: joswilso (27Dec06) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef ODESURFACEPARAMETERS_H 00016 #define ODESURFACEPARAMETERS_H 00017 00018 #include "pandabase.h" 00019 #include "typedObject.h" 00020 #include "luse.h" 00021 00022 #include "ode_includes.h" 00023 00024 class OdeContact; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : OdeSurfaceParameters 00028 // Description : 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDAODE OdeSurfaceParameters : public TypedObject { 00031 friend class OdeContact; 00032 00033 protected: 00034 OdeSurfaceParameters(const dSurfaceParameters &surface_parameters); 00035 00036 PUBLISHED: 00037 enum ModeFlags { MF_contact_mu2 = 0x001, 00038 MF_contactFDir1 = 0x002, 00039 MF_contactBounce = 0x004, 00040 MF_contactSoftERP = 0x008, 00041 MF_contactSoftCFM = 0x010, 00042 MF_contactMotion1 = 0x020, 00043 MF_contactMotion2 = 0x040, 00044 MF_contactSlip1 = 0x080, 00045 MF_contactSlip2 = 0x100, 00046 00047 MF_contactApprox0 = 0x0000, 00048 MF_contactApprox1_1 = 0x1000, 00049 MF_contactApprox1_2 = 0x2000, 00050 MF_contactApprox1 = 0x3000 }; 00051 00052 /* 00053 // Interrogate doesn't seem to handle this so well 00054 enum ModeFlags { MF_contact_mu2 = dContactMu2, 00055 MF_contactFDir1 = dContactFDir1, 00056 MF_contactBounce = dContactBounce, 00057 MF_contactSoftERP = dContactSoftERP, 00058 MF_contactSoftCFM = dContactSoftCFM, 00059 MF_contactMotion1 = dContactMotion1, 00060 MF_contactMotion2 = dContactMotion2, 00061 MF_contactSlip1 = dContactSlip1, 00062 MF_contactSlip2 = dContactSlip2, 00063 // MF_contactApprox0 = dContactApprox0, 00064 MF_contactApprox1_1 = dContactApprox1_1, 00065 MF_contactApprox1_2 = dContactApprox1_2, 00066 MF_contactApprox1 = dContactApprox1 }; 00067 */ 00068 00069 OdeSurfaceParameters(int mode = 0, dReal mu = 0); 00070 virtual ~OdeSurfaceParameters(); 00071 00072 INLINE void set_mode(int mode); 00073 INLINE void set_mu(dReal mu); 00074 INLINE void set_mu2(dReal mu2); 00075 INLINE void set_bounce(dReal bounce); 00076 INLINE void set_bounce_vel(dReal bounce_vel); 00077 INLINE void set_soft_erp(dReal soft_erp); 00078 INLINE void set_soft_cfm(dReal soft_cfm); 00079 INLINE void set_motion1(dReal motion); 00080 INLINE void set_motion2(dReal motion); 00081 INLINE void set_slip1(dReal slip); 00082 INLINE void set_slip2(dReal slip); 00083 00084 INLINE int get_mode() const; 00085 INLINE dReal get_mu() const; 00086 INLINE dReal get_mu2() const; 00087 INLINE dReal get_bounce() const; 00088 INLINE dReal get_bounce_vel() const; 00089 INLINE dReal get_soft_erp() const; 00090 INLINE dReal get_soft_cfm() const; 00091 INLINE dReal get_motion1() const; 00092 INLINE dReal get_motion2() const; 00093 INLINE dReal get_slip1() const; 00094 INLINE dReal get_slip2() const; 00095 00096 public: 00097 const dSurfaceParameters *get_surface_parameters_ptr() const; 00098 00099 private: 00100 void operator = (const OdeSurfaceParameters ©); 00101 dSurfaceParameters _surface_parameters; 00102 00103 public: 00104 static TypeHandle get_class_type() { 00105 return _type_handle; 00106 } 00107 static void init_type() { 00108 TypedObject::init_type(); 00109 register_type(_type_handle, "OdeSurfaceParameters", 00110 TypedObject::get_class_type()); 00111 } 00112 virtual TypeHandle get_type() const { 00113 return get_class_type(); 00114 } 00115 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00116 00117 private: 00118 static TypeHandle _type_handle; 00119 }; 00120 00121 #include "odeSurfaceParameters.I" 00122 00123 #endif