From 19888cc60701b5340c1a7ed2f8a793234b99c9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 15 Jan 2022 18:21:28 +0100 Subject: [PATCH] Havok: Add hkpSphereMotion --- lib/hkStubs/CMakeLists.txt | 1 + .../Dynamics/Motion/Rigid/hkpSphereMotion.h | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 lib/hkStubs/Havok/Physics2012/Dynamics/Motion/Rigid/hkpSphereMotion.h diff --git a/lib/hkStubs/CMakeLists.txt b/lib/hkStubs/CMakeLists.txt index a53a9bfa..0c36426e 100644 --- a/lib/hkStubs/CMakeLists.txt +++ b/lib/hkStubs/CMakeLists.txt @@ -106,6 +106,7 @@ add_library(hkStubs OBJECT Havok/Physics2012/Dynamics/Motion/hkpMotion.h Havok/Physics2012/Dynamics/Motion/Rigid/hkpBoxMotion.h Havok/Physics2012/Dynamics/Motion/Rigid/hkpKeyframedRigidMotion.h + Havok/Physics2012/Dynamics/Motion/Rigid/hkpSphereMotion.h Havok/Physics2012/Dynamics/World/hkpPhysicsSystem.h Havok/Physics2012/Dynamics/World/hkpWorld.cpp Havok/Physics2012/Dynamics/World/hkpWorld.h diff --git a/lib/hkStubs/Havok/Physics2012/Dynamics/Motion/Rigid/hkpSphereMotion.h b/lib/hkStubs/Havok/Physics2012/Dynamics/Motion/Rigid/hkpSphereMotion.h new file mode 100644 index 00000000..dc75fc78 --- /dev/null +++ b/lib/hkStubs/Havok/Physics2012/Dynamics/Motion/Rigid/hkpSphereMotion.h @@ -0,0 +1,36 @@ +#pragma once + +#pragma once + +#include +#include + +class hkpSphereMotion : public hkpMotion { +public: + HK_DECLARE_CLASS_ALLOCATOR(hkpSphereMotion) + HK_DECLARE_REFLECTION() + + hkpSphereMotion(const hkVector4& position, const hkQuaternion& rotation) + : hkpMotion(position, rotation) { + m_type = MOTION_SPHERE_INERTIA; + } + + explicit hkpSphereMotion(hkFinishLoadedObjectFlag flag) : hkpMotion(flag) {} + + void getInertiaLocal(hkMatrix3& inertia) const override; + void getInertiaWorld(hkMatrix3& inertia) const override; + void setInertiaLocal(const hkMatrix3& inertia) override; + void setInertiaInvLocal(const hkMatrix3& inertiaInv) override; + void getInertiaInvLocal(hkMatrix3& inertiaInv) const override; + void getInertiaInvWorld(hkMatrix3& inertiaInv) const override; + void getProjectedPointVelocity(const hkVector4& p, const hkVector4& normal, hkReal& velOut, + hkReal& invVirtMassOut) const override; + void getProjectedPointVelocitySimd(const hkVector4& p, const hkVector4& normal, + hkSimdReal& velOut, + hkSimdReal& invVirtMassOut) const override; + void applyPointImpulse(const hkVector4& imp, const hkVector4& p) override; + void applyAngularImpulse(const hkVector4& imp) override; + void applyForce(const hkReal deltaTime, const hkVector4& force) override; + void applyForce(const hkReal deltaTime, const hkVector4& force, const hkVector4& p) override; + void applyTorque(const hkReal deltaTime, const hkVector4& torque) override; +};