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 --- src/KingSystem/Map/mapAutoPlacement.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/KingSystem/Map/mapAutoPlacement.cpp') diff --git a/src/KingSystem/Map/mapAutoPlacement.cpp b/src/KingSystem/Map/mapAutoPlacement.cpp index a49e6153..b47494c8 100644 --- a/src/KingSystem/Map/mapAutoPlacement.cpp +++ b/src/KingSystem/Map/mapAutoPlacement.cpp @@ -7,23 +7,12 @@ #include "KingSystem/Map/mapAutoPlacementFlowMgr.h" #include "KingSystem/Map/mapAutoPlacementMgr.h" #include "KingSystem/Physics/RigidBody/physRigidBody.h" -#include "KingSystem/Physics/System/physRayCast.h" +#include "KingSystem/Physics/System/physRayCastForRequest.h" #include "KingSystem/Utils/Byaml/Byaml.h" #include "KingSystem/World/worldWeatherMgr.h" namespace ksys::map { -// TODO: this phys::RayCast derived class should be moved to phys:: -struct Raycast : phys::RayCast { - Raycast(); - ~Raycast() override; - - static Raycast* create(void*, u32); - - void sub_7100FC55AC(u32); - void release(); -}; - AutoPlacement::AutoPlacement() = default; AutoPlacement::~AutoPlacement() = default; @@ -284,11 +273,11 @@ void PlacementThing::stepRaycast() { switch (mState) { case State::Uninitialized: - mRaycast = Raycast::create(nullptr, 1); + mRaycast = phys::RayCastForRequest::allocRequest(nullptr, phys::GroundHit::Animal); next = mRaycast != nullptr ? State::Initialized : State::Invalid; break; case State::LayersDone: - mRaycast->sub_7100FC55AC(0); + mRaycast->submitRequest(phys::ContactLayerType::Entity); next = State::RaycastDone; break; case State::PlacementDone: -- cgit v1.2.3