From a1f9eea30085df764f23c99c27a46e1e2bab01d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 6 Mar 2022 21:34:36 +0100 Subject: [PATCH] ksys/phys: Add QueryContactPointInfo --- data/uking_functions.csv | 8 ++++---- src/KingSystem/Physics/CMakeLists.txt | 2 ++ .../System/physQueryContactPointInfo.cpp | 19 +++++++++++++++++++ .../System/physQueryContactPointInfo.h | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 src/KingSystem/Physics/System/physQueryContactPointInfo.cpp create mode 100644 src/KingSystem/Physics/System/physQueryContactPointInfo.h diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 4c0b0933..5f0becdf 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -84002,10 +84002,10 @@ Address,Quality,Size,Name 0x0000007100fc2c68,O,000064,_ZN4ksys4phys8ParamSet5parseEPNS_3res7PhysicsEN3agl3utl19ResParameterArchiveEPN4sead4HeapE 0x0000007100fc2ca8,O,001508,_ZN4ksys4phys8ParamSet7doParseEPNS_3res7PhysicsEN3agl3utl19ResParameterArchiveEPN4sead4HeapE 0x0000007100fc328c,O,000028,_ZN4ksys4phys8ParamSet15getRigidBodySetEi -0x0000007100fc32a8,U,000136, -0x0000007100fc3330,U,000068, -0x0000007100fc3374,U,000004,j_nullsub_4247 -0x0000007100fc3378,U,000036, +0x0000007100fc32a8,O,000136,_ZN4ksys4phys21QueryContactPointInfo4makeEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEii +0x0000007100fc3330,O,000068,_ZN4ksys4phys21QueryContactPointInfo4freeEPS1_ +0x0000007100fc3374,O,000004,_ZN4ksys4phys21QueryContactPointInfoD1Ev +0x0000007100fc3378,O,000036,_ZN4ksys4phys21QueryContactPointInfoD0Ev 0x0000007100fc339c,U,000088, 0x0000007100fc33f4,U,000068, 0x0000007100fc3438,U,000032, diff --git a/src/KingSystem/Physics/CMakeLists.txt b/src/KingSystem/Physics/CMakeLists.txt index dde16480..2d74791f 100644 --- a/src/KingSystem/Physics/CMakeLists.txt +++ b/src/KingSystem/Physics/CMakeLists.txt @@ -126,6 +126,8 @@ target_sources(uking PRIVATE System/physMaterialTable.h System/physParamSet.cpp System/physParamSet.h + System/physQueryContactPointInfo.cpp + System/physQueryContactPointInfo.h System/physSensorGroupFilter.cpp System/physSensorGroupFilter.h System/physSystem.cpp diff --git a/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp b/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp new file mode 100644 index 00000000..9a972ed7 --- /dev/null +++ b/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp @@ -0,0 +1,19 @@ +#include "KingSystem/Physics/System/physQueryContactPointInfo.h" + +namespace ksys::phys { + +QueryContactPointInfo* QueryContactPointInfo::make(sead::Heap* heap, int num_points, + const sead::SafeString& name, int a, int b) { + auto* info = new (heap) QueryContactPointInfo(name, a, b, 0); + info->allocPoints(heap, num_points); + return info; +} + +void QueryContactPointInfo::free(QueryContactPointInfo* info) { + info->freePoints(); + delete info; +} + +QueryContactPointInfo::~QueryContactPointInfo() = default; + +} // namespace ksys::phys diff --git a/src/KingSystem/Physics/System/physQueryContactPointInfo.h b/src/KingSystem/Physics/System/physQueryContactPointInfo.h new file mode 100644 index 00000000..a3778ff1 --- /dev/null +++ b/src/KingSystem/Physics/System/physQueryContactPointInfo.h @@ -0,0 +1,17 @@ +#pragma once + +#include "KingSystem/Physics/System/physContactPointInfo.h" + +namespace ksys::phys { + +class QueryContactPointInfo : public ContactPointInfo { +public: + static QueryContactPointInfo* make(sead::Heap* heap, int num_points, + const sead::SafeString& name, int a, int b); + static void free(QueryContactPointInfo* info); + + using ContactPointInfo::ContactPointInfo; + ~QueryContactPointInfo() override; +}; + +} // namespace ksys::phys