private void ForeachAround2(CollisionParameters collision, Translation translation, ref float3 correction)
        {
            var position = translation.Value;
            var key      = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, collision, translation, ref correction);


            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 1));
            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 1));
            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, -1));
            Foreach(key, collision, translation, ref correction);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, -1));
            Foreach(key, collision, translation, ref correction);
        }
        private void ForeachAround(EntitiesHashMap.MyData me, ref float3 correction, ref CollisionParameters collision)
        {
            var position = me.position;
            var key      = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, me, ref correction, ref collision);


            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 1));
            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 1));
            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, -1));
            Foreach(key, me, ref correction, ref collision);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, -1));
            Foreach(key, me, ref correction, ref collision);
        }
Exemplo n.º 3
0
        private void ForeachAround(float3 position, Fighter me, ref Condition condition)
        {
            var key = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, position, me, ref condition);
            QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, position, me, ref condition);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, position, me, ref condition);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, position, me, ref condition);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, position, me, ref condition);
        }
Exemplo n.º 4
0
        private void ForeachAround(float3 position, Condition condition, float3 direction, FoodHierarchie hierarchie, ref FoodHierarchieHashMap.MyData foundFood, ref bool found)
        {
            var key = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, position, condition, direction, hierarchie, ref foundFood, ref found);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, position, condition, direction, hierarchie, ref foundFood, ref found);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, position, condition, direction, hierarchie, ref foundFood, ref found);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, position, condition, direction, hierarchie, ref foundFood, ref found);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, position, condition, direction, hierarchie, ref foundFood, ref found);
        }
Exemplo n.º 5
0
        private void ForeachAround(Circle me, ref float2 avoidanceForce, ref float minTime)
        {
            var position = me.Position;
            var key      = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, me, ref avoidanceForce, ref minTime);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, me, ref avoidanceForce, ref minTime);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, me, ref avoidanceForce, ref minTime);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, me, ref avoidanceForce, ref minTime);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, me, ref avoidanceForce, ref minTime);
        }
Exemplo n.º 6
0
        private void ForeachAround(QuadrantData me, ref float3 avoidanceForce, float radius)
        {
            var position = me.position;
            var key      = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, me, ref avoidanceForce, radius);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, me, ref avoidanceForce, radius);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, me, ref avoidanceForce, radius);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, me, ref avoidanceForce, radius);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, me, ref avoidanceForce, radius);
        }
Exemplo n.º 7
0
        private void ForeachAround(ref Infection infection, ref Translation translation)
        {
            var position = translation.Value;
            var key      = QuadrantVariables.GetPositionHashMapKey(position);

            Foreach(key, ref infection, ref translation);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            Foreach(key, ref infection, ref translation);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            Foreach(key, ref infection, ref translation);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            Foreach(key, ref infection, ref translation);
            key = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            Foreach(key, ref infection, ref translation);
        }
Exemplo n.º 8
0
        private bool ForeachAround(float3 position, ref FightersHashMap.MyData output, Fighter myBroId)
        {
            var found = false;
            var key   = QuadrantVariables.GetPositionHashMapKey(position);

            found = found || Foreach(key, position, ref output, found, myBroId);
            key   = QuadrantVariables.GetPositionHashMapKey(position, new float3(1, 0, 0));
            found = found || Foreach(key, position, ref output, found, myBroId);
            key   = QuadrantVariables.GetPositionHashMapKey(position, new float3(-1, 0, 0));
            found = found || Foreach(key, position, ref output, found, myBroId);
            key   = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, 1));
            found = found || Foreach(key, position, ref output, found, myBroId);
            key   = QuadrantVariables.GetPositionHashMapKey(position, new float3(0, 0, -1));
            found = found || Foreach(key, position, ref output, found, myBroId);
            return(found);
        }