Pass pre-combined rotations into the rendering code.

This commit is contained in:
Paul Chote
2020-07-12 13:59:09 +01:00
committed by tovl
parent 3c9db4c2ac
commit aae497eff1
9 changed files with 28 additions and 32 deletions

View File

@@ -183,8 +183,8 @@ namespace OpenRA.Mods.Common.Graphics
foreach (var v in draw)
{
var bounds = v.Model.Bounds(v.FrameFunc());
var worldTransform = v.RotationFunc().Reverse().Aggregate(scaleTransform,
(x, y) => OpenRA.Graphics.Util.MatrixMultiply(x, OpenRA.Graphics.Util.MakeFloatMatrix(y.AsMatrix())));
var rotation = OpenRA.Graphics.Util.MakeFloatMatrix(v.RotationFunc().AsMatrix());
var worldTransform = OpenRA.Graphics.Util.MatrixMultiply(scaleTransform, rotation);
var pxPos = pxOrigin + wr.ScreenVectorComponents(v.OffsetFunc());
var screenTransform = OpenRA.Graphics.Util.MatrixMultiply(cameraTransform, worldTransform);
@@ -241,8 +241,8 @@ namespace OpenRA.Mods.Common.Graphics
foreach (var v in draw)
{
var bounds = v.Model.Bounds(v.FrameFunc());
var worldTransform = v.RotationFunc().Reverse().Aggregate(scaleTransform,
(x, y) => OpenRA.Graphics.Util.MatrixMultiply(x, OpenRA.Graphics.Util.MakeFloatMatrix(y.AsMatrix())));
var rotation = OpenRA.Graphics.Util.MakeFloatMatrix(v.RotationFunc().AsMatrix());
var worldTransform = OpenRA.Graphics.Util.MatrixMultiply(scaleTransform, rotation);
var pxPos = pxOrigin + wr.ScreenVectorComponents(v.OffsetFunc());
var screenTransform = OpenRA.Graphics.Util.MatrixMultiply(cameraTransform, worldTransform);