00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __SIM_ForceDrag_h__
00015 #define __SIM_ForceDrag_h__
00016
00017 #include "SIM_API.h"
00018 #include "SIM_Force.h"
00019 #include "SIM_OptionsUser.h"
00020
00021
00022 class SIM_API SIM_ForceDrag : public SIM_Force,
00023 public SIM_OptionsUser
00024 {
00025 public:
00026 GETSET_DATA_FUNCS_V3(SIM_NAME_VELOCITY, Velocity);
00027 GETSET_DATA_FUNCS_V3(SIM_NAME_ANGVELOCITY, AngularVelocityDegrees);
00028 GETSET_DATA_FUNCS_F(SIM_NAME_FORCESCALE, ForceScale);
00029 GETSET_DATA_FUNCS_F(SIM_NAME_TORQUESCALE, TorqueScale);
00030
00031
00032
00033 GET_DATA_FUNC_B("ignoremass", IgnoreMass);
00034
00035 GETSET_DATA_FUNCS_I(SIM_NAME_SAMPLEMODE, SampleMode);
00036
00037 protected:
00038 explicit SIM_ForceDrag(const SIM_DataFactory *factory);
00039 virtual ~SIM_ForceDrag();
00040
00041
00042
00043 virtual void getForceSubclass(const SIM_Object &object,
00044 const UT_Vector3 &position,
00045 const UT_Vector3 &velocity,
00046 const UT_Vector3 &angvel,
00047 const fpreal mass,
00048 UT_Vector3 &force,
00049 UT_Vector3 &torque) const;
00050 virtual void getForceOnCircleSubclass(const SIM_Object &object,
00051 const UT_Vector3 &position,
00052 const UT_Vector3 &normal,
00053 const fpreal radius,
00054 const UT_Vector3 &velocity,
00055 const UT_Vector3 &angvel,
00056 const fpreal mass,
00057 UT_Vector3 &force,
00058 UT_Vector3 &torque) const;
00059
00060 virtual void getForceJacobianSubclass(const SIM_Object &object,
00061 const UT_Vector3 &position,
00062 const UT_Vector3 &velocity,
00063 const UT_Vector3 &angvel,
00064 const fpreal mass,
00065 UT_Matrix &dFdX,
00066 UT_Matrix &dFdV) const;
00067
00068 virtual SIM_ForceResolver *getForceResolverSubclass(const SIM_Object &object) const;
00069 virtual SIM_ForceSample getOptimalForceSamplingSubclass() const;
00070
00071 private:
00072
00073 static const SIM_DopDescription *getForceDragDopDescription();
00074
00075 DECLARE_STANDARD_GETCASTTOTYPE();
00076 DECLARE_DATAFACTORY(SIM_ForceDrag,
00077 SIM_Force,
00078 "Drag Force",
00079 getForceDragDopDescription());
00080 };
00081
00082 #endif
00083