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
|
|
@ -52,7 +52,7 @@ public class Turning : IAnalogBehavior
|
|||
|
||||
public void Update(float delta)
|
||||
{
|
||||
Entity.Direction = mul(Entity.Direction, Unity.Mathematics.float2x2.Rotate(_turning * Context.Evaluate(_data.Torque, Item, Entity) * delta));
|
||||
Entity.Direction = mul(Entity.Direction, Unity.Mathematics.float2x2.Rotate(_turning * Context.Evaluate(_data.Torque, Item, Entity) / Entity.Mass * delta));
|
||||
Entity.AddHeat(abs(_turning) * Context.Evaluate(_data.Heat, Item, Entity) * delta);
|
||||
Entity.VisibilitySources[this] = abs(_turning) * Context.Evaluate(_data.Visibility, Item, Entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,5 +39,8 @@ public class VelocityLimit : IBehavior
|
|||
|
||||
public void Update(float delta)
|
||||
{
|
||||
var limit = Context.Evaluate(_data.TopSpeed, Item, Entity);
|
||||
if (length(Entity.Velocity) > limit)
|
||||
Entity.Velocity = normalize(Entity.Velocity) * limit;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue