Example #1
0
        public List <PoolObjHandle <ActorRoot> > GetActorsInPolygon(GeoPolygon collisionPolygon, AreaEventTrigger InTriggerRef)
        {
            if (collisionPolygon == null)
            {
                return(null);
            }
            List <PoolObjHandle <ActorRoot> > list       = null;
            List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .GetInstance().GameActors;

            int count = gameActors.Count;

            for (int i = 0; i < count; i++)
            {
                PoolObjHandle <ActorRoot> act = gameActors[i];
                if (((act != 0) && ((null == InTriggerRef) || InTriggerRef.ActorFilter(ref act))) && collisionPolygon.IsPointIn(act.handle.location))
                {
                    if (list == null)
                    {
                        list = new List <PoolObjHandle <ActorRoot> >();
                    }
                    list.Add(act);
                }
            }
            return(list);
        }
Example #2
0
 public int GetActorsInCircle(VInt3 center, int radius, PoolObjHandle<ActorRoot>[] outResults, AreaEventTrigger InTriggerRef)
 {
     int num = 0;
     ulong num2 = (ulong) (radius * radius);
     List<PoolObjHandle<ActorRoot>> gameActors = Singleton<GameObjMgr>.GetInstance().GameActors;
     int count = gameActors.Count;
     for (int i = 0; i < count; i++)
     {
         if (num >= outResults.Length)
         {
             return num;
         }
         PoolObjHandle<ActorRoot> act = gameActors[i];
         VInt3 num6 = act.handle.location - center;
         if ((num6.sqrMagnitudeLong2D < num2) && ((null == InTriggerRef) || InTriggerRef.ActorFilter(ref act)))
         {
             outResults[num++] = act;
         }
     }
     return num;
 }