Exemple #1
0
 public void foldData(Vector3 vec, Vector3 point, float angle, Board b)
 {
     foreach (Player p in players)
     {
             p.foldData(vec, point, angle, b.PointInBeforeFold(p.getCenter()), b.PointInAfterFold(p.getCenter()));
     }
 }
Exemple #2
0
 public void foldData(Vector3 vec, Vector3 point, float angle, Board b)
 {
     foreach (Hole h in holes)
     {
         if (b.PointInBeforeFold(h.getCenter()))
             h.foldData(vec, point, angle);
     }
 }
Exemple #3
0
 public void foldData(Vector3 vec, Vector3 point, float angle, Board b)
 {
     foreach (PowerUp p in powerups)
     {
         if (b.PointInBeforeFold(p.getCenter()))
             p.foldData(vec, point, angle);
     }
 }
 // I changed it so the axis and the point will be relevent to the closest point - Tom
 public void foldData(float angle, Board b)
 {
     foreach (PowerUp p in powerups)
     {
         if (b.PointInBeforeFold(p.getCenter()))
         {
             p.foldData(angle);
         }
     }
 }
        // I changed it so the axis and the point will be relevent to the closest point - Tom
        public void foldData(float angle, Board b)
        {
            int i = 0;
            while (i<players.Count())
            {
                if (b.PointInAfterFold(players.ElementAt(i).getCenter()) || b.PointInBeforeFold(players.ElementAt(i).getCenter()))
                    players.ElementAt(i).foldData(angle, b.State);
                i++;

            }
        }
 public void preFoldData(Vector3 foldp1, Vector3 foldp2, Vector3 axis, Board b)
 {
     Matrix checkMatrix;
     Vector3 check;
     float rotantionAngle;
     foreach (Player p in players)
     {
         if (b.PointInBeforeFold(p.getCenter()))
         {
             rotantionAngle = MathHelper.PiOver2;
             checkMatrix = Matrix.Identity;
             checkMatrix *= Matrix.CreateFromAxisAngle(axis, rotantionAngle);
             check = Vector3.Transform(p.getCenter(), checkMatrix); // where the point will be after rotation
             if (check.Y > 0.0f) // if it is in the right deriction
                 p.preFoldData(axis, (foldp1 + foldp2) / 2, true, false);
             else // not in the right deriction
                 p.preFoldData(-axis, (foldp1 + foldp2) / 2, true, false);
         }
         else if (b.PointInAfterFold(p.getCenter()))
         {
             rotantionAngle = -1.5f * MathHelper.PiOver2;
             checkMatrix = Matrix.Identity;
             checkMatrix *= Matrix.CreateTranslation(-p.getCenter());
             checkMatrix *= Matrix.CreateRotationZ(MathHelper.Pi);
             checkMatrix *= Matrix.CreateTranslation(p.getCenter());
             checkMatrix *= Matrix.CreateTranslation(-(foldp1 + foldp2) / 2);
             checkMatrix *= Matrix.CreateFromAxisAngle(axis, rotantionAngle);
             checkMatrix *= Matrix.CreateTranslation((foldp1 + foldp2) / 2);
             check = Vector3.Transform(p.getCenter(), checkMatrix); // where the point will be after rotation
             if (check.Y > 0.0f) // if it is in the right deriction
                 p.preFoldData(axis, (foldp1 + foldp2) / 2, false, true);
             else // not in the right deriction
                 p.preFoldData(-axis, (foldp1 + foldp2) / 2, false, true);
         }
     }
 }
 public void preFoldData(Vector3 foldp1, Vector3 foldp2, Vector3 axis, Board b)
 {
     Matrix checkMatrix;
     Vector3 check;
     foreach (Hole h in holes)
     {
         if (b.PointInBeforeFold(h.getCenter()))
         {
             checkMatrix = Matrix.Identity;
             checkMatrix *= Matrix.CreateFromAxisAngle(axis, MathHelper.ToRadians(90));
             check = Vector3.Transform(h.getCenter(), checkMatrix); // where the point will be after rotation
             if (check.Y > 0.0f) // if it is in the right deriction
                 h.preFoldData(axis, (foldp1 + foldp2) / 2);
             else // not in the right deriction
                 h.preFoldData(-axis, (foldp1 + foldp2) / 2);
         }
     }
 }
 // I changed it so the axis and the point will be relevent to the closest point - Tom
 public void foldData(float angle, Board b)
 {
     foreach (Hole h in holes)
     {
         if (b.PointInBeforeFold(h.getCenter()))
         {
             h.foldData(angle);
         }
     }
 }
 // I changed it so the axis and the point will be relevent to the closest point - Tom
 public void foldData(float angle, Board b)
 {
     foreach (Acid a in acids)
     {
         if (b.PointInBeforeFold(a.getCenter()))
         {
             a.foldData(angle);
         }
     }
 }