Exemplo n.º 1
0
 public void Render(Camera camera)
 {
     foreach (var renderer in meshOctree.Query(camera.ViewFrustum))
     {
         renderer.Render(camera);
     }
 }
Exemplo n.º 2
0
        private IEnumerable <IMeshRenderer> GetMeshesToRender(Camera camera)
        {
            var renderers = worldOctree.Query(camera.ViewFrustum);

            renderers.Sort((a, b) =>
                           (a.BoundingBox.Center - camera.Location).Length < (b.BoundingBox.Center - camera.Location).Length ? 1 : -1);

            return(renderers);
        }