00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __SIM_ForceMagnet_h__
00015 #define __SIM_ForceMagnet_h__
00016
00017 #include "SIM_API.h"
00018 #include "SIM_Force.h"
00019 #include "SIM_OptionsUser.h"
00020
00021
00022
00023
00024 class SIM_API SIM_ForceMagnet : public SIM_Force,
00025 public SIM_OptionsUser
00026 {
00027 public:
00028
00029 GETSET_DATA_FUNCS_F(SIM_NAME_FORCESCALE, ForceScale);
00030
00031 GETSET_DATA_FUNCS_I(SIM_NAME_SAMPLEMODE, SampleMode);
00032
00033 protected:
00034 explicit SIM_ForceMagnet(const SIM_DataFactory *factory);
00035 virtual ~SIM_ForceMagnet();
00036
00037
00038
00039
00040
00041
00042
00043
00044 virtual void getForceSubclass(const SIM_Object &object,
00045 const UT_Vector3 &position,
00046 const UT_Vector3 &velocity,
00047 const UT_Vector3 &angvel,
00048 const fpreal mass,
00049 UT_Vector3 &force,
00050 UT_Vector3 &torque) const;
00051
00052 virtual SIM_ForceSample getOptimalForceSamplingSubclass() const;
00053
00054
00055
00056
00057 virtual SIM_Guide *createGuideObjectSubclass() const;
00058
00059
00060 virtual void buildGuideGeometrySubclass(const SIM_RootData &root,
00061 const SIM_Options &options,
00062 const GU_DetailHandle &gdh,
00063 UT_DMatrix4 *xform,
00064 const SIM_Time &t) const;
00065
00066 private:
00067 static const SIM_DopDescription *getForceMagnetDopDescription();
00068
00069
00070
00071 void getGeometryToWorldTransform(UT_DMatrix4 &xform) const;
00072
00073
00074 void getWorldToGeometryTransform(UT_DMatrix4 &xform) const;
00075
00076 DECLARE_STANDARD_GETCASTTOTYPE();
00077 DECLARE_DATAFACTORY(SIM_ForceMagnet,
00078 SIM_Force,
00079 "Magnet Force",
00080 getForceMagnetDopDescription());
00081 };
00082
00083 #endif
00084