00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __SIM_ForceFan_h__
00015 #define __SIM_ForceFan_h__
00016
00017 #include "SIM_API.h"
00018 #include <UT/UT_DMatrix4.h>
00019 #include "SIM_Force.h"
00020 #include "SIM_OptionsUser.h"
00021
00022
00023
00024
00025
00026
00027 class SIM_API SIM_ForceFan : public SIM_Force,
00028 public SIM_OptionsUser
00029 {
00030 public:
00031 GETSET_DATA_FUNCS_V3(SIM_NAME_POSITION, Position);
00032 GETSET_DATA_FUNCS_V3(SIM_NAME_DIRECTION, Direction);
00033 GETSET_DATA_FUNCS_F(SIM_NAME_CONEANGLE, ConeAngle);
00034 GETSET_DATA_FUNCS_F(SIM_NAME_FALLOFFANGLE, FalloffAngle);
00035 GETSET_DATA_FUNCS_F(SIM_NAME_FLUX, Flux);
00036 GETSET_DATA_FUNCS_F(SIM_NAME_FALLOFF, Falloff);
00037 GETSET_DATA_FUNCS_F(SIM_NAME_MAXDISTANCE, MaxDistance);
00038
00039 GETSET_DATA_FUNCS_I(SIM_NAME_SAMPLEMODE, SampleMode);
00040
00041 protected:
00042 explicit SIM_ForceFan(const SIM_DataFactory *factory);
00043 virtual ~SIM_ForceFan();
00044
00045
00046
00047
00048 virtual void getForceSubclass(const SIM_Object &object,
00049 const UT_Vector3 &position,
00050 const UT_Vector3 &velocity,
00051 const UT_Vector3 &angvel,
00052 const fpreal mass,
00053 UT_Vector3 &force,
00054 UT_Vector3 &torque) const;
00055
00056
00057
00058
00059 virtual void getForceOnCircleSubclass(const SIM_Object &object,
00060 const UT_Vector3 &position,
00061 const UT_Vector3 &normal,
00062 const fpreal radius,
00063 const UT_Vector3 &velocity,
00064 const UT_Vector3 &angvel,
00065 const fpreal mass,
00066 UT_Vector3 &force,
00067 UT_Vector3 &torque) const;
00068
00069 virtual SIM_ForceSample getOptimalForceSamplingSubclass() const;
00070
00071
00072
00073 virtual SIM_Guide *createGuideObjectSubclass() const;
00074
00075 virtual void buildGuideGeometrySubclass(const SIM_RootData &root,
00076 const SIM_Options &options,
00077 const GU_DetailHandle &gdh,
00078 UT_DMatrix4 *xform,
00079 const SIM_Time &t) const;
00080
00081 private:
00082
00083
00084
00085
00086 fpreal getAdjustedConeAngle() const;
00087
00088
00089
00090 fpreal getAdjustedFalloffAngle(fpreal coneangle) const;
00091
00092
00093 static const SIM_DopDescription *getForceFanDopDescription();
00094
00095 DECLARE_STANDARD_GETCASTTOTYPE();
00096 DECLARE_DATAFACTORY(SIM_ForceFan,
00097 SIM_Force,
00098 "Fan Force",
00099 getForceFanDopDescription());
00100 };
00101
00102 #endif
00103