summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physDefines.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-04-22 15:04:39 +0200
committerLéo Lam <leo@leolam.fr>2021-04-22 18:21:36 +0200
commitcbe711e595128b2f571ce8315b409875344042cf (patch)
treed519e63ea0ad11c2c0ce5dd5784034bcad1ab0a3 /src/KingSystem/Physics/System/physDefines.cpp
parent7a2e380f2b09e602bbde09ce6d0116bf16f9ba91 (diff)
ksys/phys: Add RigidBodyParam
Diffstat (limited to 'src/KingSystem/Physics/System/physDefines.cpp')
-rw-r--r--src/KingSystem/Physics/System/physDefines.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physDefines.cpp b/src/KingSystem/Physics/System/physDefines.cpp
index 8114dc87..03be03a1 100644
--- a/src/KingSystem/Physics/System/physDefines.cpp
+++ b/src/KingSystem/Physics/System/physDefines.cpp
@@ -26,6 +26,18 @@ Material materialFromText(const sead::SafeString& text) {
return 0;
}
+const char* groundHitToText(GroundHit hit) {
+ return hit.text();
+}
+
+GroundHit groundHitFromText(const sead::SafeString& text) {
+ for (auto hit : GroundHit()) {
+ if (text == hit.text())
+ return hit;
+ }
+ return GroundHit::HitAll;
+}
+
const char* floorCodeToText(FloorCode code) {
return code.text();
}
@@ -50,4 +62,15 @@ WallCode wallCodeFromText(const sead::SafeString& text) {
return 0;
}
+// NON_MATCHING: duplicated branches?
+MotionType motionTypeFromText(const sead::SafeString& text) {
+ if (text == "Dynamic")
+ return MotionType::Dynamic;
+ if (text == "Fixed")
+ return MotionType::Fixed;
+ if (text == "Keyframed")
+ return MotionType::Keyframed;
+ return MotionType::Unknown;
+}
+
} // namespace ksys::phys