From ec37bc00181e69a88a410e2807d5f560bae81529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 21 Mar 2022 00:45:06 +0100 Subject: ksys/phys: Add RayCastRequestMgr --- .../Physics/System/physRayCastForRequest.cpp | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/KingSystem/Physics/System/physRayCastForRequest.cpp (limited to 'src/KingSystem/Physics/System/physRayCastForRequest.cpp') diff --git a/src/KingSystem/Physics/System/physRayCastForRequest.cpp b/src/KingSystem/Physics/System/physRayCastForRequest.cpp new file mode 100644 index 00000000..44cbfdaa --- /dev/null +++ b/src/KingSystem/Physics/System/physRayCastForRequest.cpp @@ -0,0 +1,34 @@ +#include "KingSystem/Physics/System/physRayCastForRequest.h" +#include "KingSystem/Physics/System/physRayCastRequestMgr.h" +#include "KingSystem/Physics/System/physSystem.h" + +namespace ksys::phys { + +RayCastForRequest::RayCastForRequest(RayCastRequestMgr* mgr) + : RayCast(nullptr, GroundHit::HitAll), mMgr(mgr) {} + +RayCastForRequest::~RayCastForRequest() = default; + +RayCastForRequest* RayCastForRequest::allocRequest(SystemGroupHandler* group_handler, + GroundHit ground_hit) { + return System::instance()->allocRayCastRequest(group_handler, ground_hit); +} + +bool RayCastForRequest::submitRequest(ContactLayerType layer_type) { + return mMgr->submitRequest(*this, layer_type); +} + +bool RayCastForRequest::isRequestQueued() const { + return mMgr->isRequestQueued(*this); +} + +void RayCastForRequest::release() { + mRigidBodyHitCallback = nullptr; + mMgr->releaseRequest(*this); +} + +bool RayCastForRequest::isRequestFinished() const { + return mMgr->isRequestFinished(*this); +} + +} // namespace ksys::phys -- cgit v1.2.3