HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_ForceDrag.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_ForceDrag_h__
9 #define __SIM_ForceDrag_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_Force.h"
13 #include "SIM_OptionsUser.h"
14 #include <UT/UT_Matrix.h>
15 
16 /// A simple drag force that opposes velocities in the normal direction.
18  public SIM_OptionsUser
19 {
20 public:
22  GETSET_DATA_FUNCS_V3(SIM_NAME_ANGVELOCITY, AngularVelocityDegrees);
25 
26  /// Controls whether we cancel out mass (making it a delta-v rather
27  /// than delta-momentum)
28  GET_DATA_FUNC_B("ignoremass", IgnoreMass);
29  /// Whether to sample by point, circle, or sphere.
31 
32 protected:
33  explicit SIM_ForceDrag(const SIM_DataFactory *factory);
34  virtual ~SIM_ForceDrag();
35 
36  /// Override the surface force calculation. The drag force opposes
37  /// velocities.
38  virtual void getForceSubclass(const SIM_Object &object,
39  const UT_Vector3 &position,
40  const UT_Vector3 &velocity,
41  const UT_Vector3 &angvel,
42  const fpreal mass,
43  UT_Vector3 &force,
44  UT_Vector3 &torque) const;
45  virtual void getForceOnCircleSubclass(const SIM_Object &object,
46  const UT_Vector3 &position,
47  const UT_Vector3 &normal,
48  const fpreal radius,
49  const UT_Vector3 &velocity,
50  const UT_Vector3 &angvel,
51  const fpreal mass,
52  UT_Vector3 &force,
53  UT_Vector3 &torque) const;
54 
55  virtual void getForceJacobianSubclass(const SIM_Object &object,
56  const UT_Vector3 &position,
57  const UT_Vector3 &velocity,
58  const UT_Vector3 &angvel,
59  const fpreal mass,
60  UT_Matrix &dFdX,
61  UT_Matrix &dFdV) const;
62 
63  virtual SIM_ForceResolver *getForceResolverSubclass(const SIM_Object &object) const;
65 
66 private:
67  /// Get the Automatic DOP description for creating a drag dop.
68  static const SIM_DopDescription *getForceDragDopDescription();
69 
72  SIM_Force,
73  "Drag Force",
74  getForceDragDopDescription());
75 };
76 
77 #endif
78 
virtual void getForceSubclass(const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
A simple drag force that opposes velocities in the normal direction.
Definition: SIM_ForceDrag.h:17
#define SIM_NAME_ANGVELOCITY
Definition: SIM_Names.h:72
SIM_ForceSample
Definition: SIM_Force.h:49
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
#define SIM_NAME_SAMPLEMODE
Definition: SIM_Names.h:180
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
#define SIM_NAME_TORQUESCALE
Definition: SIM_Names.h:204
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
virtual void getForceOnCircleSubclass(const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &normal, const fpreal radius, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
virtual SIM_ForceSample getOptimalForceSamplingSubclass() const
virtual SIM_ForceResolver * getForceResolverSubclass(const SIM_Object &object) const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
#define SIM_NAME_FORCESCALE
Definition: SIM_Names.h:124
GA_API const UT_StringHolder mass
double fpreal
Definition: SYS_Types.h:263
#define GET_DATA_FUNC_B(DataName, FuncName)
#define SIM_API
Definition: SIM_API.h:10
virtual void getForceJacobianSubclass(const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Matrix &dFdX, UT_Matrix &dFdV) const
#define SIM_NAME_VELOCITY
Definition: SIM_Names.h:213