ksys/phys: Add RigidBodyParam

This commit is contained in:
Léo Lam
2021-04-22 15:04:39 +02:00
parent 7a2e380f2b
commit cbe711e595
6 changed files with 388 additions and 15 deletions
@@ -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