HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~SIM_ForceGravity();
30 
31  /// Calculates the force of gravtiy on a point. The force depends only
32  /// on the mass of the point.
33  virtual void getForceSubclass(const SIM_Object &object,
34  const UT_Vector3 &position,
35  const UT_Vector3 &velocity,
36  const UT_Vector3 &angvel,
37  const fpreal mass,
38  UT_Vector3 &force,
39  UT_Vector3 &torque) const;
40  virtual SIM_ForceResolver *getForceResolverSubclass(const SIM_Object &object) const;
41  /// Calculates the force of gravtiy on a surface. The force depends only
42  /// on the mass, so this function simply calls getForceSubclass(),
43  /// ignoring the circle parameters.
44  virtual void getForceOnCircleSubclass(const SIM_Object &object,
45  const UT_Vector3 &position,
46  const UT_Vector3 &normal,
47  const fpreal radius,
48  const UT_Vector3 &velocity,
49  const UT_Vector3 &angvel,
50  const fpreal mass,
51  UT_Vector3 &force,
52  UT_Vector3 &torque) const;
53  /// Calculates the force of gravtiy on a volume. The force depends only
54  /// on the mass, so this function simply calls getForceSubclass(),
55  /// ignoring the sphere parameters.
56  virtual void getForceOnSphereSubclass(const SIM_Object &object,
57  const UT_Vector3 &position,
58  const fpreal radius,
59  const UT_Vector3 &velocity,
60  const UT_Vector3 &angvel,
61  const fpreal mass,
62  UT_Vector3 &force,
63  UT_Vector3 &torque) const;
64 
66 
67 private:
68  static const SIM_DopDescription *getForceGravityDopDescription();
69 
72  SIM_Force,
73  "Gravity Force",
74  getForceGravityDopDescription());
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
#define SIM_NAME_FORCE
Definition: SIM_Names.h:118
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_ForceSample
Definition: SIM_Force.h:49
#define SIM_NAME_SAMPLEMODE
Definition: SIM_Names.h:180
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
#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)
GA_API const UT_StringHolder mass
double fpreal
Definition: SYS_Types.h:263
#define SIM_API
Definition: SIM_API.h:10