HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ForceVelImpulse.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_ForceVelImpulse.h ( SIM Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __SIM_ForceVelImpulse__
12 #define __SIM_ForceVelImpulse__
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("deltavel", DeltaVel);
27  /// Whether to sample by point, circle, or sphere.
29 
30 protected:
31  explicit SIM_ForceVelImpulse(const SIM_DataFactory *factory);
32  ~SIM_ForceVelImpulse() override;
33 
34  /// Calculates the impulse on a point. This force will be scaled
35  /// by the timestep & optionally by the mass.
36  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,
42  UT_Vector3 &torque) const override;
43 
45  const override;
46 
47  /// Calculates the impulse on a surface.
48  /// This function simply calls getForceSubclass(), ignoring the circle
49  /// parameters.
50  void getForceOnCircleSubclass(const SIM_Object &object,
51  const UT_Vector3 &position,
52  const UT_Vector3 &normal,
53  const fpreal radius,
54  const UT_Vector3 &velocity,
55  const UT_Vector3 &angvel,
56  const fpreal mass,
57  UT_Vector3 &force,
58  UT_Vector3 &torque) const override;
59  /// Calculates the impulse on a volume.
60  /// This function simply calls getForceSubclass(), ignoring the sphere
61  /// parameters.
62  void getForceOnSphereSubclass(const SIM_Object &object,
63  const UT_Vector3 &position,
64  const fpreal radius,
65  const UT_Vector3 &velocity,
66  const UT_Vector3 &angvel,
67  const fpreal mass,
68  UT_Vector3 &force,
69  UT_Vector3 &torque) const override;
70 
72 
73 private:
74  static const SIM_DopDescription *getForceVelImpulseDopDescription();
75 
78  SIM_Force,
79  "Velocity Impulse Force",
80  getForceVelImpulseDopDescription());
81 };
82 
83 #endif
84 
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
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_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 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
virtual SIM_ForceResolver * getForceResolverSubclass(const SIM_Object &object) const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
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