From a7b294025e62b6e267c0ae44965fe362551f575a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Br=C3=B6nneg=C3=A5rd?= <1162652+rasmusgo@users.noreply.github.com> Date: Tue, 1 Feb 2022 21:32:13 +0100 Subject: [PATCH] Rename BeamSearch to PathFindingSearch etc --- src/object/task/taskgoto.cpp | 24 ++++++++++++------------ src/object/task/taskgoto.h | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp index ce891f5d..3e9a06f5 100644 --- a/src/object/task/taskgoto.cpp +++ b/src/object/task/taskgoto.cpp @@ -222,7 +222,7 @@ bool CTaskGoto::EventProcess(const Event &event) if ( m_bmCargoObject->GetType() == OBJECT_BASE ) dist = 12.0f; } - ret = BeamSearch(pos, goal, dist); + ret = PathFindingSearch(pos, goal, dist); if ( ret == ERR_OK ) { if ( m_physics->GetLand() ) m_phase = TGP_BEAMWCOLD; @@ -346,7 +346,7 @@ bool CTaskGoto::EventProcess(const Event &event) { m_physics->SetMotorSpeedX(0.0f); // stops the advance m_physics->SetMotorSpeedZ(0.0f); // stops the rotation - BeamStart(); // we start all + PathFindingStart(); // we start all return true; } @@ -790,7 +790,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude, } } - BeamStart(); + PathFindingStart(); if ( m_bmCargoObject == nullptr ) { @@ -826,7 +826,7 @@ Error CTaskGoto::IsEnded() { m_physics->SetMotorSpeedX(0.0f); // stops the advance m_physics->SetMotorSpeedZ(0.0f); // stops the rotation - BeamInit(); + PathFindingInit(); m_phase = TGP_BEAMSEARCH; // will seek the path } return ERR_CONTINUE; @@ -888,7 +888,7 @@ Error CTaskGoto::IsEnded() m_physics->SetMotorSpeedX(0.0f); // stops the advance m_physics->SetMotorSpeedZ(0.0f); // stops the rotation - m_bmIndex = BeamShortcut(); + m_bmIndex = PathFindingShortcut(); if ( m_bmIndex > m_bmTotal ) { @@ -1630,7 +1630,7 @@ void CTaskGoto::ComputeFlyingRepulse(float &dir) // Among all of the following, seek if there is one allowing to go directly to the crow flies. // If yes, skip all the unnecessary intermediate points. -int CTaskGoto::BeamShortcut() +int CTaskGoto::PathFindingShortcut() { int i; @@ -1647,7 +1647,7 @@ int CTaskGoto::BeamShortcut() // That's the big start. -void CTaskGoto::BeamStart() +void CTaskGoto::PathFindingStart() { Math::Vector min, max; @@ -1673,14 +1673,14 @@ void CTaskGoto::BeamStart() { m_physics->SetMotorSpeedX(0.0f); // stops the advance m_physics->SetMotorSpeedZ(0.0f); // stops the rotation - BeamInit(); + PathFindingInit(); m_phase = TGP_BEAMSEARCH; // will seek the path } } -// Initialization before the first BeamSearch. +// Initialization before the first PathFindingSearch. -void CTaskGoto::BeamInit() +void CTaskGoto::PathFindingInit() { int i; @@ -1701,8 +1701,8 @@ void CTaskGoto::BeamInit() // ERR_CONTINUE if not done yet // goalRadius: distance at which we must approach the goal -Error CTaskGoto::BeamSearch(const Math::Vector &start, const Math::Vector &goal, - float goalRadius) +Error CTaskGoto::PathFindingSearch(const Math::Vector &start, const Math::Vector &goal, + float goalRadius) { m_bmStep ++; diff --git a/src/object/task/taskgoto.h b/src/object/task/taskgoto.h index 118a372a..26bc52e3 100644 --- a/src/object/task/taskgoto.h +++ b/src/object/task/taskgoto.h @@ -99,10 +99,10 @@ protected: void ComputeRepulse(Math::Point &dir); void ComputeFlyingRepulse(float &dir); - int BeamShortcut(); - void BeamStart(); - void BeamInit(); - Error BeamSearch(const Math::Vector &start, const Math::Vector &goal, float goalRadius); + int PathFindingShortcut(); + void PathFindingStart(); + void PathFindingInit(); + Error PathFindingSearch(const Math::Vector &start, const Math::Vector &goal, float goalRadius); bool BitmapTestLine(const Math::Vector &start, const Math::Vector &goal); void BitmapObject();