Ejemplo n.º 1
0
 /// <summary>
 /// Removes a renderable from the list of drawable renderables.
 /// </summary>
 /// <param name="renderable"></param>
 public void removeRenderable(IRenderable3D renderable, int layer)
 {
     if (layer >= MAX_LAYERS)
         return;
     foreach (RenderLayer renderLayer in m_layers)
     {
         if (renderLayer.Layer == layer)
         {
             renderLayer.Renderables.Remove(renderable);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a renderable to the list of drawable renderables.
 /// </summary>
 /// <param name="renderable"></param>
 public void addRenderable(IRenderable3D renderable, int layer)
 {
     if (layer >= MAX_LAYERS)
         return;
     foreach (RenderLayer renderLayer in m_layers)
     {
         if (renderLayer.Layer == layer)
         {
             renderLayer.Renderables.Add(renderable);
             return;
         }
         else if (renderLayer.Layer > layer)
         {
             // TODO log!!
             return;
         }
     }
 }
Ejemplo n.º 3
0
        public void moveToOtherLayer(IRenderable3D renderable, int oldLayer, int newLayer)
        {
            // remove from old layer
            foreach (RenderLayer renderLayer in m_layers)
            {
                if (renderLayer.Layer == oldLayer)
                {
                    if (!renderLayer.Renderables.Contains(renderable))
                        return;
                    else
                        renderLayer.Renderables.Remove(renderable);
                }
            }

            foreach (RenderLayer renderLayer in m_layers)
            {
                if (renderLayer.Layer == newLayer)
                {
                    renderLayer.Renderables.Add(renderable);
                    return;
                }
            }
        }
Ejemplo n.º 4
0
 public void PushRenderable(IRenderable3D renderable)
 {
     m_currentRenderable.Push(renderable);
     Matrix scale = Matrix.CreateScale(renderable.Scale);
     Matrix rot = Matrix.CreateFromQuaternion(renderable.Orientation);
     Matrix trans = Matrix.CreateTranslation(renderable.Position);
     m_currentWorld.Push(scale * rot * trans);
 }