CommonLibSSE (powerof3)
hkpMotion.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/H/hkBaseTypes.h"
4 #include "RE/H/hkMotionState.h"
6 #include "RE/H/hkVector4.h"
7 
8 namespace RE
9 {
10  class hkMatrix3;
11  class hkQuaternion;
12  class hkTransform;
13  class hkpMaxSizeMotion;
14 
16  {
17  public:
18  inline static constexpr auto RTTI = RTTI_hkpMotion;
19 
20  enum
21  {
23  };
24 
25  enum class MotionType
26  {
27  kInvalid,
28  kDynamic,
31  kKeyframed,
32  kFixed,
34  kCharacter,
35 
36  kTotal
37  };
38 
39  ~hkpMotion() override; // 00
40 
41  // add
42  virtual void SetMass(float a_mass); // 03 - { SetMassInv(a_mass); }
43  virtual void SetMassInv(float a_massInv); // 04 - { inertiaAndMassInv.quad.m128_f32[3] = a_massInv; }
44  virtual void GetInertiaLocal(hkMatrix3& a_inertiaOut) const = 0; // 05
45  virtual void GetInertiaWorld(hkMatrix3& a_inertiaOut) const = 0; // 06
46  virtual void SetInertiaLocal(const hkMatrix3& a_inertia) = 0; // 07
47  virtual void SetInertiaInvLocal(const hkMatrix3& a_inertiaInv) = 0; // 08
48  virtual void GetInertiaInvLocal(hkMatrix3& a_inertiaInvOut) const = 0; // 09
49  virtual void GetInertiaInvWorld(hkMatrix3& a_inertiaInvOut) const = 0; // 0A
50  virtual void SetCenterOfMassInLocal(const hkVector4& a_centerOfMass); // 0B
51  virtual void SetPosition(const hkVector4& a_position); // 0C
52  virtual void SetRotation(const hkQuaternion& a_rotation); // 0D
53  virtual void SetPositionAndRotation(const hkVector4& a_position, const hkQuaternion& a_rotation); // 0E
54  virtual void SetTransform(const hkTransform& a_transform); // 0F
55  virtual void SetLinearVelocity(const hkVector4& a_newVel); // 10 - { linearVelocity = a_newVel; }
56  virtual void SetAngularVelocity(const hkVector4& a_newVel); // 11 - { angularVelocity = a_newVel; }
57  virtual void GetProjectedPointVelocity(const hkVector4& a_point, const hkVector4& a_normal, float& a_velOut, float& a_invVirtMassOut) const = 0; // 12
58  virtual void ApplyLinearImpulse(const hkVector4& a_impulse); // 13
59  virtual void ApplyPointImpulse(const hkVector4& a_impulse, const hkVector4& a_point) = 0; // 14
60  virtual void ApplyAngularImpulse(const hkVector4& a_impulse) = 0; // 15
61  virtual void ApplyForce(const float a_deltaTime, const hkVector4& a_force) = 0; // 16
62  virtual void ApplyForce(const float a_deltaTime, const hkVector4& a_force, const hkVector4& a_point) = 0; // 17
63  virtual void ApplyTorque(const float a_deltaTime, const hkVector4& a_torque) = 0; // 18
65 
66  // members
68  std::uint8_t deactivationIntegrateCounter; // 011
69  std::uint16_t deactivationNumInactiveFrames[2]; // 012
70  std::uint16_t pad016; // 016
71  std::uint64_t pad018; // 018
77  std::uint32_t deactivationRefOrientation[2]; // 120
79  std::uint16_t savedQualityTypeIndex; // 130
80  std::uint16_t pad132; // 132
82  std::uint64_t pad138; // 138
83  };
84  static_assert(sizeof(hkpMotion) == 0x140);
85 }
Definition: hkBaseTypes.h:16
Definition: hkMatrix3.h:8
Definition: hkMotionState.h:11
Definition: hkQuaternion.h:8
Definition: hkReferencedObject.h:11
Definition: hkTransform.h:9
Definition: hkVector4.h:8
Definition: hkpKeyframedRigidMotion.h:40
Definition: hkpMotion.h:16
std::uint8_t deactivationIntegrateCounter
Definition: hkpMotion.h:68
stl::enumeration< MotionType, std::uint8_t > type
Definition: hkpMotion.h:67
virtual void GetInertiaInvWorld(hkMatrix3 &a_inertiaInvOut) const =0
virtual void GetInertiaLocal(hkMatrix3 &a_inertiaOut) const =0
~hkpMotion() override
std::uint64_t pad138
Definition: hkpMotion.h:82
virtual void ApplyAngularImpulse(const hkVector4 &a_impulse)=0
virtual void SetAngularVelocity(const hkVector4 &a_newVel)
virtual void SetInertiaInvLocal(const hkMatrix3 &a_inertiaInv)=0
hkVector4 angularVelocity
Definition: hkpMotion.h:75
virtual void ApplyLinearImpulse(const hkVector4 &a_impulse)
virtual void SetPosition(const hkVector4 &a_position)
virtual void SetRotation(const hkQuaternion &a_rotation)
std::uint16_t pad016
Definition: hkpMotion.h:70
std::uint16_t deactivationNumInactiveFrames[2]
Definition: hkpMotion.h:69
virtual void GetMotionStateAndVelocitiesAndDeactivationType(hkpMotion *a_motionOut)
std::uint64_t pad018
Definition: hkpMotion.h:71
@ kNumInactiveFramesToDeactivate
Definition: hkpMotion.h:22
virtual void SetCenterOfMassInLocal(const hkVector4 &a_centerOfMass)
virtual void GetInertiaWorld(hkMatrix3 &a_inertiaOut) const =0
virtual void SetMassInv(float a_massInv)
virtual void GetProjectedPointVelocity(const hkVector4 &a_point, const hkVector4 &a_normal, float &a_velOut, float &a_invVirtMassOut) const =0
virtual void SetPositionAndRotation(const hkVector4 &a_position, const hkQuaternion &a_rotation)
virtual void SetTransform(const hkTransform &a_transform)
static constexpr auto RTTI
Definition: hkpMotion.h:18
virtual void ApplyPointImpulse(const hkVector4 &a_impulse, const hkVector4 &a_point)=0
virtual void ApplyTorque(const float a_deltaTime, const hkVector4 &a_torque)=0
virtual void ApplyForce(const float a_deltaTime, const hkVector4 &a_force)=0
virtual void ApplyForce(const float a_deltaTime, const hkVector4 &a_force, const hkVector4 &a_point)=0
hkVector4 inertiaAndMassInv
Definition: hkpMotion.h:73
virtual void SetMass(float a_mass)
hkMotionState motionState
Definition: hkpMotion.h:72
hkVector4 deactivationRefPosition[2]
Definition: hkpMotion.h:76
hkpMaxSizeMotion * mavedMotion
Definition: hkpMotion.h:78
std::uint16_t savedQualityTypeIndex
Definition: hkpMotion.h:79
MotionType
Definition: hkpMotion.h:26
virtual void GetInertiaInvLocal(hkMatrix3 &a_inertiaInvOut) const =0
hkHalf gravityFactor
Definition: hkpMotion.h:81
std::uint32_t deactivationRefOrientation[2]
Definition: hkpMotion.h:77
hkVector4 linearVelocity
Definition: hkpMotion.h:74
virtual void SetLinearVelocity(const hkVector4 &a_newVel)
virtual void SetInertiaLocal(const hkMatrix3 &a_inertia)=0
std::uint16_t pad132
Definition: hkpMotion.h:80
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_hkpMotion
Definition: Offsets_RTTI.h:7660