如何在 XNA 中旋转静态模型?模型被加载到一个名为“ModelManager”的单独类中:
我需要旋转名为“track_new”的模型,但它与其他模型作为一个整体存储。旋转会在“modelManager”类还是主“Game!.cs”文件下进行?
这是我的代码:
public class ModelManager : DrawableGameComponent
{
List<BasicModel> models = new List<BasicModel>();
public ModelManager(Game game) : base(game) { }
public override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
models.Add(new BasicModel(Game.Content.Load<Model>(@"Models\track_new")));
base.LoadContent();
}
public override void Update(GameTime gameTime)
{
for (int i = 0; i < models.Count; ++i)
models[i].Update();
base.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
foreach (BasicModel bm in models)
bm.Draw(((Game1)Game).camera);
base.Draw(gameTime);
}
}