HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ForceUniform.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_ForceUniform_h__
9 #define __SIM_ForceUniform_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 fixed value for force and torque regardless
17 /// of the object data passed in.
19  public SIM_OptionsUser
20 {
21 public:
22  /// Control the force attribute.
23  GETSET_DATA_FUNCS_V3(SIM_NAME_FORCE, UniformForce);
24  /// Control the torque attribute.
25  GETSET_DATA_FUNCS_V3(SIM_NAME_TORQUE, UniformTorque);
26  /// Whether to sample by point, circle, or sphere.
28 
29 protected:
30  explicit SIM_ForceUniform(const SIM_DataFactory *factory);
31  ~SIM_ForceUniform() override;
32 
33  /// Returns the force and torque on a point. The returned values are
34  /// exact copies of the force and torque attributes. The
35  /// getForceOnCircleSubclass() and getForceOnSphereSubclass()
36  /// functions use the default implementations which scale the point
37  /// force by the area or volume of the circle or sphere. This means
38  /// that regardless of the size of samples used to quantize an object,
39  /// the total force on the object should remain roughly constant.
40  void getForceSubclass(
41  const SIM_Object &object,
42  const UT_Vector3 &position,
43  const UT_Vector3 &velocity,
44  const UT_Vector3 &angvel,
45  const fpreal mass,
47  UT_Vector3 &torque) const override;
49  const SIM_Object &object) const override;
50 
52 
53 private:
54  static const SIM_DopDescription *getForceUniformDopDescription();
55 
58  SIM_Force,
59  "Uniform Force",
60  getForceUniformDopDescription());
61 };
62 
63 #endif
64 
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
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
#define SIM_NAME_TORQUE
Definition: SIM_Names.h:203
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