summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-03-18 21:18:08 +0100
committerLéo Lam <leo@leolam.fr>2022-03-18 21:18:15 +0100
commitf709a7c6126757802e8ce5b64b5a2cad6cdad300 (patch)
tree4e736d92bdf1dc7a07285e6c46dfd0365e21ab5c /src/KingSystem/Physics/System/physQueryContactPointInfo.cpp
parent10ad05ef8ee49ad94bbf6f8fa94baaad580a61ca (diff)
ksys/phys: Finish QueryContactPointInfo::Iterator
Diffstat (limited to 'src/KingSystem/Physics/System/physQueryContactPointInfo.cpp')
-rw-r--r--src/KingSystem/Physics/System/physQueryContactPointInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp b/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp
index c5098227..121e2c25 100644
--- a/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp
+++ b/src/KingSystem/Physics/System/physQueryContactPointInfo.cpp
@@ -1,5 +1,6 @@
#include "KingSystem/Physics/System/physQueryContactPointInfo.h"
#include "KingSystem/Physics/System/physContactMgr.h"
+#include "KingSystem/Physics/System/physShapeCast.h"
namespace ksys::phys {
@@ -17,6 +18,21 @@ void QueryContactPointInfo::free(QueryContactPointInfo* info) {
QueryContactPointInfo::~QueryContactPointInfo() = default;
+// NON_MATCHING: reordering
+void QueryContactPointInfo::Iterator::getHitPosition(sead::Vector3f* out,
+ const ShapeCast& shape_cast) const {
+ float distance = getPoint()->separating_distance;
+ auto start = shape_cast.getStart();
+ auto end = shape_cast.getEnd();
+ *out = start + (end - start) * distance;
+}
+
+sead::Vector3f QueryContactPointInfo::Iterator::getHitPosition(const ShapeCast& shape_cast) const {
+ sead::Vector3f pos;
+ getHitPosition(&pos, shape_cast);
+ return pos;
+}
+
void QueryContactPointInfo::Iterator::getPointPosition(sead::Vector3f* out, Point point) const {
out->e = getPoint()->position.e;
}