BEPUphysicsDrawer.Models.DisplayEntityModel.Draw C# (CSharp) Method

Draw() public method

Draws the display object.
public Draw ( Matrix viewMatrix, Matrix projectionMatrix ) : void
viewMatrix Microsoft.Xna.Framework.Matrix Current view matrix.
projectionMatrix Microsoft.Xna.Framework.Matrix Current projection matrix.
return void
        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();
            }
        }
    }