mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
[Sync] Some project sync
This commit is contained in:
parent
b25fa433fe
commit
bbf0020c1a
98 changed files with 5866 additions and 2121 deletions
|
|
@ -40,7 +40,7 @@ namespace Movement
|
|||
float u = 1.f;
|
||||
int32 seg_time = spline.length(point_Idx, point_Idx + 1);
|
||||
if (seg_time > 0)
|
||||
u = (time_passed - spline.length(point_Idx)) / (float)seg_time;
|
||||
{ u = (time_passed - spline.length(point_Idx)) / (float)seg_time; }
|
||||
Location c;
|
||||
c.orientation = initialOrientation;
|
||||
spline.evaluate_percent(point_Idx, u, c);
|
||||
|
|
@ -50,14 +50,14 @@ namespace Movement
|
|||
else if (splineflags.parabolic)
|
||||
computeParabolicElevation(c.z);
|
||||
else if (splineflags.falling)
|
||||
computeFallElevation(c.z);
|
||||
{ computeFallElevation(c.z); }
|
||||
|
||||
if (splineflags.done && splineflags.isFacing())
|
||||
{
|
||||
if (splineflags.final_angle)
|
||||
c.orientation = facing.angle;
|
||||
{ c.orientation = facing.angle; }
|
||||
else if (splineflags.final_point)
|
||||
c.orientation = atan2(facing.f.y - c.y, facing.f.x - c.x);
|
||||
{ c.orientation = atan2(facing.f.y - c.y, facing.f.x - c.x); }
|
||||
// nothing to do for MoveSplineFlag::Final_Target flag
|
||||
}
|
||||
else
|
||||
|
|
@ -93,9 +93,9 @@ namespace Movement
|
|||
float z_now = spline.getPoint(spline.first()).z - Movement::computeFallElevation(MSToSec(time_passed));
|
||||
float final_z = FinalDestination().z;
|
||||
if (z_now < final_z)
|
||||
el = final_z;
|
||||
{ el = final_z; }
|
||||
else
|
||||
el = z_now;
|
||||
{ el = z_now; }
|
||||
}
|
||||
|
||||
inline uint32 computeDuration(float length, float velocity)
|
||||
|
|
@ -294,11 +294,11 @@ namespace Movement
|
|||
str << "spline Id: " << GetId() << std::endl;
|
||||
str << "flags: " << splineflags.ToString() << std::endl;
|
||||
if (splineflags.final_angle)
|
||||
str << "facing angle: " << facing.angle;
|
||||
{ str << "facing angle: " << facing.angle; }
|
||||
else if (splineflags.final_target)
|
||||
str << "facing target: " << facing.target;
|
||||
{ str << "facing target: " << facing.target; }
|
||||
else if (splineflags.final_point)
|
||||
str << "facing point: " << facing.f.x << " " << facing.f.y << " " << facing.f.z;
|
||||
{ str << "facing point: " << facing.f.x << " " << facing.f.y << " " << facing.f.z; }
|
||||
str << std::endl;
|
||||
str << "time passed: " << time_passed << std::endl;
|
||||
str << "total time: " << Duration() << std::endl;
|
||||
|
|
@ -319,7 +319,7 @@ namespace Movement
|
|||
{
|
||||
int32 point = point_Idx_offset + point_Idx - spline.first() + (int)Finalized();
|
||||
if (isCyclic())
|
||||
point = point % (spline.last() - spline.first());
|
||||
{ point = point % (spline.last() - spline.first()); }
|
||||
return point;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue