aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Movement
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-09-04 13:38:24 +0200
committerShauren <shauren.trinity@gmail.com>2020-09-04 13:38:24 +0200
commitb23190393248455f04d3a06def030a1ec7efad1e (patch)
tree1ce3772314492dcdb985641269a3114813d4b4dc /src/server/game/Movement
parentb20acfe701e6f5f995f2776f076d3c494c02e1aa (diff)
Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port
Diffstat (limited to 'src/server/game/Movement')
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp8
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp4
-rw-r--r--src/server/game/Movement/MovementGenerators/PointMovementGenerator.h4
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp4
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp10
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h1
-rw-r--r--src/server/game/Movement/PathGenerator.cpp25
-rw-r--r--src/server/game/Movement/PathGenerator.h22
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp28
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.h30
-rw-r--r--src/server/game/Movement/Spline/MoveSplineFlag.h24
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.cpp26
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.h26
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInitArgs.h22
-rw-r--r--src/server/game/Movement/Spline/MovementTypedefs.h22
-rw-r--r--src/server/game/Movement/Spline/MovementUtil.cpp22
-rw-r--r--src/server/game/Movement/Spline/Spline.cpp31
-rw-r--r--src/server/game/Movement/Spline/Spline.h36
-rw-r--r--src/server/game/Movement/Spline/SplineImpl.h22
20 files changed, 183 insertions, 186 deletions
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index 0432241432d..d3cdffb462f 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ConfusedMovementGenerator.h"
#include "Creature.h"
-#include "Player.h"
-#include "PathGenerator.h"
-#include "MoveSplineInit.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
+#include "PathGenerator.h"
+#include "Player.h"
#include "Random.h"
-#include "ConfusedMovementGenerator.h"
template<class T>
ConfusedMovementGenerator<T>::~ConfusedMovementGenerator()
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index 041961ce91c..191877289c8 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "HomeMovementGenerator.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "MoveSplineInit.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
#include "PathGenerator.h"
-#include "HomeMovementGenerator.h"
template<class T>
HomeMovementGenerator<T>::~HomeMovementGenerator() { }
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
index 18f552cc1cd..4f5bcbc6e17 100644
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
@@ -30,7 +30,7 @@ template<class T>
class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
{
public:
-explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, float speed = 0.0f, Unit const* faceTarget = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr) : _movementId(id), _destination(x, y, z), _speed(speed), i_faceTarget(faceTarget), i_spellEffectExtra(spellEffectExtraData), _generatePath(generatePath), _recalculateSpeed(false), _interrupt(false) { }
+ explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool generatePath, float speed = 0.0f, Unit const* faceTarget = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr) : _movementId(id), _destination(x, y, z), _speed(speed), i_faceTarget(faceTarget), i_spellEffectExtra(spellEffectExtraData), _generatePath(generatePath), _recalculateSpeed(false), _interrupt(false) { }
MovementGeneratorType GetMovementGeneratorType() const override { return POINT_MOTION_TYPE; }
@@ -57,7 +57,7 @@ explicit PointMovementGenerator(uint32 id, float x, float y, float z, bool gener
class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
{
public:
- explicit AssistanceMovementGenerator(float _x, float _y, float _z) : PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
+ AssistanceMovementGenerator(float x, float y, float z) : PointMovementGenerator<Creature>(0, x, y, z, true) { }
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_MOTION_TYPE; }
void Finalize(Unit*) override;
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index ca95243d507..48f1c00c616 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "RandomMovementGenerator.h"
#include "Creature.h"
#include "Map.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "PathGenerator.h"
#include "Random.h"
-#include "RandomMovementGenerator.h"
template<class T>
RandomMovementGenerator<T>::~RandomMovementGenerator() { }
@@ -42,7 +42,7 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* owner)
return;
owner->AddUnitState(UNIT_STATE_ROAMING);
- owner->GetPosition(_reference.m_positionX, _reference.m_positionY, _reference.m_positionZ);
+ _reference = owner->GetPosition();
owner->StopMoving();
if (!_wanderDistance)
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
index a615bec49bc..c0716f4c247 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
@@ -25,7 +25,7 @@ template<class T>
class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator<T> >
{
public:
- explicit RandomMovementGenerator(float distance = 0.0f) : _path(nullptr), _timer(0), _reference(0.f, 0.f, 0.f), _wanderDistance(distance), _interrupt(false) { }
+ explicit RandomMovementGenerator(float distance = 0.0f) : _path(nullptr), _timer(0), _reference(), _wanderDistance(distance), _interrupt(false) { }
~RandomMovementGenerator();
MovementGeneratorType GetMovementGeneratorType() const override { return RANDOM_MOTION_TYPE; }
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index 5c8eb721e18..a2e954ad225 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -15,15 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "CreatureAI.h"
+#include "TargetedMovementGenerator.h"
#include "Creature.h"
-#include "Player.h"
-#include "VehicleDefines.h"
-#include "MoveSplineInit.h"
+#include "CreatureAI.h"
#include "MoveSpline.h"
+#include "MoveSplineInit.h"
#include "PathGenerator.h"
+#include "Player.h"
+#include "VehicleDefines.h"
#include "World.h"
-#include "TargetedMovementGenerator.h"
template<class T, typename D>
TargetedMovementGenerator<T, D>::~TargetedMovementGenerator()
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
index b944913a74d..4c5d6cba197 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -136,4 +136,5 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium<Player, Fligh
std::deque<TaxiNodeChangeInfo> _pointsForPathSwitch; //! node indexes and costs where TaxiPath changes
};
+
#endif
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index 66af5f9e55a..25ea5638f08 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -1,19 +1,18 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "PathGenerator.h"
@@ -29,7 +28,7 @@
#include "PhasingHandler.h"
////////////////// PathGenerator //////////////////
-PathGenerator::PathGenerator(const Unit* owner) :
+PathGenerator::PathGenerator(Unit const* owner) :
_polyLength(0), _type(PATHFIND_BLANK), _useStraightPath(false),
_forceDestination(false), _pointPathLimit(MAX_POINT_PATH_LENGTH), _straightLine(false),
_endPosition(G3D::Vector3::zero()), _sourceUnit(owner), _navMesh(nullptr),
@@ -886,7 +885,7 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo
return nsmoothPath < MAX_POINT_PATH_LENGTH ? DT_SUCCESS : DT_FAILURE;
}
-bool PathGenerator::InRangeYZX(const float* v1, const float* v2, float r, float h) const
+bool PathGenerator::InRangeYZX(float const* v1, float const* v2, float r, float h) const
{
const float dx = v2[0] - v1[0];
const float dy = v2[1] - v1[1]; // elevation
diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h
index cc554d73c0a..8109579dfbc 100644
--- a/src/server/game/Movement/PathGenerator.h
+++ b/src/server/game/Movement/PathGenerator.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PATH_GENERATOR_H
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
index c125d9db689..4d72d506549 100644
--- a/src/server/game/Movement/Spline/MoveSpline.cpp
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MoveSpline.h"
@@ -144,9 +144,9 @@ struct CommonInitializer
}
};
-void MoveSpline::init_spline(const MoveSplineInitArgs& args)
+void MoveSpline::init_spline(MoveSplineInitArgs const& args)
{
- const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear, SplineBase::ModeCatmullrom};
+ static SplineBase::EvaluationMode const modes[2] = { SplineBase::ModeLinear, SplineBase::ModeCatmullrom };
if (args.flags.cyclic)
{
uint32 cyclic_point = 0;
@@ -156,9 +156,7 @@ void MoveSpline::init_spline(const MoveSplineInitArgs& args)
spline.init_cyclic_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()], cyclic_point);
}
else
- {
spline.init_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()]);
- }
// init spline timestamps
if (splineflags.falling)
diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h
index ac0b808c82e..0bc025fc5f0 100644
--- a/src/server/game/Movement/Spline/MoveSpline.h
+++ b/src/server/game/Movement/Spline/MoveSpline.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVEPLINE_H
@@ -37,8 +37,8 @@ namespace Movement
{
Location() : orientation(0) { }
Location(float x, float y, float z, float o) : Vector3(x, y, z), orientation(o) { }
- Location(const Vector3& v) : Vector3(v), orientation(0) { }
- Location(const Vector3& v, float o) : Vector3(v), orientation(o) { }
+ Location(Vector3 const& v) : Vector3(v), orientation(0) { }
+ Location(Vector3 const& v, float o) : Vector3(v), orientation(o) { }
float orientation;
};
@@ -82,7 +82,7 @@ namespace Movement
int32 point_Idx_offset;
Optional<SpellEffectExtraData> spell_effect_extra;
- void init_spline(const MoveSplineInitArgs& args);
+ void init_spline(MoveSplineInitArgs const& args);
protected:
MySpline::ControlArray const& getPath() const { return spline.getPoints(); }
@@ -104,7 +104,7 @@ namespace Movement
void _Interrupt() { splineflags.done = true; }
public:
- void Initialize(const MoveSplineInitArgs&);
+ void Initialize(MoveSplineInitArgs const&);
bool Initialized() const { return !spline.empty(); }
MoveSpline();
diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h
index 10f0fb8648e..2f80d1d509c 100644
--- a/src/server/game/Movement/Spline/MoveSplineFlag.h
+++ b/src/server/game/Movement/Spline/MoveSplineFlag.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVESPLINEFLAG_H
@@ -71,7 +71,7 @@ namespace Movement
};
inline uint32& raw() { return (uint32&)*this; }
- inline const uint32& raw() const { return (const uint32&)*this; }
+ inline uint32 const& raw() const { return (uint32 const&)*this; }
MoveSplineFlag() { raw() = 0; }
MoveSplineFlag(uint32 f) { raw() = f; }
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp
index 8740500dac5..a5d6a7c86f3 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.cpp
+++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MoveSplineInit.h"
@@ -222,7 +222,7 @@ namespace Movement
args.facing.type = MONSTER_MOVE_FACING_ANGLE;
}
- void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset)
+ void MoveSplineInit::MovebyPath(PointsArray const& controls, int32 path_offset)
{
args.path_Idx_offset = path_offset;
args.path.reserve(controls.size());
@@ -234,7 +234,7 @@ namespace Movement
MoveTo(G3D::Vector3(x, y, z), generatePath, forceDestination);
}
- void MoveSplineInit::MoveTo(const Vector3& dest, bool generatePath, bool forceDestination)
+ void MoveSplineInit::MoveTo(Vector3 const& dest, bool generatePath, bool forceDestination)
{
if (generatePath)
{
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h
index 05a64ef7a62..62678e2be91 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.h
+++ b/src/server/game/Movement/Spline/MoveSplineInit.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVESPLINEINIT_H
@@ -87,11 +87,11 @@ namespace Movement
* @param path - array of points, shouldn't be empty
* @param pointId - Id of fisrt point of the path. Example: when third path point will be done it will notify that pointId + 3 done
*/
- void MovebyPath(const PointsArray& path, int32 pointId = 0);
+ void MovebyPath(PointsArray const& path, int32 pointId = 0);
/* Initializes simple A to B motion, A is current unit's position, B is destination
*/
- void MoveTo(const Vector3& destination, bool generatePath = true, bool forceDestination = false);
+ void MoveTo(Vector3 const& destination, bool generatePath = true, bool forceDestination = false);
void MoveTo(float x, float y, float z, bool generatePath = true, bool forceDestination = false);
/* Sets Id of fisrt point of the path. When N-th path point will be done ILisener will notify that pointId + N done
diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h
index c190f979362..6ae25b48de0 100644
--- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h
+++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_MOVESPLINEINIT_ARGS_H
diff --git a/src/server/game/Movement/Spline/MovementTypedefs.h b/src/server/game/Movement/Spline/MovementTypedefs.h
index e2188181841..31760ff01ce 100644
--- a/src/server/game/Movement/Spline/MovementTypedefs.h
+++ b/src/server/game/Movement/Spline/MovementTypedefs.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_TYPEDEFS_H
diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp
index f706a230480..95ceb3752a5 100644
--- a/src/server/game/Movement/Spline/MovementUtil.cpp
+++ b/src/server/game/Movement/Spline/MovementUtil.cpp
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MoveSplineFlag.h"
diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp
index b6318b6c63d..0866dcc066e 100644
--- a/src/server/game/Movement/Spline/Spline.cpp
+++ b/src/server/game/Movement/Spline/Spline.cpp
@@ -1,19 +1,18 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Spline.h"
@@ -94,7 +93,7 @@ inline void C_Evaluate(const Vector3 *vertice, float t, const float (&matrix)[4]
position.z = z;
}*/
-inline void C_Evaluate(const Vector3 *vertice, float t, const Matrix4& matr, Vector3 &result)
+inline void C_Evaluate(Vector3 const* vertice, float t, Matrix4 const& matr, Vector3 &result)
{
Vector4 tvec(t*t*t, t*t, t, 1.f);
Vector4 weights(tvec * matr);
@@ -103,7 +102,7 @@ inline void C_Evaluate(const Vector3 *vertice, float t, const Matrix4& matr, Vec
+ vertice[2] * weights[2] + vertice[3] * weights[3];
}
-inline void C_Evaluate_Derivative(const Vector3 *vertice, float t, const Matrix4& matr, Vector3 &result)
+inline void C_Evaluate_Derivative(Vector3 const* vertice, float t, Matrix4 const& matr, Vector3 &result)
{
Vector4 tvec(3.f*t*t, 2.f*t, 1.f, 0.f);
Vector4 weights(tvec * matr);
@@ -215,7 +214,7 @@ void SplineBase::init_cyclic_spline(const Vector3 * controls, index_type count,
(this->*initializers[m_mode])(controls, count, cyclic_point);
}
-void SplineBase::InitLinear(const Vector3* controls, index_type count, index_type cyclic_point)
+void SplineBase::InitLinear(Vector3 const* controls, index_type count, index_type cyclic_point)
{
ASSERT(count >= 2);
const int real_size = count + 1;
@@ -235,7 +234,7 @@ void SplineBase::InitLinear(const Vector3* controls, index_type count, index_typ
index_hi = cyclic ? count : (count - 1);
}
-void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, index_type cyclic_point)
+void SplineBase::InitCatmullRom(Vector3 const* controls, index_type count, index_type cyclic_point)
{
const int real_size = count + (cyclic ? (1+2) : (1+1));
@@ -268,7 +267,7 @@ void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, index
index_hi = high_index + (cyclic ? 1 : 0);
}
-void SplineBase::InitBezier3(const Vector3* controls, index_type count, index_type /*cyclic_point*/)
+void SplineBase::InitBezier3(Vector3 const* controls, index_type count, index_type /*cyclic_point*/)
{
index_type c = count / 3u * 3u;
index_type t = c / 3u;
diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h
index 5f31115b2af..eeb6ddcc350 100644
--- a/src/server/game/Movement/Spline/Spline.h
+++ b/src/server/game/Movement/Spline/Spline.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYSERVER_SPLINE_H
@@ -77,10 +77,10 @@ protected:
typedef float (SplineBase::*SegLenghtMethtod)(index_type) const;
static SegLenghtMethtod seglengths[ModesEnd];
- void InitLinear(const Vector3*, index_type, index_type);
- void InitCatmullRom(const Vector3*, index_type, index_type);
- void InitBezier3(const Vector3*, index_type, index_type);
- typedef void (SplineBase::*InitMethtod)(const Vector3*, index_type, index_type);
+ void InitLinear(Vector3 const*, index_type, index_type);
+ void InitCatmullRom(Vector3 const*, index_type, index_type);
+ void InitBezier3(Vector3 const*, index_type, index_type);
+ typedef void (SplineBase::*InitMethtod)(Vector3 const*, index_type, index_type);
static InitMethtod initializers[ModesEnd];
void UninitializedSplineEvaluationMethod(index_type, float, Vector3&) const { ABORT(); }
@@ -111,9 +111,9 @@ public:
EvaluationMode mode() const { return (EvaluationMode)m_mode;}
bool isCyclic() const { return cyclic;}
- const ControlArray& getPoints() const { return points; }
- index_type getPointCount() const { return index_type(points.size()); }
- const Vector3& getPoint(index_type i) const { return points[i]; }
+ ControlArray const& getPoints() const { return points; }
+ index_type getPointCount() const { return index_type(points.size());}
+ Vector3 const& getPoint(index_type i) const { return points[i]; }
/** Initializes spline. Don't call other methods while spline not initialized. */
void init_spline(const Vector3 * controls, index_type count, EvaluationMode m);
diff --git a/src/server/game/Movement/Spline/SplineImpl.h b/src/server/game/Movement/Spline/SplineImpl.h
index fd77ca3c6fe..4eb7a3f76cd 100644
--- a/src/server/game/Movement/Spline/SplineImpl.h
+++ b/src/server/game/Movement/Spline/SplineImpl.h
@@ -1,18 +1,18 @@
/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Movement