00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PHY_SURFACE_PARAMS_H
00028 #define PHY_SURFACE_PARAMS_H
00029
00030 #include <PVLE/Export.h>
00031 #include <ode/ode.h>
00032 #include <osg/Vec3>
00033
00034 namespace Physics {
00035
00036 static const dReal PHY_INFINITY = dInfinity;
00037
00038 class Contact;
00039
00041 class SurfaceParams : public dSurfaceParameters {
00042 public:
00043 enum ESurfaceMode {
00044 NONE = 0,
00045 MU2 = dContactMu2,
00046 FDIR1 = dContactFDir1,
00047 BOUNCE = dContactBounce,
00048 SOFT_ERP = dContactSoftERP,
00049 SOFT_CFM = dContactSoftCFM,
00050 MOTION1 = dContactMotion1,
00051 MOTION2 = dContactMotion2,
00052 MOTION_N = dContactMotionN,
00053 SLIP1 = dContactSlip1,
00054 SLIP2 = dContactSlip2,
00055 APPROX1_1 = dContactApprox1_1,
00056 APPROX1_2 = dContactApprox1_2,
00057 APPROX1 = dContactApprox1
00058 };
00059
00060 SurfaceParams() { mode=0; mu=PHY_INFINITY; bounce_vel=PHY_INFINITY; }
00061 SurfaceParams(int mode, dReal mu, dReal mu2=0, dReal bounce=0, dReal bounce_vel=0, dReal soft_erp=0, dReal soft_cfm=0, dReal motion1=0, dReal motion2=0, dReal motionN=0, dReal slip1=0, dReal slip2=0) {
00062 this->mode=mode; this->mu=mu; this->mu2=mu2; this->bounce=bounce; this->bounce_vel=bounce_vel; this->soft_erp=soft_erp; this->soft_cfm=soft_cfm; this->motion1=motion1; this->motion2=motion2; this->motionN=motionN; this->slip1=slip1; this->slip2=slip2;
00063 }
00064
00065
00068 PVLE_EXPORT void mergeInto(const SurfaceParams & s1, const SurfaceParams & s2);
00069
00070 protected:
00071 friend class Contact;
00072
00074 static SurfaceParams & asSurfaceParams(dSurfaceParameters & sp) { return static_cast<SurfaceParams &>(sp); }
00075 static const SurfaceParams & asSurfaceParams(const dSurfaceParameters & sp) { return static_cast<const SurfaceParams &>(sp); }
00076 };
00077
00078 namespace Materials {
00079 static const SurfaceParams DEFAULT(0, 1);
00080 }
00081
00082 }
00083
00084 #endif // PHY_SURFACE_PARAMS_H