mirror of
https://github.com/zeldaret/botw
synced 2026-08-22 22:35:49 -04:00
phys: match System contact listener and group handler functions
This commit is contained in:
@@ -84,6 +84,8 @@ public:
|
||||
bool registerLayerPair(ContactLayer layer1, ContactLayer layer2, bool enabled = true);
|
||||
bool isPairUnknown(ContactLayer layer1, ContactLayer layer2) const;
|
||||
|
||||
ContactLayerType getLayerType() const { return mLayerType; }
|
||||
|
||||
ContactCallback* getCallback() const { return mCallback; }
|
||||
void setCallback(ContactCallback* callback) { mCallback = callback; }
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace ksys::phys {
|
||||
class CollisionInfo;
|
||||
class ContactLayerCollisionInfo;
|
||||
class ContactLayerCollisionInfoGroup;
|
||||
class ContactListener;
|
||||
class ContactMgr;
|
||||
class ContactPointInfo;
|
||||
class GroupFilter;
|
||||
@@ -151,8 +152,7 @@ private:
|
||||
GroupFilter* mEntityGroupFilter{};
|
||||
GroupFilter* mSensorGroupFilter{};
|
||||
sead::FixedPtrArray<GroupFilter, 2> mGroupFilters;
|
||||
// FIXME: type
|
||||
sead::FixedPtrArray<void*, 2> _128;
|
||||
sead::FixedPtrArray<ContactListener, 2> mContactListeners;
|
||||
ContactMgr* mContactMgr;
|
||||
void* _150;
|
||||
StaticCompoundMgr* mStaticCompoundMgr;
|
||||
|
||||
Reference in New Issue
Block a user