HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ForceReferenceFrame.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_ForceReferenceFrame_h__
9 #define __SIM_ForceReferenceFrame_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.
16 /// This implementation transforms the accerations of another object
17 /// into forces on this object, thereby allowing you to have an object
18 /// use another object as a reference frame.
20  public SIM_OptionsUser
21 {
22 public:
23  /// The object to get the new frame from.
24  GET_DATA_FUNC_S("newframeobject", NewFrameName);
25  /// The position data on the new frame object
26  GET_DATA_FUNC_S("newframeposition", NewFramePositionName);
27  // AMount to scale the effect.
28  GET_DATA_FUNC_F("forcescale", ForceScale);
29  /// Whether to sample by point, circle, or sphere.
31 
32 protected:
33  explicit SIM_ForceReferenceFrame(const SIM_DataFactory *factory);
34  ~SIM_ForceReferenceFrame() override;
35 
36  /// Computes the acceleration of the frame object and uses
37  /// that to determine fictitious forces that would generate
38  /// that acceleration. These become the returned force.
39  void getForceSubclass(
40  const SIM_Object &object,
41  const UT_Vector3 &position,
42  const UT_Vector3 &velocity,
43  const UT_Vector3 &angvel,
44  const fpreal mass,
45  UT_Vector3 &force,
46  UT_Vector3 &torque) const override;
48  const SIM_Object &object) const override;
49 
51 
52 private:
53  static const SIM_DopDescription *getForceReferenceFrameDopDescription();
54 
57  SIM_Force,
58  "Reference Frame Force",
59  getForceReferenceFrameDopDescription());
60 };
61 
62 #endif
63 
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
SIM_ForceSample
Definition: SIM_Force.h:49
#define SIM_NAME_SAMPLEMODE
Definition: SIM_Names.h:181
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
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
fpreal64 fpreal
Definition: SYS_Types.h:277
#define GET_DATA_FUNC_F(DataName, FuncName)
#define SIM_API
Definition: SIM_API.h:10
#define GET_DATA_FUNC_S(DataName, FuncName)