summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physRayCastForRequest.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-03-21 00:45:06 +0100
committerLéo Lam <leo@leolam.fr>2022-03-21 03:00:36 +0100
commitec37bc00181e69a88a410e2807d5f560bae81529 (patch)
tree1ba1830c665f547c1720ef296d94486fa4b5bb72 /src/KingSystem/Physics/System/physRayCastForRequest.cpp
parent509d557731ce02136f79026ce1e1d5683c93876f (diff)
ksys/phys: Add RayCastRequestMgr
Diffstat (limited to 'src/KingSystem/Physics/System/physRayCastForRequest.cpp')
-rw-r--r--src/KingSystem/Physics/System/physRayCastForRequest.cpp34
1 files changed, 34 insertions, 0 deletions
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