summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp
blob: c50982272f3f33c863283acc4de847ebca603101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "KingSystem/Physics/System/physQueryContactPointInfo.h"
#include "KingSystem/Physics/System/physContactMgr.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;

void QueryContactPointInfo::Iterator::getPointPosition(sead::Vector3f* out, Point point) const {
    out->e = getPoint()->position.e;
}

sead::Vector3f QueryContactPointInfo::Iterator::getPointPosition(Point point) const {
    sead::Vector3f pos;
    getPointPosition(&pos, point);
    return pos;
}

}  // namespace ksys::phys