Convert IFacing.Facing and TurnSpeed to WAngle.
This commit is contained in:
@@ -69,8 +69,8 @@ namespace OpenRA
|
||||
get
|
||||
{
|
||||
// TODO: Support non-zero pitch/roll in IFacing (IOrientation?)
|
||||
var facingValue = facing != null ? facing.Facing : 0;
|
||||
return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facingValue));
|
||||
var facingValue = facing != null ? facing.Facing : WAngle.Zero;
|
||||
return new WRot(WAngle.Zero, WAngle.Zero, facingValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -941,13 +941,13 @@ namespace OpenRA
|
||||
return projectedHeight[(MPos)puv];
|
||||
}
|
||||
|
||||
public int FacingBetween(CPos cell, CPos towards, int fallbackfacing)
|
||||
public WAngle FacingBetween(CPos cell, CPos towards, WAngle fallbackfacing)
|
||||
{
|
||||
var delta = CenterOfCell(towards) - CenterOfCell(cell);
|
||||
if (delta.HorizontalLengthSquared == 0)
|
||||
return fallbackfacing;
|
||||
|
||||
return delta.Yaw.Facing;
|
||||
return delta.Yaw;
|
||||
}
|
||||
|
||||
public void Resize(int width, int height)
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace OpenRA.Traits
|
||||
public interface IFacing
|
||||
{
|
||||
int TurnSpeed { get; }
|
||||
int Facing { get; set; }
|
||||
WAngle Facing { get; set; }
|
||||
}
|
||||
|
||||
public interface IFacingInfo : ITraitInfoInterface { int GetInitialFacing(); }
|
||||
|
||||
Reference in New Issue
Block a user