示例#1
0
        public override void OnRender(Gaia.Rendering.RenderViews.RenderView view)
        {
            BoundingFrustum frustum = view.GetFrustum();
            for (int i = 0; i < clusters.Keys.Count; i++)
            {
                Material key = clusters.Keys[i];

                List<Matrix> elemsMatrix = new List<Matrix>();

                for (int j = 0; j < clusters[key].Count; j++)
                {
                    if(frustum.Contains(clusters[key][j].Bounds) != ContainmentType.Disjoint)
                    {
                        elemsMatrix.AddRange(clusters[key][j].Transform);
                    }
                }

                renderElements[i].Transform = elemsMatrix.ToArray();
                view.AddElement(key, renderElements[i]);
            }
            base.OnRender(view);
        }
示例#2
0
 public override void OnRender(Gaia.Rendering.RenderViews.RenderView view)
 {
     if(view.GetFrustum().Contains(this.Transformation.GetBounds()) != ContainmentType.Disjoint)
     {
         view.AddElement(projectileMaterial, renderElement);
     }
     base.OnRender(view);
 }