public override void Draw(Matrix viewMatrix, Matrix projectionMatrix)
{
//This is not a particularly fast method of drawing.
//It's used very rarely in the demos.
myModel.CopyAbsoluteBoneTransformsTo(transforms);
for (int i = 0; i < Model.Meshes.Count; i++)
{
for (int j = 0; j < Model.Meshes[i].Effects.Count; j++)
{
var effect = Model.Meshes[i].Effects[j] as BasicEffect;
if (effect != null)
{
effect.World = transforms[Model.Meshes[i].ParentBone.Index] * WorldTransform;
effect.View = viewMatrix;
effect.Projection = projectionMatrix;
}
}
Model.Meshes[i].Draw();
}
}
}