ksys/phys: Implement world/shape casting RayCast functions

This commit is contained in:
Léo Lam 2022-03-19 18:57:46 +01:00
parent 9b45b05302
commit 12505b6379
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
5 changed files with 215 additions and 56 deletions

View File

@ -84025,25 +84025,25 @@ Address,Quality,Size,Name
0x0000007100fc37bc,O,000136,_ZNK4ksys4phys7RayCast14isLayerEnabledENS0_12ContactLayerE 0x0000007100fc37bc,O,000136,_ZNK4ksys4phys7RayCast14isLayerEnabledENS0_12ContactLayerE
0x0000007100fc3844,O,000008,_ZN4ksys4phys7RayCast12setGroundHitENS0_9GroundHitE 0x0000007100fc3844,O,000008,_ZN4ksys4phys7RayCast12setGroundHitENS0_9GroundHitE
0x0000007100fc384c,O,000008,_ZNK4ksys4phys7RayCast12getGroundHitEv 0x0000007100fc384c,O,000008,_ZNK4ksys4phys7RayCast12getGroundHitEv
0x0000007100fc3854,O,000008,_ZN4ksys4phys7RayCast5setD8Ei 0x0000007100fc3854,O,000008,_ZN4ksys4phys7RayCast19setIgnoredGroundHitENS0_9GroundHitE
0x0000007100fc385c,O,000012,_ZN4ksys4phys7RayCast5set9AEb 0x0000007100fc385c,O,000012,_ZN4ksys4phys7RayCast5set9AEb
0x0000007100fc3868,O,000028,_ZN4ksys4phys7RayCast8setStartERKN4sead7Vector3IfEE 0x0000007100fc3868,O,000028,_ZN4ksys4phys7RayCast8setStartERKN4sead7Vector3IfEE
0x0000007100fc3884,O,000028,_ZN4ksys4phys7RayCast6setEndERKN4sead7Vector3IfEE 0x0000007100fc3884,O,000028,_ZN4ksys4phys7RayCast6setEndERKN4sead7Vector3IfEE
0x0000007100fc38a0,O,000052,_ZN4ksys4phys7RayCast14setStartAndEndERKN4sead7Vector3IfEES6_ 0x0000007100fc38a0,O,000052,_ZN4ksys4phys7RayCast14setStartAndEndERKN4sead7Vector3IfEES6_
0x0000007100fc38d4,O,000064,_ZN4ksys4phys7RayCast23setStartAndDisplacementERKN4sead7Vector3IfEES6_ 0x0000007100fc38d4,O,000064,_ZN4ksys4phys7RayCast23setStartAndDisplacementERKN4sead7Vector3IfEES6_
0x0000007100fc3914,O,000076,_ZN4ksys4phys7RayCast29setStartAndDisplacementScaledERKN4sead7Vector3IfEES6_f 0x0000007100fc3914,O,000076,_ZN4ksys4phys7RayCast29setStartAndDisplacementScaledERKN4sead7Vector3IfEES6_f
0x0000007100fc3960,O,000064,_ZN4ksys4phys7RayCast15addGroupHandlerEPNS0_18SystemGroupHandlerE 0x0000007100fc3960,O,000064,_ZN4ksys4phys7RayCast15addIgnoredGroupEPNS0_18SystemGroupHandlerE
0x0000007100fc39a0,O,000020,_ZN4ksys4phys7RayCast12setRigidBodyEPNS0_9RigidBodyE 0x0000007100fc39a0,O,000020,_ZN4ksys4phys7RayCast12setRigidBodyEPNS0_9RigidBodyE
0x0000007100fc39b4,U,000360,phys::RayCast::worldRayCast 0x0000007100fc39b4,O,000360,_ZN4ksys4phys7RayCast12worldRayCastENS0_16ContactLayerTypeE
0x0000007100fc3b1c,U,000648,phys::RayCast::worldRayCastImpl 0x0000007100fc3b1c,O,000648,_ZN4ksys4phys7RayCast16worldRayCastImplEP21hkpWorldRayCastOutputNS0_16ContactLayerTypeE
0x0000007100fc3da4,U,000360,phys::RayCast::shapeRayCast 0x0000007100fc3da4,O,000360,_ZN4ksys4phys7RayCast12shapeRayCastEPNS0_9RigidBodyE
0x0000007100fc3f0c,U,000828,phys::RayCast::shapeRayCastImpl 0x0000007100fc3f0c,O,000828,_ZN4ksys4phys7RayCast16shapeRayCastImplEP21hkpWorldRayCastOutputPNS0_9RigidBodyE
0x0000007100fc4248,U,000360,phys::RayCast::phantomRayCast 0x0000007100fc4248,U,000360,phys::RayCast::phantomRayCast
0x0000007100fc43b0,U,000640,phys::RaycastQuery::phantomRayCastImpl 0x0000007100fc43b0,U,000640,phys::RaycastQuery::phantomRayCastImpl
0x0000007100fc4630,U,000236,phys::RaycastQuery::staticCompoundStuff 0x0000007100fc4630,U,000236,phys::RaycastQuery::staticCompoundStuff
0x0000007100fc471c,O,000072,_ZNK4ksys4phys7RayCast14getHitPositionEPN4sead7Vector3IfEE 0x0000007100fc471c,O,000072,_ZNK4ksys4phys7RayCast14getHitPositionEPN4sead7Vector3IfEE
0x0000007100fc4764,U,000268,phys::RaycastQuery::x_2 0x0000007100fc4764,U,000268,phys::RaycastQuery::x_2
0x0000007100fc4870,O,000028,_ZNK4ksys4phys7RayCast5get34EPN4sead7Vector3IfEE 0x0000007100fc4870,O,000028,_ZNK4ksys4phys7RayCast12getHitNormalEPN4sead7Vector3IfEE
0x0000007100fc488c,U,000840,phys::RaycastQuery::x_0 0x0000007100fc488c,U,000840,phys::RaycastQuery::x_0
0x0000007100fc4bd4,U,000032,phys::RaycastQuery::x_1 0x0000007100fc4bd4,U,000032,phys::RaycastQuery::x_1
0x0000007100fc4bf4,O,000004,_ZN4ksys4phys15RayHitCollectorD1Ev 0x0000007100fc4bf4,O,000004,_ZN4ksys4phys15RayHitCollectorD1Ev
@ -84054,7 +84054,7 @@ Address,Quality,Size,Name
0x0000007100fc503c,O,000476,_ZNK4ksys4phys29NormalCheckingRayHitCollector11checkNormalERK9hkpCdBodyRK30hkpShapeRayCastCollectorOutput 0x0000007100fc503c,O,000476,_ZNK4ksys4phys29NormalCheckingRayHitCollector11checkNormalERK9hkpCdBodyRK30hkpShapeRayCastCollectorOutput
0x0000007100fc5218,O,000112,_ZNK4ksys4phys7RayCast27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE 0x0000007100fc5218,O,000112,_ZNK4ksys4phys7RayCast27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x0000007100fc5288,O,000092,_ZNK4ksys4phys7RayCast18getRuntimeTypeInfoEv 0x0000007100fc5288,O,000092,_ZNK4ksys4phys7RayCast18getRuntimeTypeInfoEv
0x0000007100fc52e4,U,000004,phys::RayCast::m4 0x0000007100fc52e4,O,000004,_ZN4ksys4phys7RayCast14onRigidBodyHitEPNS0_9RigidBodyE
0x0000007100fc52e8,U,000056,phys::RayCastDerived::ctor 0x0000007100fc52e8,U,000056,phys::RayCastDerived::ctor
0x0000007100fc5320,U,000004,phys::RayCastDerived::dtor 0x0000007100fc5320,U,000004,phys::RayCastDerived::dtor
0x0000007100fc5324,U,000036,phys::RayCastDerived::dtord 0x0000007100fc5324,U,000036,phys::RayCastDerived::dtord

