mirror of
https://github.com/zeldaret/botw
synced 2026-08-26 07:33:28 -04:00
ksys::phys::System: implement isPaused and collision/handler helpers
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
#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/physMaterialTable.h"
|
||||
#include "KingSystem/Physics/System/physRayCastRequestMgr.h"
|
||||
#include "KingSystem/Physics/System/physSensorGroupFilter.h"
|
||||
#include "KingSystem/Physics/System/physSystemData.h"
|
||||
#include "KingSystem/Resource/resEntryFactory.h"
|
||||
@@ -19,6 +21,10 @@ namespace ksys::phys {
|
||||
|
||||
SEAD_SINGLETON_DISPOSER_IMPL(System)
|
||||
|
||||
bool System::isPaused() const {
|
||||
return mPaused;
|
||||
}
|
||||
|
||||
void System::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");
|
||||
@@ -57,6 +63,37 @@ void System::freeContactPointInfo(ContactPointInfo* info) const {
|
||||
mContactMgr->freeContactPointInfo(info);
|
||||
}
|
||||
|
||||
CollisionInfo* System::allocCollisionInfo(sead::Heap* heap, const sead::SafeString& name) const {
|
||||
return mContactMgr->makeCollisionInfo(heap, name);
|
||||
}
|
||||
|
||||
void System::freeCollisionInfo(CollisionInfo* info) const {
|
||||
mContactMgr->freeCollisionInfo(info);
|
||||
}
|
||||
|
||||
ContactLayerCollisionInfoGroup*
|
||||
System::makeContactLayerCollisionInfoGroup(sead::Heap* heap, ContactLayer layer, int capacity,
|
||||
const sead::SafeString& name) {
|
||||
return mContactMgr->makeContactLayerCollisionInfoGroup(heap, layer, capacity, name);
|
||||
}
|
||||
|
||||
void System::freeContactLayerCollisionInfoGroup(ContactLayerCollisionInfoGroup* group) {
|
||||
mContactMgr->freeContactLayerCollisionInfoGroup(group);
|
||||
}
|
||||
|
||||
GroupFilter* System::getGroupFilter(ContactLayerType type) const {
|
||||
return mGroupFilters[static_cast<s32>(type)];
|
||||
}
|
||||
|
||||
RayCastForRequest* System::allocRayCastRequest(SystemGroupHandler* group_handler,
|
||||
GroundHit ground_hit) {
|
||||
return mRayCastRequestMgr->allocRequest(group_handler, ground_hit);
|
||||
}
|
||||
|
||||
SystemGroupHandler* System::addSystemGroupHandler(ContactLayerType layer_type, int free_list_idx) {
|
||||
return getGroupFilter(layer_type)->addSystemGroupHandler(free_list_idx);
|
||||
}
|
||||
|
||||
LayerContactPointInfo* System::allocLayerContactPointInfo(sead::Heap* heap, int num, int num2,
|
||||
const sead::SafeString& name, int a,
|
||||
int b, int c) const {
|
||||
|
||||
@@ -20,6 +20,7 @@ class GroupFilter;
|
||||
class LayerContactPointInfo;
|
||||
class MaterialTable;
|
||||
class RayCastForRequest;
|
||||
class RayCastRequestMgr;
|
||||
class RagdollControllerKeyList;
|
||||
class RagdollInstanceMgr;
|
||||
class RigidBody;
|
||||
@@ -135,7 +136,9 @@ public:
|
||||
sead::Heap* getPhysicsTempHeap(LowPriority low_priority) const;
|
||||
|
||||
private:
|
||||
u8 _28[0x64 - 0x28];
|
||||
u8 _28[0x60 - 0x28];
|
||||
bool mPaused;
|
||||
u8 _61[0x64 - 0x61];
|
||||
float _64 = 1.0 / 30.0;
|
||||
float _68 = 1.0 / 30.0;
|
||||
float _6c = 1.0;
|
||||
@@ -158,7 +161,7 @@ private:
|
||||
void* mRigidBodyDividedMeshShapeMgr;
|
||||
SystemData* mSystemData;
|
||||
MaterialTable* mMaterialTable;
|
||||
void* _188{};
|
||||
RayCastRequestMgr* mRayCastRequestMgr{};
|
||||
void* _190{};
|
||||
void* _198{};
|
||||
void* _1a0{};
|
||||
|
||||
Reference in New Issue
Block a user