public void Draw(Camera camera) { m_effect.WorldMatrix = m_level.Transform; m_effect.ModelMatrix = Matrix4.Identity; m_effect.ViewMatrix = camera.Transform; m_effect.ProjectionMatrix = camera.CreateProjectionMatrix(); m_effect.Bind(); m_geometry.Draw(); }
public void Draw(Camera camera) { if (m_visible) { m_effect.WorldMatrix = m_level.Transform; m_effect.ModelMatrix = Matrix4.Identity; m_effect.ViewMatrix = camera.Transform; m_effect.ProjectionMatrix = camera.CreateProjectionMatrix(); m_effect.DiffuseColour = m_red ? new Vector4(0.6f, 0.0f, 0.0f, 1.0f) : new Vector4(0.6f, 0.6f, 0.6f, 1.0f); m_effect.Bind(); m_geometry.Draw(); } }
protected override void OnDraw() { base.OnDraw(); // Rebuild m_debugGeometry.Clear(); m_debugGeometry.AddLine(Vector3.Zero, -Game.Sky.Sky.LightDirection.Normalised() * 10.0f, new Vector4(Game.Sky.Sky.LightColour, 1.0f)); m_debugGeometry.AddLine(Vector3.Zero, -Game.Sky.Sky.Light2Direction.Normalised() * 10.0f, new Vector4(Game.Sky.Sky.Light2Colour, 1.0f)); m_debugGeometry.Rebuild(); // Draw m_debugEffect.WorldMatrix = Matrix4.Identity; m_debugEffect.ModelMatrix = Matrix4.Identity; m_debugEffect.ViewMatrix = Game.Camera.Transform; m_debugEffect.ProjectionMatrix = Game.Camera.CreateProjectionMatrix(); m_debugEffect.Bind(); m_debugGeometry.Draw(); }