ksys/phys: Start adding ClosestPointQuery and iterator stuff

This commit is contained in:
Léo Lam
2022-03-06 22:50:15 +01:00
parent 6229e5d41a
commit 62959cc554
12 changed files with 249 additions and 16 deletions
@@ -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