TrinityCore
Loading...
Searching...
No Matches
Movement Namespace Reference

Classes

struct  CommonInitializer
 
class  counter
 
union  FacingInfo
 
struct  FallInitializer
 
struct  Location
 
class  MoveSpline
 
class  MoveSplineFlag
 
class  MoveSplineInit
 
struct  MoveSplineInitArgs
 
class  Spline
 
class  SplineBase
 
class  TransportPathTransform
 

Typedefs

typedef counter< uint32, 0xFFFFFFFF > UInt32Counter
 
typedef std::vector< Vector3 > PointsArray
 

Enumerations

enum  MonsterMoveType {
  MONSTER_MOVE_NORMAL = 0 , MONSTER_MOVE_STOP = 1 , MONSTER_MOVE_FACING_SPOT = 2 , MONSTER_MOVE_FACING_TARGET = 3 ,
  MONSTER_MOVE_FACING_ANGLE = 4
}
 
enum  { minimal_duration = 1 }
 

Functions

uint32 SecToMS (float sec)
 
float MSToSec (uint32 ms)
 
float computeFallTime (float path_length, bool isSafeFall)
 
float computeFallElevation (float t_passed, bool isSafeFall, float start_velocity=0.0f)
 
template<class Flags , int N>
void PrintFlags (Flags t, char const *(&names)[N], std::string &str)
 
uint32 computeDuration (float length, float velocity)
 
UnitMoveType SelectSpeedType (uint32 moveFlags)
 
static const Matrix4 s_catmullRomCoeffs (-0.5f, 1.5f, -1.5f, 0.5f, 1.f, -2.5f, 2.f, -0.5f, -0.5f, 0.f, 0.5f, 0.f, 0.f, 1.f, 0.f, 0.f)
 
static const Matrix4 s_Bezier3Coeffs (-1.f, 3.f, -3.f, 1.f, 3.f, -6.f, 3.f, 0.f, -3.f, 3.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f)
 
void C_Evaluate (Vector3 const *vertice, float t, Matrix4 const &matr, Vector3 &result)
 
void C_Evaluate_Derivative (Vector3 const *vertice, float t, Matrix4 const &matr, Vector3 &result)
 

Variables

TC_GAME_API float gravity = static_cast<float>(19.29110527038574)
 
TC_GAME_API UInt32Counter splineIdGen
 
float terminalVelocity = 60.148003f
 Velocity bounds that makes fall speed limited.
 
float terminalSafefallVelocity = 7.0f
 
const float terminal_length = float(terminalVelocity * terminalVelocity) / (2.0f * gravity)
 
const float terminal_safeFall_length = (terminalSafefallVelocity * terminalSafefallVelocity) / (2.0f * gravity)
 
const float terminal_fallTime = float(terminalVelocity / gravity)
 
const float terminal_safeFall_fallTime = float(terminalSafefallVelocity / gravity)
 
char const * g_MovementFlag_names []
 
char const * g_SplineFlag_names [32]
 

Typedef Documentation

◆ PointsArray

typedef std::vector<Vector3> Movement::PointsArray

Definition at line 29 of file MoveSplineInitArgs.h.

◆ UInt32Counter

typedef counter<uint32, 0xFFFFFFFF> Movement::UInt32Counter

Definition at line 78 of file MovementTypedefs.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
minimal_duration 

Definition at line 103 of file MoveSpline.cpp.

◆ MonsterMoveType

Enumerator
MONSTER_MOVE_NORMAL 
MONSTER_MOVE_STOP 
MONSTER_MOVE_FACING_SPOT 
MONSTER_MOVE_FACING_TARGET 
MONSTER_MOVE_FACING_ANGLE 

Definition at line 34 of file MovementTypedefs.h.

Function Documentation

◆ C_Evaluate()

void Movement::C_Evaluate ( Vector3 const *  vertice,
float  t,
Matrix4 const &  matr,
Vector3 &  result 
)
inline

