Skip to content

Commit 4e5964b

Browse files
Use NewtonComplex movement and call SetTrueAnomalyIndex on NewtonMoveIcon each physics update
1 parent 52be4a9 commit 4e5964b

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Pulsar4X/GameEngine/Movement/MoveState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public static void ProcessForType(NewtonMoveDB movedb, DateTime atDateTime)
323323
movedb.OwningEntity.SetDataBlob(stateDB);
324324
}
325325

326-
stateDB.MoveType = PositionDB.MoveTypes.NewtonSimple;
326+
stateDB.MoveType = PositionDB.MoveTypes.NewtonComplex;
327327
// Only update parent if it has changed to avoid expensive SetParent operation
328328
if (stateDB.Parent != movedb.SOIParent)
329329
stateDB.SetParent(movedb.SOIParent);

Pulsar4X/Pulsar4X.Client/Rendering/Icons/NewtonMoveIcon.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ public override void OnPhysicsUpdate()
158158
_ke = ke;
159159
CreatePointArray();
160160
}
161+
else
162+
{
163+
//update the true anomaly index so the trail follows the ship
164+
SetTrueAnomalyIndex();
165+
}
161166

162167
if (_newtonMoveDB.ManuverDeltaVLen > 0)
163168
{

Pulsar4X/Pulsar4X.Client/Rendering/Icons/NewtonSimpleIcon.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ public override void OnPhysicsUpdate()
137137
_ke = ke;
138138
CreatePointArray();
139139
}
140-
141140
else
142141
{
142+
//update the true anomaly index so the trail follows the ship
143+
SetTrueAnomalyIndex();
143144
_thrustLinePoints[1] = Vector2.Zero;
144145
}
145146
}

0 commit comments

Comments
 (0)