(28 май 2016, 20:00) (
0/
0)
[
0]
Odo Veiz, скажи что у меня не верно?
* Проверка столкновения полигонов ABC в 2D
* AX1, AY1, AX2, AY2, AX3, AY3 - координаты точек первого полигона.
* BX1, BY1, BX2, BY2, BX3, BY3 - координаты точек второго полигона.
**/
public static boolean getCollizion2DPoligonPoligon(double AX1, double AY1, double AX2, double AY2, double AX3, double AY3, double BX1, double BY1, double BX2, double BY2, double BX3, double BY3) {
boolean[] check = new boolean[15];
check[0] = Collision2D.getCollizion2DPoligonPoint(AX1, AY1, AX2, AY2, AX3, AY3, BX1, BY1);
check[1] = Collision2D.getCollizion2DPoligonPoint(AX1, AY1, AX2, AY2, AX3, AY3, BX2, BY2);
check[2] = Collision2D.getCollizion2DPoligonPoint(AX1, AY1, AX2, AY2, AX3, AY3, BX3, BY3);
check[3] = Collision2D.getCollizion2DPoligonPoint(BX1, BY1, BX2, BY2, BX3, BY3, AX1, AY1);
check[4] = Collision2D.getCollizion2DPoligonPoint(BX1, BY1, BX2, BY2, BX3, BY3, AX2, AY2);
check[5] = Collision2D.getCollizion2DPoligonPoint(BX1, BY1, BX2, BY2, BX3, BY3, AX3, AY3);
check[6] = Collision2D.getCollizion2DLine(AX1, AY1, AX2, AY2, BX1, BY1, BX2, BY2);
check[7] = Collision2D.getCollizion2DLine(AX1, AY1, AX2, AY2, BX2, BY2, BX3, BY3);
check[8] = Collision2D.getCollizion2DLine(AX1, AY1, AX2, AY2, BX3, BY3, BX1, BY1);
check[9] = Collision2D.getCollizion2DLine(AX2, AY2, AX3, AY3, BX1, BY1, BX2, BY2);
check[10] = Collision2D.getCollizion2DLine(AX2, AY2, AX3, AY3, BX2, BY2, BX3, BY3);
check[11] = Collision2D.getCollizion2DLine(AX2, AY2, AX3, AY3, BX3, BY3, BX1, BY1);
check[12] = Collision2D.getCollizion2DLine(AX3, AY3, AX1, AY1, BX1, BY1, BX2, BY2);
check[13] = Collision2D.getCollizion2DLine(AX3, AY3, AX1, AY1, BX2, BY2, BX3, BY3);
check[14] = Collision2D.getCollizion2DLine(AX3, AY3, AX1, AY1, BX3, BY3, BX1, BY1);
return check[0] || check[1] || check[3] || check[4] || check[5] || check[6] || check[7] || check[8] || check[9] || check[10] || check[11] || check[12] || check[13] || check[14];
}