From 509d557731ce02136f79026ce1e1d5683c93876f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 21 Mar 2022 00:30:56 +0100 Subject: ksys/phys: RayCastPlusBody -> RayCastBodyQuery for clarity --- .../Physics/System/physRayCastBodyQuery.cpp | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/KingSystem/Physics/System/physRayCastBodyQuery.cpp (limited to 'src/KingSystem/Physics/System/physRayCastBodyQuery.cpp') 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 -- cgit v1.2.3