HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ~SIM_ForceDrag() override;
35 
36  /// Override the surface force calculation. The drag force opposes
37  /// velocities.
38  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,
44  UT_Vector3 &torque) const override;
45  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 override;
54 
55  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 override;
62 
64  const SIM_Object &object) const override;
66 
67 private:
68  /// Get the Automatic DOP description for creating a drag dop.
69  static const SIM_DopDescription *getForceDragDopDescription();
70 
73  SIM_Force,
74  "Drag Force",
75  getForceDragDopDescription());
76 };
77 
78 #endif
79 
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:50
A simple drag force that opposes velocities in the normal direction.
Definition: SIM_ForceDrag.h:17
SIM_API const UT_StringHolder torque
#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:181
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
#define SIM_NAME_TORQUESCALE
Definition: SIM_Names.h:205
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
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:125
GA_API const UT_StringHolder mass
SIM_API const UT_StringHolder force
fpreal64 fpreal
Definition: SYS_Types.h:277
#define GET_DATA_FUNC_B(DataName, FuncName)
SIM_API const UT_StringHolder position
#define SIM_API
Definition: SIM_API.h:12
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:214