protected override void DeferRenderable(RenderNode renderable)
        {
            // Only accepts models right now for this renderer
            Type type = renderable.GetType();

            if ((type == typeof(SpriteNode)) || (type.IsSubclassOf(typeof(SpriteNode))))
            {
                SpriteNode spriteNode = (renderable as SpriteNode);

                if (spriteNode != null)
                {
                    // Add to sprite pool
                    m_Sprites.Add(spriteNode);
                }
            }
        }
Exemple #2
0
 public TerrainLoadedEvent(RenderNode terrain)
 {
     m_Terrain = terrain;
 }
        protected override void DeferRenderable(RenderNode renderable)
        {
            // Only accepts models right now for this renderer
            Type type = renderable.GetType();

            if ( renderable.InheritsFrom<ModelNode>() )
            {
                ModelNode modelNode = (renderable as ModelNode);
                Mesh mesh = modelNode.Mesh;

                if (mesh != null)
                {
                    // Setup mesh
                    SetupMesh(mesh);

                    // Add Mesh
                    m_Meshes.Add(mesh);

                    if (mesh.SubMeshes.Count > 0)
                    {
                        // FOR NOW ADD ALL SUB MESHES TO THE RENDER LIST ( NOT OPTIMISED YET )
                        for (int i = 0; i < mesh.SubMeshes.Count; i++)
                        {
                            SubMesh subMesh = mesh.SubMeshes[i];

                            //if (camera.Frustum.Intersects(subMesh.GlobalBoundingBox))
                            //{
                            m_VisibleMeshes[(int)subMesh.RenderQueue].Add(subMesh);
                            //}
                        }
                    }
                    else
                    {
                        // Otherwise just add the mesh as there are no sub meshses
                        m_VisibleMeshes[(int)mesh.RenderQueue].Add(mesh);
                    }
                }
            }
        }
        public bool RemoveRenderNode(RenderNode renderNode)
        {
            bool toRet = false;

            if (m_RenderNodes.Contains(renderNode))
            {
                m_RenderNodes.Remove(renderNode);
                toRet = true;
            }

            return toRet;
        }
        public bool Contains(RenderNode renderNode)
        {
            bool toRet = false;

            if (m_RenderNodes.Count > 0)
            {
                if (m_RenderNodes.Contains(renderNode))
                    toRet = true;
            }

            return toRet;
        }
 protected virtual void DeferRenderable(RenderNode renderable)
 {
     if (!m_RenderNodes.Contains(renderable))
         m_RenderNodes.Add(renderable);
 }