Rename WRot.Zero to WRot.None.
This commit is contained in:
@@ -69,7 +69,7 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return facing != null ? facing.Orientation : WRot.Zero;
|
return facing != null ? facing.Orientation : WRot.None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace OpenRA
|
|||||||
public readonly WAngle Roll, Pitch, Yaw;
|
public readonly WAngle Roll, Pitch, Yaw;
|
||||||
|
|
||||||
public WRot(WAngle roll, WAngle pitch, WAngle yaw) { Roll = roll; Pitch = pitch; Yaw = 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 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); }
|
public static WRot FromYaw(WAngle yaw) { return new WRot(WAngle.Zero, WAngle.Zero, yaw); }
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
|
|
||||||
// Approach landing from the opposite direction of the desired facing
|
// Approach landing from the opposite direction of the desired facing
|
||||||
// TODO: Calculate sensible trajectory without preferred facing.
|
// TODO: Calculate sensible trajectory without preferred facing.
|
||||||
var rotation = WRot.Zero;
|
var rotation = WRot.None;
|
||||||
if (desiredFacing.HasValue)
|
if (desiredFacing.HasValue)
|
||||||
rotation = WRot.FromYaw(desiredFacing.Value);
|
rotation = WRot.FromYaw(desiredFacing.Value);
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Graphics
|
|||||||
{
|
{
|
||||||
var facingInfo = Actor.TraitInfoOrDefault<IFacingInfo>();
|
var facingInfo = Actor.TraitInfoOrDefault<IFacingInfo>();
|
||||||
if (facingInfo == null)
|
if (facingInfo == null)
|
||||||
return () => WRot.Zero;
|
return () => WRot.None;
|
||||||
|
|
||||||
// Dynamic facing takes priority
|
// Dynamic facing takes priority
|
||||||
var dynamicInit = reference.GetOrDefault<DynamicFacingInit>();
|
var dynamicInit = reference.GetOrDefault<DynamicFacingInit>();
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero);
|
var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero);
|
||||||
var turretOffset = turreted != null ? turreted.Position(self) : WVec.Zero;
|
var turretOffset = turreted != null ? turreted.Position(self) : WVec.Zero;
|
||||||
var quantizedBody = body.QuantizeOrientation(self, self.Orientation);
|
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);
|
var quantizedTurret = body.QuantizeOrientation(self, turretOrientation);
|
||||||
return turretOffset + body.LocalToWorld(localOffset.Rotate(quantizedTurret).Rotate(quantizedBody));
|
return turretOffset + body.LocalToWorld(localOffset.Rotate(quantizedTurret).Rotate(quantizedBody));
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public readonly WVec LocalOffset = WVec.Zero;
|
public readonly WVec LocalOffset = WVec.Zero;
|
||||||
|
|
||||||
[Desc("Rotate the barrel relative to the body")]
|
[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.")]
|
[Desc("Defines if the Voxel should have a shadow.")]
|
||||||
public readonly bool ShowShadow = true;
|
public readonly bool ShowShadow = true;
|
||||||
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
var qb = body.QuantizeOrientation(self, b);
|
var qb = body.QuantizeOrientation(self, b);
|
||||||
var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero);
|
var localOffset = Info.LocalOffset + new WVec(-armament.Recoil, WDist.Zero, WDist.Zero);
|
||||||
var turretLocalOffset = turreted != null ? turreted.Offset : WVec.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));
|
return body.LocalToWorld((turretLocalOffset + localOffset.Rotate(turretOrientation)).Rotate(qb));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user