HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~SIM_ForcePoint();
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  virtual 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,
48  UT_Vector3 &force,
49  UT_Vector3 &torque) const;
50 
52 
53 private:
54  static const SIM_DopDescription *getForcePointDopDescription();
55 
58  SIM_Force,
59  "Point Force",
60  getForcePointDopDescription());
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:45
#define SIM_NAME_FORCE
Definition: SIM_Names.h:118
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)
#define SIM_NAME_POSITION
Definition: SIM_Names.h:167
GA_API const UT_StringHolder mass
double fpreal
Definition: SYS_Types.h:263
#define SIM_API
Definition: SIM_API.h:10