summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physRayCastBodyQuery.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-03-21 00:30:56 +0100
committerLéo Lam <leo@leolam.fr>2022-03-21 00:31:14 +0100
commit509d557731ce02136f79026ce1e1d5683c93876f (patch)
tree44f2db0540051bc97a6bb7708ed0902bfed8f763 /src/KingSystem/Physics/System/physRayCastBodyQuery.cpp
parenteca996b3fa362abd7b7199ca47b8d03762753d14 (diff)
ksys/phys: RayCastPlusBody -> RayCastBodyQuery for clarity
Diffstat (limited to 'src/KingSystem/Physics/System/physRayCastBodyQuery.cpp')
-rw-r--r--src/KingSystem/Physics/System/physRayCastBodyQuery.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physRayCastBodyQuery.cpp b/src/KingSystem/Physics/System/physRayCastBodyQuery.cpp
new file mode 100644
index 00000000..ce86f71f
--- /dev/null
+++ b/src/KingSystem/Physics/System/physRayCastBodyQuery.cpp
@@ -0,0 +1,29 @@
+#include "KingSystem/Physics/System/physRayCastBodyQuery.h"
+
+namespace ksys::phys {
+
+RayCastBodyQuery::RayCastBodyQuery(SystemGroupHandler* group_handler, GroundHit ground_hit)
+ : RayCast(group_handler, ground_hit) {}
+
+RayCastBodyQuery::~RayCastBodyQuery() = default;
+
+bool RayCastBodyQuery::worldRayCast(ContactLayerType layer_type) {
+ mHitRigidBody = nullptr;
+ return RayCast::worldRayCast(layer_type);
+}
+
+bool RayCastBodyQuery::shapeRayCast(RigidBody* rigid_body) {
+ mHitRigidBody = nullptr;
+ return RayCast::shapeRayCast(rigid_body);
+}
+
+bool RayCastBodyQuery::phantomRayCast(Phantom* phantom) {
+ mHitRigidBody = nullptr;
+ return RayCast::phantomRayCast(phantom);
+}
+
+void RayCastBodyQuery::onRigidBodyHit(RigidBody* body) {
+ mHitRigidBody = body;
+}
+
+} // namespace ksys::phys