HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_ForceImpulse.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  * NAME: SIM_ForceImpulse.h ( SIM Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __SIM_ForceImpulse__
12 #define __SIM_ForceImpulse__
13 
14 #include "SIM_API.h"
15 #include "SIM_Force.h"
16 #include "SIM_OptionsUser.h"
17 
18 /// This is an implementation of the SIM_Force interface. This
19 /// implementation returns a force value that is scaled by the timestep
20 /// of the simulation.
22  public SIM_OptionsUser
23 {
24 public:
25  /// Controls the magnitude and direction of the impulse.
26  GETSET_DATA_FUNCS_V3("impulse", Impulse);
27  /// Whether to sample by point, circle, or sphere.
29 
30 protected:
31  explicit SIM_ForceImpulse(const SIM_DataFactory *factory);
32  virtual ~SIM_ForceImpulse();
33 
34  /// Calculates the impulse on a point. This force will be scaled
35  /// by the timestep & optionally by the mass.
36  virtual void getForceSubclass(const SIM_Object &object,
37  const UT_Vector3 &position,
38  const UT_Vector3 &velocity,
39  const UT_Vector3 &angvel,
40  const fpreal mass,
41  UT_Vector3 &force,
42  UT_Vector3 &torque) const;
43 
44  /// Calculates the impulse on a surface.
45  /// This function simply calls getForceSubclass(), ignoring the circle
46  /// parameters.
47  virtual void getForceOnCircleSubclass(const SIM_Object &object,
48  const UT_Vector3 &position,
49  const UT_Vector3 &normal,
50  const fpreal radius,
51  const UT_Vector3 &velocity,
52  const UT_Vector3 &angvel,
53  const fpreal mass,
54  UT_Vector3 &force,
55  UT_Vector3 &torque) const;
56  /// Calculates the impulse on a volume.
57  /// This function simply calls getForceSubclass(), ignoring the sphere
58  /// parameters.
59  virtual void getForceOnSphereSubclass(const SIM_Object &object,
60  const UT_Vector3 &position,
61  const fpreal radius,
62  const UT_Vector3 &velocity,
63  const UT_Vector3 &angvel,
64  const fpreal mass,
65  UT_Vector3 &force,
66  UT_Vector3 &torque) const;
67 
69 
70 private:
71  static const SIM_DopDescription *getForceImpulseDopDescription();
72 
75  SIM_Force,
76  "Impulse Force",
77  getForceImpulseDopDescription());
78 };
79 
80 #endif
81 
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
virtual void getForceOnSphereSubclass(const SIM_Object &object, const UT_Vector3 &position, const fpreal radius, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
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 void getForceOnCircleSubclass(const SIM_Object &object, const UT_Vector3 &position, const UT_Vector3 &normal, const fpreal radius, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const fpreal mass, UT_Vector3 &force, UT_Vector3 &torque) const
virtual SIM_ForceSample getOptimalForceSamplingSubclass() const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
GA_API const UT_StringHolder mass
double fpreal
Definition: SYS_Types.h:263
#define SIM_API
Definition: SIM_API.h:10