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

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var body = init.Actor.TraitInfo<BodyOrientationInfo>();
var model = init.World.ModelCache.GetModelSequence(image, IdleSequence);
yield return new ModelAnimation(model, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(orientation(), facings) },
() => body.QuantizeOrientation(orientation(), facings),
() => false, () => 0, ShowShadow);
}
}
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var idleModel = self.World.ModelCache.GetModelSequence(rv.Image, info.IdleSequence);
modelAnimation = new ModelAnimation(idleModel, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(self, self.Orientation) },
() => body.QuantizeOrientation(self, self.Orientation),
() => Docked,
() => 0, info.ShowShadow);
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var unloadModel = self.World.ModelCache.GetModelSequence(rv.Image, info.UnloadSequence);
rv.Add(new ModelAnimation(unloadModel, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(self, self.Orientation) },
() => body.QuantizeOrientation(self, self.Orientation),
() => !Docked,
() => 0, info.ShowShadow));
}

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var frame = init.GetValue<BodyAnimationFrameInit, uint>(this, 0);
yield return new ModelAnimation(model, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(orientation(), facings) },
() => body.QuantizeOrientation(orientation(), facings),
() => false, () => frame, ShowShadow);
}
}
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var model = self.World.ModelCache.GetModelSequence(rv.Image, info.Sequence);
frames = model.Frames;
modelAnimation = new ModelAnimation(model, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(self, self.Orientation) },
() => body.QuantizeOrientation(self, self.Orientation),
() => false, () => frame, info.ShowShadow);
rv.Add(modelAnimation);