diff options
| author | Léo Lam <leo@leolam.fr> | 2022-01-07 01:30:35 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2022-01-07 01:51:13 +0100 |
| commit | b4bbaf141f871352fe4eac1eb1ef9c7522ca8154 (patch) | |
| tree | bc479fde849b250f1d4a52f903e782265fa555d5 /src/KingSystem/Physics/System/physMemSystem.cpp | |
| parent | 53c5d0342027160ab9c0f7fb2f9fd44d8dd7ac1a (diff) | |
ksys/phys: Add MemSystem::initSystemData
Diffstat (limited to 'src/KingSystem/Physics/System/physMemSystem.cpp')
| -rw-r--r-- | src/KingSystem/Physics/System/physMemSystem.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physMemSystem.cpp b/src/KingSystem/Physics/System/physMemSystem.cpp index 834d6e2e..9bf4af62 100644 --- a/src/KingSystem/Physics/System/physMemSystem.cpp +++ b/src/KingSystem/Physics/System/physMemSystem.cpp @@ -1,11 +1,53 @@ #include "KingSystem/Physics/System/physMemSystem.h" +#include "KingSystem/Physics/Cloth/physClothResource.h" +#include "KingSystem/Physics/Ragdoll/physRagdollControllerKeyList.h" +#include "KingSystem/Physics/Ragdoll/physRagdollResource.h" +#include "KingSystem/Physics/RigidBody/TeraMesh/physTeraMeshRigidBodyResource.h" +#include "KingSystem/Physics/RigidBody/physRigidBodyResource.h" +#include "KingSystem/Physics/StaticCompound/physStaticCompound.h" +#include "KingSystem/Physics/SupportBone/physSupportBoneResource.h" #include "KingSystem/Physics/System/physContactMgr.h" +#include "KingSystem/Physics/System/physEntityGroupFilter.h" +#include "KingSystem/Physics/System/physMaterialTable.h" #include "KingSystem/Physics/System/physRigidContactPoints.h" +#include "KingSystem/Physics/System/physSensorGroupFilter.h" +#include "KingSystem/Physics/System/physSystemData.h" +#include "KingSystem/Resource/resEntryFactory.h" +#include "KingSystem/Resource/resSystem.h" namespace ksys::phys { SEAD_SINGLETON_DISPOSER_IMPL(MemSystem) +void MemSystem::initSystemData(sead::Heap* heap) { + res::registerEntryFactory(new (heap) res::EntryFactory<RigidBodyResource>(1.0, 0x400), "hkrb"); + res::registerEntryFactory(new (heap) res::EntryFactory<RagdollResource>(1.0, 0x400), "hkrg"); + res::registerEntryFactory(new (heap) res::EntryFactory<SupportBoneResource>(1.0, 0x100000), + "bphyssb"); + res::registerEntryFactory(new (heap) res::EntryFactory<ClothResource>(2.0, 0x2800), "hkcl"); + res::registerEntryFactory(new (heap) res::EntryFactory<StaticCompound>(1.3, 0x40000), "hksc"); + res::registerEntryFactory(new (heap) res::EntryFactory<TeraMeshRigidBodyResource>(1.0, 0x800), + "hktmrb"); + res::registerEntryFactory(new (heap) res::EntryFactory<RagdollControllerKeyList>(1.0, 0x4000), + "brgcon"); + + mEntityGroupFilter = EntityGroupFilter::make(ContactLayer::EntityObject, + ContactLayer::EntityMeshVisualizer, heap); + mSensorGroupFilter = SensorGroupFilter::make(ContactLayer::SensorCustomReceiver, heap); + mGroupFilters.pushBack(mEntityGroupFilter); + mGroupFilters.pushBack(mSensorGroupFilter); + + mContactMgr = new (heap) ContactMgr; + if (mContactMgr) + mContactMgr->init(heap); + + mMaterialTable = new (heap) MaterialTable; + + mSystemData = new (heap) SystemData; + mSystemData->load(mPhysicsSystemHeap, mEntityGroupFilter, mSensorGroupFilter, mMaterialTable, + mContactMgr); +} + RigidContactPoints* MemSystem::allocContactPoints(sead::Heap* heap, int num, const sead::SafeString& name, int a, int b, int c) const { |
