Particles that rotate towards the movement direction use sub-relative movement when inside the sub (weld/cut particles don't face the movement direction of the submarine anymore).
This commit is contained in:
@@ -168,7 +168,12 @@ namespace Barotrauma.Particles
|
|||||||
{
|
{
|
||||||
if (velocityChange != Vector2.Zero || angularVelocity != 0.0f)
|
if (velocityChange != Vector2.Zero || angularVelocity != 0.0f)
|
||||||
{
|
{
|
||||||
rotation = MathUtils.VectorToAngle(new Vector2(velocity.X, -velocity.Y));
|
Vector2 relativeVel = velocity;
|
||||||
|
if (currentHull?.Submarine != null)
|
||||||
|
{
|
||||||
|
relativeVel -= ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity);
|
||||||
|
}
|
||||||
|
rotation = MathUtils.VectorToAngle(new Vector2(relativeVel.X, -relativeVel.Y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user