HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~SIM_ForceBuoyancy();
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  virtual 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,
41  UT_Vector3 &force,
42  UT_Vector3 &torque) const;
43 
44  virtual void getForceOnSphereSubclass(const SIM_Object &object,
45  const UT_Vector3 &position,
46  const fpreal radius,
47  const UT_Vector3 &velocity,
48  const UT_Vector3 &angvel,
49  const fpreal mass,
50  UT_Vector3 &force,
51  UT_Vector3 &torque) const;
52 
54 
55 private:
56  static const SIM_DopDescription *getForceBuoyancyDopDescription();
57 
60  SIM_Force,
61  "Buoyancy Force",
62  getForceBuoyancyDopDescription());
63 };
64 
65 #endif
66 
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 SIM_ForceSample getOptimalForceSamplingSubclass() const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
GA_API const UT_StringHolder mass
double fpreal
Definition: SYS_Types.h:269
#define SIM_API
Definition: SIM_API.h:10