public IEnumerable <MyEnvironmentSector> GetSectorsInRange(MyShape shape)
        {
            var bb            = shape.GetWorldBoundaries();
            var hierarchyComp = Container.Get <MyHierarchyComponentBase>() as MyHierarchyComponent <MyEntity>;
            var entities      = new List <MyEntity>();

            hierarchyComp.QueryAABB(ref bb, entities);

            return(entities.Cast <MyEnvironmentSector>());
        }
Пример #2
0
 static bool CanPlaceInArea(OperationType type, MyShape Shape)
 {
     if (type == OperationType.Fill)
     {
         m_foundElements.Clear();
         BoundingBoxD box = Shape.GetWorldBoundaries();
         MyEntities.GetElementsInBox(ref box, m_foundElements);
         foreach (var entity in m_foundElements)
         {
             if (IsForbiddenEntity(entity))
             {
                 if (entity.PositionComp.WorldAABB.Intersects(box))
                 {
                     return(false);
                 }
             }
         }
     }
     return(true);
 }
Пример #3
0
 static bool CanPlaceInArea(OperationType type, MyShape Shape)
 {
     if (type == OperationType.Fill)
     {
         m_foundElements.Clear();
         BoundingBoxD box = Shape.GetWorldBoundaries();
         MyEntities.GetElementsInBox(ref box, m_foundElements);
         foreach (var entity in m_foundElements)
         {
             if (IsForbiddenEntity(entity))
             {
                 if (entity.PositionComp.WorldAABB.Intersects(box))
                 {
                     MyHud.Notifications.Add(MyNotificationSingletons.CopyPasteAsteoridObstructed);
                     return(false);
                 }
             }
         }
     }
     return(true);
 }