summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physDefines.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/KingSystem/Physics/System/physDefines.cpp')
-rw-r--r--src/KingSystem/Physics/System/physDefines.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physDefines.cpp b/src/KingSystem/Physics/System/physDefines.cpp
index 16cb9503..94fd34d3 100644
--- a/src/KingSystem/Physics/System/physDefines.cpp
+++ b/src/KingSystem/Physics/System/physDefines.cpp
@@ -12,6 +12,17 @@ u32 makeContactLayerMask(ContactLayer layer) {
return 1 << (layer - ContactLayer::SensorObject);
}
+u32 getContactLayerBase(ContactLayerType type) {
+ if (type == ContactLayerType::Entity)
+ return ContactLayer::EntityObject;
+ return ContactLayer::SensorObject;
+}
+
+u32 getContactLayerBaseRelativeValue(ContactLayer layer) {
+ return layer - (layer < ContactLayer::SensorObject ? ContactLayer::EntityObject :
+ ContactLayer::SensorObject);
+}
+
const char* contactLayerToText(ContactLayer layer) {
return layer.text();
}