Beispiel #1
0
 public override void Render(IGameContext gameContext, IRenderContext renderContext)
 {
     if (renderContext.Is3DContext)
     {
         _renderUtilities.RenderCube(
             renderContext,
             Matrix.CreateTranslation(new Vector3(this.X, this.Y, this.Z)),
             new Color(194, 194, 194));
     }
 }
Beispiel #2
0
 public override void Render(IGameContext gameContext, IRenderContext renderContext)
 {
     if (renderContext.Is3DContext)
     {
         _renderUtilities.RenderCube(
             renderContext,
             GetFinalMatrix(),
             new Color(194, 194, 194));
     }
 }
        public void Render(ComponentizedEntity entity, IGameContext gameContext, IRenderContext renderContext)
        {
            if (!Enabled)
            {
                return;
            }

            if (renderContext.IsCurrentRenderPass <I3DRenderPass>())
            {
                _renderUtilities.RenderCube(
                    renderContext,
                    Effect,
                    Effect.CreateParameterSet(),
                    Matrix.CreateTranslation(-0.5f, -0.5f, -0.5f) *
                    FinalTransform.AbsoluteMatrix,
                    Color);
            }
        }
        public void Render(ComponentizedEntity entity, IGameContext gameContext, IRenderContext renderContext)
        {
            if (!Enabled)
            {
                return;
            }

            if (renderContext.IsCurrentRenderPass <I3DRenderPass>())
            {
                IEffect effect;
                if (Effect != null)
                {
                    effect = Effect;
                }
                else if (_defaultSurfaceEffect.IsReady)
                {
                    effect = _defaultSurfaceEffect.Asset.Effects?["Color"];
                }
                else
                {
                    return;
                }

                if (effect == null)
                {
                    return;
                }

                _renderUtilities.RenderCube(
                    renderContext,
                    effect,
                    effect.CreateParameterSet(),
                    Matrix.CreateTranslation(-0.5f, -0.5f, -0.5f) *
                    FinalTransform.AbsoluteMatrix,
                    Color);
            }
        }