Can't render this file because it is too large.

@ -1 +1 @@
Subproject commit 7e8caf7567dd4aa218a8c3ab979fd428a322661f Subproject commit fa370e87acb11df1805de89078b0bf9007b616e8

View File

@ -6,8 +6,12 @@
#include <Havok/Physics2012/Collide/Query/CastUtil/hkpWorldRayCastOutput.h> #include <Havok/Physics2012/Collide/Query/CastUtil/hkpWorldRayCastOutput.h>
#include <Havok/Physics2012/Collide/Query/hkpRayHitCollector.h> #include <Havok/Physics2012/Collide/Query/hkpRayHitCollector.h>
#include <Havok/Physics2012/Collide/Shape/Convex/Triangle/hkpTriangleShape.h> #include <Havok/Physics2012/Collide/Shape/Convex/Triangle/hkpTriangleShape.h>
#include <Havok/Physics2012/Collide/Shape/Query/hkpShapeRayCastInput.h>
#include <Havok/Physics2012/Dynamics/Entity/hkpRigidBody.h>
#include <Havok/Physics2012/Dynamics/World/hkpWorld.h> #include <Havok/Physics2012/Dynamics/World/hkpWorld.h>
#include <Havok/Physics2012/Internal/Collide/StaticCompound/hkpStaticCompoundShape.h> #include <Havok/Physics2012/Internal/Collide/StaticCompound/hkpStaticCompoundShape.h>
#include <prim/seadScopeGuard.h>
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
#include "KingSystem/Physics/System/physEntityContactListener.h" #include "KingSystem/Physics/System/physEntityContactListener.h"
#include "KingSystem/Physics/System/physGroupFilter.h" #include "KingSystem/Physics/System/physGroupFilter.h"
#include "KingSystem/Physics/System/physSystem.h" #include "KingSystem/Physics/System/physSystem.h"
@ -47,12 +51,12 @@ class NormalCheckingRayHitCollector : public RayHitCollector {
public: public:
HK_DECLARE_CLASS_ALLOCATOR(NormalCheckingRayHitCollector) HK_DECLARE_CLASS_ALLOCATOR(NormalCheckingRayHitCollector)
NormalCheckingRayHitCollector(hkpWorldRayCastOutput* output, ContactLayerType layer_type, NormalCheckingRayHitCollector(hkpWorldRayCastOutput* output, const sead::Vector3f& ray_line,
RayCast::NormalCheckingMode mode, ContactLayerType layer_type,
const sead::PtrArray<SystemGroupHandler>* ignored_groups, const sead::PtrArray<SystemGroupHandler>* ignored_groups,
GroundHit ignored_ground_hit, const sead::Vector3f* ray_line, GroundHit ignored_ground_hit)
RayCast::NormalCheckingMode mode)
: RayHitCollector(output, layer_type, ignored_groups, ignored_ground_hit), : RayHitCollector(output, layer_type, ignored_groups, ignored_ground_hit),
mRayLine(ray_line), mMode(mode) {} mRayLine(&ray_line), mMode(mode) {}
~NormalCheckingRayHitCollector() override; ~NormalCheckingRayHitCollector() override;
@ -77,7 +81,7 @@ void RayCast::reset() {
mTo = sead::Vector3f::zero; mTo = sead::Vector3f::zero;
mFrom = sead::Vector3f::zero; mFrom = sead::Vector3f::zero;
mLayerMasks = {}; mLayerMasks = {};
mExtraGroupHandlers.clear(); mIgnoredGroups.clear();
resetCastResult(); resetCastResult();
} }
@ -85,12 +89,12 @@ void RayCast::reset() {
void RayCast::resetCastResult() { void RayCast::resetCastResult() {
static_cast<void>(_98.load()); static_cast<void>(_98.load());
_30 = {}; mHasHit = false;
_34 = sead::Vector3f::zero; mHitNormal = sead::Vector3f::zero;
mHitFraction = -1.0; mHitFraction = -1.0;
_48 = {}; mHitCollidable = {};
_50 = {}; mHitShapeKey = {};
_54 = {}; mHasHitSpecifiedRigidBody = false;
_58 = {}; _58 = {};
_60 = {}; _60 = {};
_70 = {}; _70 = {};
@ -146,8 +150,8 @@ GroundHit RayCast::getGroundHit() const {
return mGroundHit; return mGroundHit;
} }
void RayCast::setD8(int value) { void RayCast::setIgnoredGroundHit(GroundHit ground_hit) {
_d8 = value; mIgnoredGroundHit = ground_hit;
} }
void RayCast::set9A(bool value) { void RayCast::set9A(bool value) {
@ -180,11 +184,11 @@ void RayCast::setStartAndDisplacementScaled(const sead::Vector3f& start,
setEnd(start + displacement * displacement_scale); setEnd(start + displacement * displacement_scale);
} }
bool RayCast::addGroupHandler(SystemGroupHandler* group_handler) { bool RayCast::addIgnoredGroup(SystemGroupHandler* group_handler) {
if (mExtraGroupHandlers.size() == mExtraGroupHandlers.capacity() || group_handler == nullptr) if (mIgnoredGroups.size() == mIgnoredGroups.capacity() || group_handler == nullptr)
return false; return false;
mExtraGroupHandlers.pushBack(group_handler); mIgnoredGroups.pushBack(group_handler);
return true; return true;
} }
@ -193,12 +197,154 @@ void RayCast::setRigidBody(RigidBody* body) {
mRigidBody = body; mRigidBody = body;
} }
void RayCast::getHitPosition(sead::Vector3f* out) const { void RayCast::fillCastInput(hkpWorldRayCastInput& input, ContactLayerType layer_type) {
*out = ((1 - mHitFraction) * mFrom) + (mHitFraction * mTo); const u32 layer_mask = getLayerMask(layer_type);
input.m_enableShapeCollectionFilter = true;
input.m_filterInfo = getFilterInfo(layer_type, layer_mask);
input.m_from = toHkVec4(mFrom);
input.m_to = toHkVec4(mTo);
} }
void RayCast::get34(sead::Vector3f* out) const { void RayCast::fillCastInput(hkpShapeRayCastInput& input, ContactLayerType layer_type) {
*out = _34; input.m_filterInfo = getFilterInfo(layer_type, getLayerMask(layer_type));
}
u32 RayCast::getFilterInfo(ContactLayerType layer_type, u32 layer_mask) const {
if (mGroupHandler != nullptr) {
return mGroupHandler->makeQueryCollisionMask(layer_mask, mGroundHit, _9a);
} else {
auto* filter = System::instance()->getGroupFilter(layer_type);
auto info = filter->makeQueryCollisionMask(layer_mask, mGroundHit, _9a);
#ifdef MATCHING_HACK_NX_CLANG
asm("");
#endif
return info;
}
}
void RayCast::preCast() {
if (_70 == 1)
resetCastResult();
_98 = true;
}
bool RayCast::postCast(const hkpWorldRayCastOutput& output) {
mHasHit = output.hasHit();
if (mHasHit) {
updateHitInformation(output);
getActorInfoMaybe(output);
}
_98 = false;
_70 = 1;
return mHasHit;
}
void RayCast::updateHitInformation(const hkpWorldRayCastOutput& output) {
storeToVec3(&mHitNormal, output.m_normal);
mHitFraction = output.m_hitFraction;
mHitCollidable = output.m_rootCollidable;
mHitShapeKey = output.m_shapeKeys[0];
auto* hit_body = getRigidBody(*mHitCollidable);
if (hit_body) {
if (mRigidBody != nullptr && hit_body == mRigidBody)
mHasHitSpecifiedRigidBody = true;
onRigidBodyHit(hit_body);
if (mRigidBodyHitCallback)
mRigidBodyHitCallback->invoke(hit_body);
}
}
bool RayCast::worldRayCast(ContactLayerType layer_type) {
hkpWorldRayCastOutput output;
preCast();
worldRayCastImpl(&output, layer_type);
return postCast(output);
}
void RayCast::worldRayCastImpl(hkpWorldRayCastOutput* output, ContactLayerType layer_type) {
hkpWorldRayCastInput input;
fillCastInput(input, layer_type);
System::instance()->lockWorld(layer_type, "raycast", 0, OnlyLockIfNeeded::Yes);
auto world_guard = sead::makeScopeGuard(
[&] { System::instance()->unlockWorld(layer_type, "raycast", 0, OnlyLockIfNeeded::Yes); });
if (mNormalCheckingMode == NormalCheckingMode::DoNotCheck) {
if (mIgnoredGroups.size() > 0 || int(mIgnoredGroundHit) != GroundHit::Ignore) {
RayHitCollector collector{output, layer_type,
mIgnoredGroups.size() > 0 ? &mIgnoredGroups : nullptr,
mIgnoredGroundHit};
System::instance()->getHavokWorld(layer_type)->castRay(input, collector);
} else {
System::instance()->getHavokWorld(layer_type)->castRay(input, *output);
}
} else {
sead::Vector3f ray_line = mTo - mFrom;
ray_line.normalize();
auto* groups = mIgnoredGroups.size() > 0 ? &mIgnoredGroups : nullptr;
NormalCheckingRayHitCollector collector(output, ray_line, mNormalCheckingMode, layer_type,
groups, mIgnoredGroundHit);
System::instance()->getHavokWorld(layer_type)->castRay(input, collector);
}
}
bool RayCast::shapeRayCast(RigidBody* rigid_body) {
hkpWorldRayCastOutput output;
preCast();
shapeRayCastImpl(&output, rigid_body);
return postCast(output);
}
void RayCast::shapeRayCastImpl(hkpWorldRayCastOutput* output, RigidBody* body) {
hkpShapeRayCastInput input;
auto layer_type = body->getLayerType();
fillCastInput(input, layer_type);
sead::Matrix34f transform;
body->getTransform(&transform);
transform.invert();
const auto from = transform * mFrom;
const auto to = transform * mTo;
input.m_from = toHkVec4(from);
input.m_to = toHkVec4(to);
System::instance()->incrementWorldUnkCounter(ContactLayerType::Entity);
auto world_guard = sead::makeScopeGuard(
[&] { System::instance()->decrementWorldUnkCounter(ContactLayerType::Entity); });
auto* collidable = body->getHkBody()->getCollidable();
if (mNormalCheckingMode == NormalCheckingMode::DoNotCheck) {
if (mIgnoredGroups.size() > 0 || int(mIgnoredGroundHit) != GroundHit::Ignore) {
RayHitCollector collector{output, layer_type,
mIgnoredGroups.size() > 0 ? &mIgnoredGroups : nullptr,
mIgnoredGroundHit};
collidable->getShape()->castRayWithCollector(input, *collidable, collector);
} else {
collidable->getShape()->castRay(input, *output);
}
} else {
sead::Vector3f ray_line = mTo - mFrom;
ray_line.normalize();
auto* groups = mIgnoredGroups.size() > 0 ? &mIgnoredGroups : nullptr;
NormalCheckingRayHitCollector collector(output, ray_line, mNormalCheckingMode, layer_type,
groups, mIgnoredGroundHit);
collidable->getShape()->castRayWithCollector(input, *collidable, collector);
}
}
void RayCast::getHitPosition(sead::Vector3f* position) const {
*position = ((1 - mHitFraction) * mFrom) + (mHitFraction * mTo);
}
void RayCast::getHitNormal(sead::Vector3f* normal) const {
*normal = mHitNormal;
} }
RayHitCollector::~RayHitCollector() = default; RayHitCollector::~RayHitCollector() = default;

View File

@ -9,6 +9,12 @@
#include "KingSystem/Physics/physDefines.h" #include "KingSystem/Physics/physDefines.h"
#include "KingSystem/Physics/physMaterialMask.h" #include "KingSystem/Physics/physMaterialMask.h"
class hkpCollidable;
struct hkpShapeRayCastInput;
struct hkpShapeRayCastOutput;
struct hkpWorldRayCastInput;
struct hkpWorldRayCastOutput;
namespace ksys::phys { namespace ksys::phys {
struct ActorInfo; struct ActorInfo;
@ -25,13 +31,12 @@ public:
DoNotCheck = 2, DoNotCheck = 2,
}; };
// TODO: what kind of callback is this? using RigidBodyHitCallback = sead::IDelegate1<phys::RigidBody*>;
using Callback = sead::IDelegate1<phys::RigidBody*>;
RayCast(SystemGroupHandler* group_handler, GroundHit ground_hit); RayCast(SystemGroupHandler* group_handler, GroundHit ground_hit);
virtual ~RayCast(); virtual ~RayCast();
virtual void m4(void*) {} virtual void onRigidBodyHit(RigidBody* body) {}
void reset(); void reset();
void resetCastResult(); void resetCastResult();
@ -44,8 +49,8 @@ public:
void setGroundHit(GroundHit ground_hit); void setGroundHit(GroundHit ground_hit);
GroundHit getGroundHit() const; GroundHit getGroundHit() const;
void setIgnoredGroundHit(GroundHit ground_hit);
// TODO: rename // TODO: rename
void setD8(int value);
void set9A(bool value); void set9A(bool value);
void setStart(const sead::Vector3f& start); void setStart(const sead::Vector3f& start);
@ -56,22 +61,20 @@ public:
const sead::Vector3f& displacement, const sead::Vector3f& displacement,
float displacement_scale); float displacement_scale);
bool addGroupHandler(SystemGroupHandler* group_handler); /// @warning Only up to 4 groups can be ignored.
bool addIgnoredGroup(SystemGroupHandler* group_handler);
void setRigidBody(RigidBody* body); void setRigidBody(RigidBody* body);
void setCallback(Callback* callback) { mCallback = callback; } void setCallback(RigidBodyHitCallback* callback) { mRigidBodyHitCallback = callback; }
Callback* getCallback() const { return mCallback; } RigidBodyHitCallback* getCallback() const { return mRigidBodyHitCallback; }
// 0x0000007100fc39b4
bool worldRayCast(ContactLayerType layer_type); bool worldRayCast(ContactLayerType layer_type);
// 0x0000007100fc3da4
bool shapeRayCast(RigidBody* rigid_body); bool shapeRayCast(RigidBody* rigid_body);
// 0x0000007100fc4248 // 0x0000007100fc4248
bool phantomRayCast(void* unk); bool phantomRayCast(void* unk);
void getHitPosition(sead::Vector3f* out) const; void getHitPosition(sead::Vector3f* position) const;
// TODO: rename void getHitNormal(sead::Vector3f* normal) const;
void get34(sead::Vector3f* out) const;
// TODO: rename // TODO: rename
// 0x0000007100fc4844 // 0x0000007100fc4844
void getUnkVectors(sead::Vector3f* unk1, sead::Vector3f* unk2, void* unk3) const; void getUnkVectors(sead::Vector3f* unk1, sead::Vector3f* unk2, void* unk3) const;
@ -79,34 +82,40 @@ public:
// 0x0000007100fc4bd4 // 0x0000007100fc4bd4
bool x_1(sead::Vector3f* out) const; bool x_1(sead::Vector3f* out) const;
private: protected:
auto& getLayerMask(ContactLayerType type) { return mLayerMasks[int(type)]; } auto& getLayerMask(ContactLayerType type) { return mLayerMasks[int(type)]; }
auto& getLayerMask(ContactLayerType type) const { return mLayerMasks[int(type)]; } auto& getLayerMask(ContactLayerType type) const { return mLayerMasks[int(type)]; }
// 0x0000007100fc3b1c void worldRayCastImpl(hkpWorldRayCastOutput* output, ContactLayerType layer_type);
void worldRayCastImpl(void* arg, ContactLayerType layer_type); void shapeRayCastImpl(hkpWorldRayCastOutput* output, RigidBody* body);
// 0x0000007100fc3f0c
void shapeRayCastImpl(void* arg, RigidBody* rigid_body);
// 0x0000007100fc43b0 // 0x0000007100fc43b0
void phantomRayCastImpl(void* unk); void phantomRayCastImpl(hkpWorldRayCastOutput* output);
// 0x0000007100fc4630 // 0x0000007100fc4630
const ActorInfo* getActorInfoMaybe(void* unk); const ActorInfo* getActorInfoMaybe(const hkpShapeRayCastOutput& output);
// 0x0000007100fc4764 // 0x0000007100fc4764
bool x_2(sead::Vector3f* out, void* unk1, int unk2) const; bool x_2(sead::Vector3f* out, void* unk1, int unk2) const;
void fillCastInput(hkpWorldRayCastInput& input, ContactLayerType layer_type);
void fillCastInput(hkpShapeRayCastInput& input, ContactLayerType layer_type);
u32 getFilterInfo(ContactLayerType layer_type, u32 layer_mask) const;
void preCast();
bool postCast(const hkpWorldRayCastOutput& output);
void updateHitInformation(const hkpWorldRayCastOutput& output);
sead::Vector3f mFrom = sead::Vector3f::zero; sead::Vector3f mFrom = sead::Vector3f::zero;
sead::Vector3f mTo = sead::Vector3f::zero; sead::Vector3f mTo = sead::Vector3f::zero;
SystemGroupHandler* mGroupHandler{}; SystemGroupHandler* mGroupHandler{};
GroundHit mGroundHit{}; GroundHit mGroundHit{};
u32 _2c; u32 _2c;
bool _30; bool mHasHit;
sead::Vector3f _34; sead::Vector3f mHitNormal;
float mHitFraction; float mHitFraction;
void* _48; const hkpCollidable* mHitCollidable;
u32 _50; u32 mHitShapeKey;
bool _54; bool mHasHitSpecifiedRigidBody;
void* _58{}; void* _58{};
void* _60; void* _60;
sead::SafeArray<sead::BitFlag32, NumContactLayerTypes> mLayerMasks{}; sead::SafeArray<sead::BitFlag32, NumContactLayerTypes> mLayerMasks{};
@ -117,10 +126,9 @@ private:
sead::Atomic<bool> _98; sead::Atomic<bool> _98;
bool _99{}; bool _99{};
bool _9a{}; bool _9a{};
sead::FixedPtrArray<SystemGroupHandler, 4> mExtraGroupHandlers; sead::FixedPtrArray<SystemGroupHandler, 4> mIgnoredGroups;
// TODO: rename once we figure out what kind of callback this is RigidBodyHitCallback* mRigidBodyHitCallback{};
Callback* mCallback{}; GroundHit mIgnoredGroundHit = GroundHit::Ignore;
u32 _d8 = 0x10;
}; };
} // namespace ksys::phys } // namespace ksys::phys

View File

@ -102,6 +102,11 @@ public:
// 0x0000007101216814 // 0x0000007101216814
bool getEntityContactListenerField91() const; bool getEntityContactListenerField91() const;
// 0x000000710121682c
void incrementWorldUnkCounter(ContactLayerType layer_type);
// 0x000000710121684c
void decrementWorldUnkCounter(ContactLayerType layer_type);
// 0x0000007101216cec // 0x0000007101216cec
sead::Heap* getPhysicsTempHeap(LowPriority low_priority) const; sead::Heap* getPhysicsTempHeap(LowPriority low_priority) const;