summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/KingSystem/Physics/System/physDefines.cpp10
-rw-r--r--src/KingSystem/Physics/System/physDefines.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physDefines.cpp b/src/KingSystem/Physics/System/physDefines.cpp
index 03be03a1..f6333608 100644
--- a/src/KingSystem/Physics/System/physDefines.cpp
+++ b/src/KingSystem/Physics/System/physDefines.cpp
@@ -2,6 +2,16 @@
namespace ksys::phys {
+bool isSensorLayer(ContactLayer layer) {
+ return layer > ContactLayer::EntityEnd;
+}
+
+u32 makeContactLayerMask(ContactLayer layer) {
+ if (layer < ContactLayer::SensorObject)
+ return 1 << layer;
+ return 1 << (layer - ContactLayer::SensorObject);
+}
+
const char* contactLayerToText(ContactLayer layer) {
return layer.text();
}
diff --git a/src/KingSystem/Physics/System/physDefines.h b/src/KingSystem/Physics/System/physDefines.h
index 51fe8bd5..4dd56af1 100644
--- a/src/KingSystem/Physics/System/physDefines.h
+++ b/src/KingSystem/Physics/System/physDefines.h
@@ -159,6 +159,9 @@ enum class MotionType {
Unknown = 3,
};
+bool isSensorLayer(ContactLayer layer);
+u32 makeContactLayerMask(ContactLayer layer);
+
const char* contactLayerToText(ContactLayer layer);
ContactLayer contactLayerFromText(const sead::SafeString& text);