Ship Locomotion & Tech Tree Panel
Ship locomotion now accounts for tangential velocity, slows down properly with terminal phase separated into velocity matching behavior Tech tree properties panel visualizes parents and children correctly
This commit is contained in:
parent
af88788e4f
commit
b589a6422c
25 changed files with 1073 additions and 760 deletions
|
|
@ -220,6 +220,16 @@ public static class Extensions
|
|||
|
||||
return t * (t * (a * t + b) + c) + d;
|
||||
}
|
||||
|
||||
public static float AngleDiff(this float2 a, float2 b)
|
||||
{
|
||||
var directionAngle = atan2(b.y, b.x) / PI;
|
||||
var currentAngle = atan2(a.y, a.x) / PI;
|
||||
var d1 = directionAngle - currentAngle;
|
||||
var d2 = directionAngle - 2 - currentAngle;
|
||||
var d3 = directionAngle + 2 - currentAngle;
|
||||
return abs(d1) < abs(d2) ? abs(d1) < abs(d3) ? d1 : d3 : abs(d2) < abs(d3) ? d2 : d3;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/Burtsev-Alexey/net-object-deep-copy
|
||||
|
|
|
|||
Loading…
Reference in a new issue