Convert turret facings to WAngle relative to the body.

This commit is contained in:
Paul Chote
2020-07-18 12:41:22 +01:00
committed by reaperrr
parent 70a86bed7a
commit 75cb5c2166
15 changed files with 189 additions and 192 deletions

View File

@@ -110,9 +110,15 @@ namespace OpenRA.Mods.Common.Traits
foreach (var b in a.Barrels)
{
var barrelEnd = new Barrel
{
Offset = b.Offset + new WVec(224, 0, 0),
Yaw = b.Yaw
};
var muzzle = self.CenterPosition + a.MuzzleOffset(self, b);
var dirOffset = new WVec(0, -224, 0).Rotate(a.MuzzleOrientation(self, b));
yield return new LineAnnotationRenderable(muzzle, muzzle + dirOffset, 1, Color.White);
var endMuzzle = self.CenterPosition + a.MuzzleOffset(self, barrelEnd);
yield return new LineAnnotationRenderable(muzzle, endMuzzle, 1, Color.White);
}
}
}