BEPUphysicsDrawer.Models.DisplayModel.Draw C# (CSharp) Метод

Draw() публичный Метод

Draws the display object.
public Draw ( BEPUutilities.Matrix viewMatrix, BEPUutilities.Matrix projectionMatrix ) : void
viewMatrix BEPUutilities.Matrix Current view matrix.
projectionMatrix BEPUutilities.Matrix Current projection matrix.
Результат 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.
            model.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;
                        effect.AmbientLightColor = Color;

                        if (Texture != null)
                        {
                            effect.TextureEnabled = true;
                            effect.Texture = Texture;
                        }
                        else
                            effect.TextureEnabled = false;
                    }
                }
                Model.Meshes[i].Draw();
            }
        }