spline changes for mmaps.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#define TRINITYSERVER_MOVESPLINEINIT_H
|
||||
|
||||
#include "MoveSplineInitArgs.h"
|
||||
#include "PathFinderMovementGenerator.h"
|
||||
|
||||
class Unit;
|
||||
|
||||
@@ -43,7 +44,7 @@ namespace Movement
|
||||
|
||||
/* Final pass of initialization that launches spline movement.
|
||||
*/
|
||||
void Launch();
|
||||
int32 Launch();
|
||||
|
||||
/* Adds movement by parabolic trajectory
|
||||
* @param amplitude - the maximum height of parabola, value could be negative and positive
|
||||
@@ -72,8 +73,8 @@ namespace Movement
|
||||
|
||||
/* Initializes simple A to B mition, A is current unit's position, B is destination
|
||||
*/
|
||||
void MoveTo(const Vector3& destination);
|
||||
void MoveTo(float x, float y, float z);
|
||||
void MoveTo(const Vector3& destination, bool generatePath = false, bool forceDestination = false);
|
||||
void MoveTo(float x, float y, float z, bool generatePath = false, 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
|
||||
* Needed for waypoint movement where path splitten into parts
|
||||
@@ -133,17 +134,26 @@ namespace Movement
|
||||
args.path.assign(controls.begin(),controls.end());
|
||||
}
|
||||
|
||||
inline void MoveSplineInit::MoveTo(float x, float y, float z)
|
||||
inline void MoveSplineInit::MoveTo(float x, float y, float z, bool generatePath, bool forceDestination)
|
||||
{
|
||||
Vector3 v(x,y,z);
|
||||
MoveTo(v);
|
||||
MoveTo(v, generatePath, forceDestination);
|
||||
}
|
||||
|
||||
inline void MoveSplineInit::MoveTo(const Vector3& dest)
|
||||
inline void MoveSplineInit::MoveTo(const Vector3& dest, bool generatePath, bool forceDestination)
|
||||
{
|
||||
args.path_Idx_offset = 0;
|
||||
args.path.resize(2);
|
||||
args.path[1] = dest;
|
||||
if (generatePath)
|
||||
{
|
||||
PathFinderMovementGenerator path(&unit);
|
||||
path.calculate(dest.x, dest.y, dest.z, forceDestination);
|
||||
MovebyPath(path.getPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
args.path_Idx_offset = 0;
|
||||
args.path.resize(2);
|
||||
args.path[1] = dest;
|
||||
}
|
||||
}
|
||||
|
||||
inline void MoveSplineInit::SetParabolic(float amplitude, float time_shift)
|
||||
|
||||
Reference in New Issue
Block a user