HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_Motion.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_Motion_h__
9 #define __SIM_Motion_h__
10 
11 #include "SIM_API.h"
12 #include <UT/UT_Vector3.h>
13 #include <UT/UT_Quaternion.h>
14 #include <UT/UT_Matrix4.h>
15 #include "SIM_PositionSimple.h"
16 
17 /// This is the default implementation for standard motion data.
19 {
20 public:
21  /// Control the linear velocity attribute of this data.
23  /// Control the angular velocity attribute of this data.
24  /// This is specified in degrees per second.
25  GETSET_DATA_FUNCS_V3(SIM_NAME_ANGVELOCITY, AngularVelocityDegrees);
26 
27  /// These are the access functions that transform our values in
28  /// radians that we use internally everywhere into the actual data
29  /// values that are stored in degrees.
31  {
32  UT_Vector3 deg;
33  deg = value;
34  deg.radToDeg();
35  setAngularVelocityDegrees(deg);
36  }
37 
39  {
40  UT_Vector3 rad;
41 
42  rad = getAngularVelocityDegrees();
43  rad.degToRad();
44  return rad;
45  }
46 
47  /// Gets the motion of a point that is offset from our centre of motion.
48  const UT_Vector3 getVelocityAtPosition(const UT_Vector3 &pos,
49  fpreal integrateovertime = 0.0) const;
50 
51  /// Gets the motion of a point that is offset from the centre of motion,
52  /// using the given pivot and velocity.
53  static UT_Vector3 getVelocityAtPosition(const UT_Vector3 &location,
54  const UT_Vector3 &velocity, const UT_Vector3 &angvel,
55  const UT_Vector3 &position, const UT_Vector3 &pivot,
56  fpreal integrateovertime = 0.0);
57 
58  /// Determines the maximum velocity inside a sphere of the given
59  /// radius.
60  const UT_Vector3 getMaximumVelocity(fpreal radius) const;
61 
62 protected:
63  explicit SIM_Motion(const SIM_DataFactory *factory);
64  ~SIM_Motion() override;
65 
66 private:
67  static const SIM_DopDescription *getMotionDopDescription();
68 
72  "Motion",
73  getMotionDopDescription());
74 };
75 
76 #endif
77 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void radToDeg()
conversion between degrees and radians
GETSET_DATA_FUNCS_V3(SIM_NAME_POSITION, Position)
Control the translation attribute of the position.
#define SIM_NAME_ANGVELOCITY
Definition: SIM_Names.h:72
void degToRad()
conversion between degrees and radians
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
const UT_Vector3 getAngularVelocity() const
Definition: SIM_Motion.h:38
This is the default implementation for standard motion data.
Definition: SIM_Motion.h:18
GLint location
Definition: glcorearb.h:805
void setAngularVelocity(const UT_Vector3 &value)
Definition: SIM_Motion.h:30
fpreal64 fpreal
Definition: SYS_Types.h:277
SIM_API const UT_StringHolder position
#define SIM_API
Definition: SIM_API.h:12
GA_API const UT_StringHolder pivot
Definition: core.h:1131
#define SIM_NAME_VELOCITY
Definition: SIM_Names.h:214