HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ForceBuoyancy.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_ForceBuoyancy_h__
9 #define __SIM_ForceBuoyancy_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 applies a force in a given direction from an
17 /// attached scalar field, treating it as a liquid applying an out-going
18 /// force wherever it is less than 0.
20  public SIM_OptionsUser
21 {
22 public:
23  /// Control the force attribute.
25  /// Whether to sample by point, circle, or sphere.
27 
28 protected:
29  explicit SIM_ForceBuoyancy(const SIM_DataFactory *factory);
30  ~SIM_ForceBuoyancy() override;
31 
32  /// Returns the buoyance force at a point - not very accurate
33  /// as buoyancy is ideally defined over a volume.
34  /// We end up definining it as a unit volume and just enable/disable
35  /// the force according to the surface values.
36  void getForceSubclass(const SIM_Object &object,
37  const UT_Vector3 &position,
38  const UT_Vector3 &velocity,
39  const UT_Vector3 &angvel,
40  const fpreal mass,
42  UT_Vector3 &torque) const override;
43 
45  const SIM_Object &object) const override;
46 
47  void getForceOnSphereSubclass(const SIM_Object &object,
48  const UT_Vector3 &position,
49  const fpreal radius,
50  const UT_Vector3 &velocity,
51  const UT_Vector3 &angvel,
52  const fpreal mass,
53  UT_Vector3 &force,
54  UT_Vector3 &torque) const override;
55 
57 
58 private:
59  static const SIM_DopDescription *getForceBuoyancyDopDescription();
60 
63  SIM_Force,
64  "Buoyancy Force",
65  getForceBuoyancyDopDescription());
66 };
67 
68 #endif
69 
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 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