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  virtual ~SIM_ForceUniform();
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  virtual void getForceSubclass(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;
47  virtual SIM_ForceResolver *getForceResolverSubclass(const SIM_Object &object) const;
48 
50 
51 private:
52  static const SIM_DopDescription *getForceUniformDopDescription();
53 
56  SIM_Force,
57  "Uniform Force",
58  getForceUniformDopDescription());
59 };
60 
61 #endif
62 
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
#define SIM_NAME_TORQUE
Definition: SIM_Names.h:202
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
double fpreal
Definition: SYS_Types.h:270
#define SIM_API
Definition: SIM_API.h:10