mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Position: Allow implicit casting to G3D::Vector. Also, add a utility overload to MotionMaster.
(cherry picked from commit 9f15482b84)
This commit is contained in:
@@ -26,6 +26,11 @@ Position::Position(G3D::Vector3 const& vect)
|
||||
Relocate(vect.x, vect.y, vect.z, 0.f);
|
||||
}
|
||||
|
||||
Position::operator G3D::Vector3() const
|
||||
{
|
||||
return { m_positionX, m_positionY, m_positionZ };
|
||||
}
|
||||
|
||||
bool Position::operator==(Position const &a)
|
||||
{
|
||||
return (G3D::fuzzyEq(a.m_positionX, m_positionX) &&
|
||||
|
||||
@@ -33,6 +33,8 @@ struct TC_GAME_API Position
|
||||
|
||||
Position(G3D::Vector3 const& vect);
|
||||
|
||||
operator G3D::Vector3() const;
|
||||
|
||||
struct PositionXYStreamer
|
||||
{
|
||||
explicit PositionXYStreamer(Position& pos) : Pos(&pos) { }
|
||||
|
||||
@@ -443,7 +443,11 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool
|
||||
void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk)
|
||||
{
|
||||
Movement::PointsArray path(pathPoints, pathPoints + pathSize);
|
||||
MoveSmoothPath(pointId, path, walk);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveSmoothPath(uint32 pointId, Movement::PointsArray const& path, bool walk)
|
||||
{
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
if (_owner->CanFly())
|
||||
init.SetUncompressed();
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <vector>
|
||||
#include "SharedDefines.h"
|
||||
#include "Object.h"
|
||||
#include "MoveSplineInitArgs.h"
|
||||
|
||||
class MovementGenerator;
|
||||
class Unit;
|
||||
@@ -194,6 +195,7 @@ class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *>
|
||||
void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false, uint32 arrivalSpellId = 0, ObjectGuid const& arrivalSpellTargetGuid = ObjectGuid::Empty);
|
||||
void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount);
|
||||
void MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk);
|
||||
void MoveSmoothPath(uint32 pointId, Movement::PointsArray const& points, bool walk);
|
||||
void MoveFall(uint32 id = 0);
|
||||
|
||||
void MoveSeekAssistance(float x, float y, float z);
|
||||
|
||||
Reference in New Issue
Block a user