Ejemplo n.º 1
0
        public static IEnumerable <Zone> GetConnectedZones(Zone zone)
        {
            IEnumerable <Zone> result = new Zone[] { zone };

            foreach (Entity e in zone.ConnectedEntities)
            {
                Zone z;
                if (e != null && (z = e.Get <Zone>()) != null)
                {
                    result = result.Concat(Zone.GetConnectedZones(z));
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
 private static IEnumerable <NonAxisAlignedBoundingBox> getActiveBoundingBoxes(Camera camera, Zone currentZone)
 {
     if (currentZone == null)
     {
         Vector3 pos    = camera.Position;
         float   radius = camera.FarPlaneDistance;
         return(new[] { new NonAxisAlignedBoundingBox {
                            BoundingBox = new BoundingBox(pos - new Vector3(radius), pos + new Vector3(radius)), Transform = Matrix.Identity
                        } });
     }
     else
     {
         return(Zone.GetConnectedZones(currentZone).Select(x => new NonAxisAlignedBoundingBox {
             BoundingBox = x.BoundingBox, Transform = Matrix.Invert(x.Transform)
         }).ToList());
     }
 }