summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-03-06 22:50:15 +0100
committerLéo Lam <leo@leolam.fr>2022-03-07 12:44:38 +0100
commit62959cc554dae3bf2d18f3f7e55788edf343d8e8 (patch)
tree68b89c8ba299c8b9c849a5c9249a8d8135f09ba0 /src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp
parent6229e5d41adcf16a87dba7df9b12c5f91871273b (diff)
ksys/phys: Start adding ClosestPointQuery and iterator stuff
Diffstat (limited to 'src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp')
-rw-r--r--src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp b/src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp
new file mode 100644
index 00000000..b0125f27
--- /dev/null
+++ b/src/KingSystem/Physics/System/physClosestPointQueryWithInfo.cpp
@@ -0,0 +1,22 @@
+#include "KingSystem/Physics/System/physClosestPointQueryWithInfo.h"
+#include "KingSystem/Physics/System/physQueryContactPointInfo.h"
+#include "KingSystem/Physics/System/physSystem.h"
+
+namespace ksys::phys {
+
+ClosestPointQueryWithInfo::ClosestPointQueryWithInfo(RigidBody* body, int num_points,
+ const sead::SafeString& name, int a,
+ LowPriority low_priority)
+ : ClosestPointQuery(body, nullptr) {
+ mStatus = Status::_1;
+ auto* heap = System::instance()->getPhysicsTempHeap(low_priority);
+ mContactPointInfo = QueryContactPointInfo::make(heap, num_points, name, a, 0);
+}
+
+ClosestPointQueryWithInfo::~ClosestPointQueryWithInfo() {
+ if (mStatus == Status::_1 || mStatus == Status::_3) {
+ QueryContactPointInfo::free(mContactPointInfo);
+ }
+}
+
+} // namespace ksys::phys