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.cpp10
1 files changed, 10 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();
}