HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ForceGravity.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_ForceGravity_h__
9 #define __SIM_ForceGravity_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_Force.h"
13 #include "SIM_OptionsUser.h"
14 
15 /// This is an implementation of the SIM_Force interface. This
16 /// implementation returns a force value that is scaled by the mass of
17 /// the object receiving the force. No torque is applied.
19  public SIM_OptionsUser
20 {
21 public:
22  /// Controls the magnitude and direction of the gravitational force.
24  /// Whether to sample by point, circle, or sphere.
26 
27 protected:
28  explicit SIM_ForceGravity(const SIM_DataFactory *factory);
29  ~SIM_ForceGravity() override;
30 
31  /// Calculates the force of gravtiy on a point. The force depends only
32  /// on the mass of the point.
33  void getForceSubclass(
34  const SIM_Object &object,
35  const UT_Vector3 &position,
36  const UT_Vector3 &velocity,
37  const UT_Vector3 &angvel,
38  const fpreal mass,
40  UT_Vector3 &torque) const override;
42  const SIM_Object &object) const override;
43  /// Calculates the force of gravtiy on a surface. The force depends only
44  /// on the mass, so this function simply calls getForceSubclass(),
45  /// ignoring the circle parameters.
47  const SIM_Object &object,
48  const UT_Vector3 &position,
49  const UT_Vector3 &normal,
50  const fpreal radius,
51  const UT_Vector3 &velocity,
52  const UT_Vector3 &angvel,
53  const fpreal mass,
54  UT_Vector3 &force,
55  UT_Vector3 &torque) const override;
56  /// Calculates the force of gravtiy on a volume. The force depends only
57  /// on the mass, so this function simply calls getForceSubclass(),
58  /// ignoring the sphere parameters.
60  const SIM_Object &object,
61  const UT_Vector3 &position,
62  const fpreal radius,
63  const UT_Vector3 &velocity,
64  const UT_Vector3 &angvel,
65  const fpreal mass,
66  UT_Vector3 &force,
67  UT_Vector3 &torque) const override;
68 
70 
71 private:
72  static const SIM_DopDescription *getForceGravityDopDescription();
73 
76  SIM_Force,
77  "Gravity Force",
78  getForceGravityDopDescription());
79 };
80 
81 #endif
82 
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
#define SIM_NAME_FORCE
Definition: SIM_Names.h:119
virtual void getForceOnSphereSubclass(const SIM_Object &object, const UT_Vector3 &position, const fpreal radius, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
SIM_API const UT_StringHolder torque
SIM_ForceSample
Definition: SIM_Force.h:49
#define SIM_NAME_SAMPLEMODE
Definition: SIM_Names.h:181
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
#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)
GA_API const UT_StringHolder mass
SIM_API const UT_StringHolder force
fpreal64 fpreal
Definition: SYS_Types.h:277
SIM_API const UT_StringHolder position
#define SIM_API
Definition: SIM_API.h:12