Esempio n. 1
0
        public void DrawBackground(Camera camera)
        {
            if (m_model != null)
            {
                // Setup transforms
                var cameraTrans = camera.Transform;
                cameraTrans.Row3 = new Vector4(0.0f, 0.0f, 0.0f, 1.0f);

                m_litEffect.WorldMatrix      = Matrix4.Identity;
                m_litEffect.ModelMatrix      = m_model.Transform;
                m_litEffect.ViewMatrix       = cameraTrans;
                m_litEffect.ProjectionMatrix = camera.CreateProjectionMatrix();

                m_litEffect.WorldMatrix      = m_litEffect.WorldMatrix;
                m_litEffect.ModelMatrix      = m_litEffect.ModelMatrix;
                m_litEffect.ViewMatrix       = m_litEffect.ViewMatrix;
                m_litEffect.ProjectionMatrix = m_litEffect.ProjectionMatrix;

                // Draw the geometry
                m_litEffect.AmbientLight.Colour = m_ambientColour;
                m_litEffect.Light.Colour        = m_lightColour;
                m_litEffect.Light.Direction     = m_lightDirection;
                m_litEffect.Light.Active        = (m_lightColour.LengthSquared > 0.0f);
                m_litEffect.Light2.Colour       = m_light2Colour;
                m_litEffect.Light2.Direction    = m_light2Direction;
                m_litEffect.Light2.Active       = (m_light2Colour.LengthSquared > 0.0f);
                m_model.Draw(m_litEffect);
            }
        }
Esempio n. 2
0
 protected override void OnDraw(ModelEffectInstance modelEffect, RenderPass pass)
 {
     if (m_model != null && !Tile.IsHidden(Level, Location))
     {
         m_model.Draw(modelEffect);
     }
 }
Esempio n. 3
0
        public void Draw(DrawState state)
        {
            //ModelInstances automatically setup the default material shaders
            //Custom shaders can be used with model.SetShaderOverride(...)
            model.Draw(state);

            DrawBoundingBoxes(state);
        }
Esempio n. 4
0
        public void Draw(DrawState state)
        {
            state.PushWorldMatrixMultiply(ref this.worldMatrix);

            model.Draw(state);

            state.PopWorldMatrix();
        }
Esempio n. 5
0
 protected override void OnDraw(ModelEffectInstance modelEffect, RenderPass pass)
 {
     if (Level.InEditor && Tile.IsHidden(Level, Location))
     {
         return;
     }
     m_modelInstance.Draw(modelEffect);
 }
Esempio n. 6
0
 protected override void OnDraw(ModelEffectInstance modelEffect, RenderPass pass)
 {
     if (Level.InEditor && Level.Tiles[m_spawnPosition].IsHidden(Level, m_spawnPosition))
     {
         return;
     }
     m_modelInstance.Draw(modelEffect);
 }
Esempio n. 7
0
 protected override void OnDraw(ModelEffectInstance modelEffect, RenderPass pass)
 {
     if (CurrentState.State != FallState.Landed)
     {
         if (m_modelInstance != null)
         {
             m_modelInstance.Draw(modelEffect);
         }
     }
 }
Esempio n. 8
0
 public void DrawForeground(ModelEffectInstance effect, RenderPass pass)
 {
     if (m_foregroundModel != null && m_sky.ForegroundRenderPass == pass)
     {
         var worldMatrix = effect.WorldMatrix;
         effect.WorldMatrix = Matrix4.Identity;
         m_foregroundModel.Draw(effect);
         effect.WorldMatrix = worldMatrix;
     }
 }
Esempio n. 9
0
 protected override void OnDraw(ModelEffectInstance modelEffect, RenderPass pass)
 {
     if (!Level.Tiles[Location].IsHidden(Level, Location))
     {
         if (m_modelInstance != null)
         {
             m_modelInstance.Draw(modelEffect);
         }
     }
 }
Esempio n. 10
0
        public void Draw(DrawState state)
        {
            //make sure the world matrix is up to date
            UpdateWorldMatrix();

            //draw the model
            state.PushWorldMatrixMultiply(ref this.worldMatrix);

            model.Draw(state);

            state.PopWorldMatrix();
        }
Esempio n. 11
0
        public void Draw(DrawState state)
        {
            state.PushWorldMatrix(ref worldMatrix);

            //ModelInstances automatically setup the default material shaders
            //Custom shaders can be used with model.SetShaderOverride(...)

            //ModelData stores accurate bounding box information
            //the ModelInstance uses this to cull the model
            if (model.CullTest(state))
            {
                model.Draw(state);
            }

            state.PopWorldMatrix();
        }
Esempio n. 12
0
        protected override void OnDraw(ModelEffectInstance effect, RenderPass pass)
        {
            var alpha = CalculateCurrentGhostAlpha();

            if (alpha > 0.0f)
            {
                m_ghostModel.Alpha = alpha;
                m_ghostModel.Draw(effect);
            }

            effect.ModelMatrix     = m_ghostModel.Transform;
            effect.UVOffset        = Vector2.Zero;
            effect.UVScale         = Vector2.One;
            effect.DiffuseColour   = Vector4.One;
            effect.DiffuseTexture  = Texture.White;
            effect.SpecularColour  = Vector3.Zero;
            effect.SpecularTexture = Texture.Black;
            effect.NormalTexture   = Texture.Black;
            effect.EmissiveColour  = Vector3.One;
            effect.EmissiveTexture = Texture.White;
            effect.Bind();
            //m_shell.Draw();
        }
Esempio n. 13
0
 public void Draw(DrawState state)
 {
     model.Draw(state);
 }
Esempio n. 14
0
 protected override void OnDraw(ModelEffectInstance modelEffect, RenderPass pass)
 {
     m_model.Draw(modelEffect);
 }