Rename WRot.Zero to WRot.None.

This commit is contained in:
Paul Chote
2020-07-12 13:46:35 +01:00
committed by tovl
parent 60a7f53491
commit 8c3793e7ea
6 changed files with 7 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ namespace OpenRA
{
get
{
return facing != null ? facing.Orientation : WRot.Zero;
return facing != null ? facing.Orientation : WRot.None;
}
}

View File

@@ -21,7 +21,7 @@ namespace OpenRA
public readonly WAngle Roll, Pitch, Yaw;
public WRot(WAngle roll, WAngle pitch, WAngle yaw) { Roll = roll; Pitch = pitch; Yaw = yaw; }
public static readonly WRot Zero = new WRot(WAngle.Zero, WAngle.Zero, WAngle.Zero);
public static readonly WRot None = new WRot(WAngle.Zero, WAngle.Zero, WAngle.Zero);
public static WRot FromFacing(int facing) { return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing)); }
public static WRot FromYaw(WAngle yaw) { return new WRot(WAngle.Zero, WAngle.Zero, yaw); }

View File

@@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Activities
// Approach landing from the opposite direction of the desired facing
// TODO: Calculate sensible trajectory without preferred facing.
var rotation = WRot.Zero;
var rotation = WRot.None;
if (desiredFacing.HasValue)
rotation = WRot.FromYaw(desiredFacing.Value);

View File

@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Graphics
{
var facingInfo = Actor.TraitInfoOrDefault<IFacingInfo>();
if (facingInfo == null)
return () => WRot.Zero;
return () => WRot.None;
// Dynamic facing takes priority
var dynamicInit = reference.GetOrDefault<DynamicFacingInit>();

View File

@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits.Render
var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero);
var turretOffset = turreted != null ? turreted.Position(self) : WVec.Zero;
var quantizedBody = body.QuantizeOrientation(self, self.Orientation);
var turretOrientation = turreted != null ? turreted.WorldOrientation(self) - quantizedBody : WRot.Zero;
var turretOrientation = turreted != null ? turreted.WorldOrientation(self) - quantizedBody : WRot.None;
var quantizedTurret = body.QuantizeOrientation(self, turretOrientation);
return turretOffset + body.LocalToWorld(localOffset.Rotate(quantizedTurret).Rotate(quantizedBody));

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public readonly WVec LocalOffset = WVec.Zero;
[Desc("Rotate the barrel relative to the body")]
public readonly WRot LocalOrientation = WRot.Zero;
public readonly WRot LocalOrientation = WRot.None;
[Desc("Defines if the Voxel should have a shadow.")]
public readonly bool ShowShadow = true;
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Traits.Render
var qb = body.QuantizeOrientation(self, b);
var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero);
var turretLocalOffset = turreted != null ? turreted.Offset : WVec.Zero;
var turretOrientation = turreted != null ? turreted.WorldOrientation(self) - b + WRot.FromYaw(b.Yaw - qb.Yaw) : WRot.Zero;
var turretOrientation = turreted != null ? turreted.WorldOrientation(self) - b + WRot.FromYaw(b.Yaw - qb.Yaw) : WRot.None;
return body.LocalToWorld((turretLocalOffset + localOffset.Rotate(turretOrientation)).Rotate(qb));
}