(3dc4135ce) v0.9.5.1

This commit is contained in:
Regalis
2019-11-21 18:22:25 +01:00
parent b39922a074
commit 5c95c53118
287 changed files with 12655 additions and 5048 deletions
@@ -43,8 +43,19 @@ namespace Barotrauma
}
}
private float rotationRadians;
[Serialize(0.0f, true), Editable]
public float Rotation { get; private set; }
public float Rotation
{
get
{
return MathHelper.ToDegrees(rotationRadians);
}
private set
{
rotationRadians = MathHelper.ToRadians(value);
}
}
[Serialize(AnimationType.None, false), Editable]
public AnimationType RotationAnim { get; private set; }
@@ -118,16 +129,16 @@ namespace Barotrauma
{
if (rotationSpeedRadians <= 0.0f)
{
return Rotation;
return rotationRadians;
}
switch (OffsetAnim)
switch (RotationAnim)
{
case AnimationType.Sine:
rotationState = rotationState % (MathHelper.TwoPi / rotationSpeedRadians);
return Rotation * (float)Math.Sin(rotationState * rotationSpeedRadians);
return rotationRadians * (float)Math.Sin(rotationState * rotationSpeedRadians);
case AnimationType.Noise:
rotationState = rotationState % (1.0f / rotationSpeedRadians);
return Rotation * PerlinNoise.GetPerlin(rotationState * rotationSpeedRadians, rotationState * rotationSpeedRadians);
return rotationRadians * (PerlinNoise.GetPerlin(rotationState * rotationSpeedRadians, rotationState * rotationSpeedRadians) - 0.5f);
default:
return rotationState * rotationSpeedRadians;
}