diff options
| author | Michael Zhao <44533763+Pistonight@users.noreply.github.com> | 2026-07-30 17:04:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-30 17:04:47 -0700 |
| commit | 4f1f92f132249b67316565ff5cb2fb4370c5c725 (patch) | |
| tree | e04ad2f15c60fa52112ab36ce63c2196bb64f861 /src/KingSystem/Physics/System/physSystem.cpp | |
| parent | 77a8d05cfff740e9a1d78d40f79f58ae2a6ab82b (diff) | |
| parent | 1e080b32ebdffedffcf2e7a5a3c002ce7bfe54f1 (diff) | |
Merge pull request #184 from RobbyV2/phys-system-contact-listeners
Match phys::System contact listener and group handler forwarders
Diffstat (limited to 'src/KingSystem/Physics/System/physSystem.cpp')
| -rw-r--r-- | src/KingSystem/Physics/System/physSystem.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physSystem.cpp b/src/KingSystem/Physics/System/physSystem.cpp index e9a1ffb5..ef55e1f1 100644 --- a/src/KingSystem/Physics/System/physSystem.cpp +++ b/src/KingSystem/Physics/System/physSystem.cpp @@ -6,10 +6,12 @@ #include "KingSystem/Physics/RigidBody/physRigidBodyResource.h" #include "KingSystem/Physics/StaticCompound/physStaticCompound.h" #include "KingSystem/Physics/SupportBone/physSupportBoneResource.h" +#include "KingSystem/Physics/System/physContactListener.h" #include "KingSystem/Physics/System/physContactMgr.h" #include "KingSystem/Physics/System/physContactPointInfo.h" #include "KingSystem/Physics/System/physEntityGroupFilter.h" #include "KingSystem/Physics/System/physGroupFilter.h" +#include "KingSystem/Physics/System/physLayerContactPointInfo.h" #include "KingSystem/Physics/System/physMaterialTable.h" #include "KingSystem/Physics/System/physRayCastRequestMgr.h" #include "KingSystem/Physics/System/physSensorGroupFilter.h" @@ -53,6 +55,10 @@ void System::initSystemData(sead::Heap* heap) { mContactMgr); } +void System::removeSystemGroupHandler(SystemGroupHandler* handler) { + mGroupFilters[static_cast<s32>(handler->getLayerType())]->removeSystemGroupHandler(handler); +} + ContactPointInfo* System::allocContactPointInfo(sead::Heap* heap, int num, const sead::SafeString& name, int a, int b, int c) const { @@ -100,10 +106,27 @@ LayerContactPointInfo* System::allocLayerContactPointInfo(sead::Heap* heap, int return mContactMgr->makeLayerContactPointInfo(heap, num, num2, name, a, b, c); } +void System::freeLayerContactPointInfo(LayerContactPointInfo* info) const { + mContactListeners[static_cast<s32>(info->getLayerType())]->removeLayerPairsForContactPointInfo( + info); + mContactMgr->freeContactPointInfo(info); +} + void System::registerContactPointInfo(ContactPointInfo* info) const { mContactMgr->registerContactPointInfo(info); } +void System::registerContactPointLayerPair(LayerContactPointInfo* info, ContactLayer layer1, + ContactLayer layer2, bool enabled) { + mContactListeners[static_cast<s32>(info->getLayerType())]->addLayerPairForContactPointInfo( + info, layer1, layer2, enabled); +} + +ContactLayerCollisionInfo* System::trackLayerPair(ContactLayer layer_a, ContactLayer layer_b) { + return mContactListeners[static_cast<s32>(getContactLayerType(layer_a))]->trackLayerPair( + layer_a, layer_b); +} + RagdollControllerKeyList* System::getRagdollCtrlKeyList() const { if (!mSystemData) return nullptr; |
