summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physDefines.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-10-30 12:38:27 +0200
committerLéo Lam <leo@leolam.fr>2021-10-30 16:17:39 +0200
commitd10dd65dcd371c87012b31700a871a8d6c5a9aa1 (patch)
treee054c0b585b6daead48586330bc348bc58cf3c16 /src/KingSystem/Physics/System/physDefines.cpp
parent70aaa429fe82098d954d0945bfb1b8253a7fa45a (diff)
ksys/phys: Add some prerequisites for ContactInfoTable
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();
}