HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ForcePoint.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_ForcePoint_h__
9 #define __SIM_ForcePoint_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 a given
17 /// point. This means the torque will take into account the offset
18 /// from the center of mass.
20  public SIM_OptionsUser
21 {
22 public:
23  /// Control the force attribute.
25  /// Control the position attribute.
27  /// Whether to sample by point, circle, or sphere.
29 
30 protected:
31  explicit SIM_ForcePoint(const SIM_DataFactory *factory);
32  ~SIM_ForcePoint() override;
33 
34  /// Returns the force and torque on a point. The returned values are
35  /// the torque and force applied to an object with center of mass
36  /// at poistion which receives a force at PointPosition of
37  /// value ForcePoint.
38  /// The getForceOnCircleSubclass() and getForceOnSphereSubclass()
39  /// functions use the default implementations which scale the point
40  /// force by the area or volume of the circle or sphere. This means
41  /// that regardless of the size of samples used to quantize an object,
42  /// the total force on the object should remain roughly constant.
43  void getForceSubclass(const SIM_Object &object,
44  const UT_Vector3 &position,
45  const UT_Vector3 &velocity,
46  const UT_Vector3 &angvel,
47  const fpreal mass,
49  UT_Vector3 &torque) const override;
50 
52  const override;
53 
55 
56 private:
57  static const SIM_DopDescription *getForcePointDopDescription();
58 
61  SIM_Force,
62  "Point Force",
63  getForcePointDopDescription());
64 };
65 
66 #endif
67 
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
virtual SIM_ForceSample getOptimalForceSamplingSubclass() const
virtual SIM_ForceResolver * getForceResolverSubclass(const SIM_Object &object) const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
#define SIM_NAME_POSITION
Definition: SIM_Names.h:168
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