◆ C_Evaluate_Derivative()

void Movement::C_Evaluate_Derivative ( Vector3 const *  vertice,
float  t,
Matrix4 const &  matr,
Vector3 &  result 
)
inline

◆ computeDuration()

uint32 Movement::computeDuration ( float  length,
float  velocity 
)
inline

Definition at line 88 of file MoveSpline.cpp.

References SecToMS().

◆ computeFallElevation()

float Movement::computeFallElevation ( float  t_passed,
bool  isSafeFall,
float  start_velocity = 0.0f 
)

◆ computeFallTime()

float Movement::computeFallTime ( float  path_length,
bool  isSafeFall 
)

◆ MSToSec()

◆ PrintFlags()

template<class Flags , int N>
void Movement::PrintFlags ( Flags  t,
char const *(&)  names[N],
std::string &  str 
)

Definition at line 176 of file MovementUtil.cpp.

Referenced by Movement::MoveSplineFlag::ToString().

◆ s_Bezier3Coeffs()

static const Matrix4 Movement::s_Bezier3Coeffs ( -1.  f,
3.  f,
-3.  f,
1.  f,
3.  f,
-6.  f,
3.  f,
0.  f,
-3.  f,
3.  f,
0.  f,
0.  f,
1.  f,
0.  f,
0.  f,
0.  f 
)
static

◆ s_catmullRomCoeffs()

static const Matrix4 Movement::s_catmullRomCoeffs ( -0.  5f,
1.  5f,
-1.  5f,
0.  5f,
1.  f,
-2.  5f,
2.  f,
-0.  5f,
-0.  5f,
0.  f,
0.  5f,
0.  f,
0.  f,
1.  f,
0.  f,
0.  f 
)
static

◆ SecToMS()

uint32 Movement::SecToMS ( float  sec)
inline

Definition at line 43 of file MovementTypedefs.h.

Referenced by computeDuration().

◆ SelectSpeedType()

Variable Documentation

◆ g_MovementFlag_names

char const* Movement::g_MovementFlag_names[]

Definition at line 86 of file MovementUtil.cpp.

◆ g_SplineFlag_names

char const* Movement::g_SplineFlag_names[32]

Definition at line 139 of file MovementUtil.cpp.

Referenced by Movement::MoveSplineFlag::ToString().

◆ gravity

◆ splineIdGen

UInt32Counter Movement::splineIdGen

Definition at line 24 of file MovementUtil.cpp.

Referenced by Movement::MoveSplineInit::MoveSplineInit().

◆ terminal_fallTime

const float Movement::terminal_fallTime = float(terminalVelocity / gravity)

Definition at line 32 of file MovementUtil.cpp.

Referenced by computeFallElevation(), and computeFallTime().

◆ terminal_length

const float Movement::terminal_length = float(terminalVelocity * terminalVelocity) / (2.0f * gravity)

Definition at line 30 of file MovementUtil.cpp.

Referenced by computeFallTime().

◆ terminal_safeFall_fallTime

const float Movement::terminal_safeFall_fallTime = float(terminalSafefallVelocity / gravity)

Definition at line 33 of file MovementUtil.cpp.

Referenced by computeFallElevation(), and computeFallTime().

◆ terminal_safeFall_length

const float Movement::terminal_safeFall_length = (terminalSafefallVelocity * terminalSafefallVelocity) / (2.0f * gravity)

Definition at line 31 of file MovementUtil.cpp.

Referenced by computeFallTime().

◆ terminalSafefallVelocity

float Movement::terminalSafefallVelocity = 7.0f

Definition at line 28 of file MovementUtil.cpp.

Referenced by computeFallElevation(), and computeFallTime().

◆ terminalVelocity

float Movement::terminalVelocity = 60.148003f

Velocity bounds that makes fall speed limited.

Definition at line 27 of file MovementUtil.cpp.

Referenced by computeFallElevation(), and computeFallTime().