Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Shauren committed 2013-06-18 21:04:31 +02:00
commit f517467817
116 files changed
+7709 -3082

No files matched your search

@@ -30,8 +30,9 @@ namespace Movement
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 terminalFallTime = float(terminalVelocity / gravity); // the time that needed to reach terminalVelocity
const float terminal_safeFall_length = (terminalSafefallVelocity * terminalSafefallVelocity) / (2.0f * gravity);
const float terminal_fallTime = float(terminalVelocity / gravity); // the time that needed to reach terminalVelocity
const float terminal_safeFall_fallTime = float(terminalSafefallVelocity / gravity); // the time that needed to reach terminalVelocity with safefall
float computeFallTime(float path_length, bool isSafeFall)
{
@@ -41,15 +42,15 @@ namespace Movement
float time;
if (isSafeFall)
{
if (path_length >= terminal_safefall_length)
time = (path_length - terminal_safefall_length) / terminalSafefallVelocity + terminalSafefallVelocity / gravity;
if (path_length >= terminal_safeFall_length)
time = (path_length - terminal_safeFall_length) / terminalSafefallVelocity + terminal_safeFall_fallTime;
else
time = sqrtf(2.0f * path_length / gravity);
}
else
{
if (path_length >= terminal_length)
time = (path_length - terminal_length) / terminalVelocity + terminalFallTime;
time = (path_length - terminal_length) / terminalVelocity + terminal_fallTime;
else
time = sqrtf(2.0f * path_length / gravity);
}
@@ -57,7 +58,7 @@ namespace Movement
return time;
}
float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity)
float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity /*= 0.0f*/)
{
float termVel;
float result;
@@ -70,11 +71,11 @@ namespace Movement
if (start_velocity > termVel)
start_velocity = termVel;
float terminal_time = terminalFallTime - start_velocity / gravity; // the time that needed to reach terminalVelocity
float terminal_time = (isSafeFall ? terminal_safeFall_fallTime : terminal_fallTime) - start_velocity / gravity; // the time that needed to reach terminalVelocity
if (t_passed > terminal_time)
{
result = terminalVelocity * (t_passed - terminal_time) +
result = termVel * (t_passed - terminal_time) +
start_velocity * terminal_time +
gravity * terminal_time * terminal_time*0.5f;
}
@@ -84,22 +85,6 @@ namespace Movement
return result;
}
float computeFallElevation(float t_passed)
{
float result;
if (t_passed > terminalFallTime)
{
//result = terminalVelocity * (t_passed - terminal_time) + gravity*terminal_time*terminal_time*0.5f;
// simplified view:
result = terminalVelocity * (t_passed - terminalFallTime) + terminal_length;
}
else
result = t_passed * t_passed * gravity * 0.5f;
return result;
}
#define STR(x) #x
char const* g_MovementFlag_names[] =