Basically about to smash my head against a wall over this bloody algortihm , but still here is an example of when it works as it should (somewhat)
Rotation doesnt work, sometimes random tiles will be destroyed , sometimes the tiles will slide straight through each other , sometimes for a magical reason tiles wont be rendered and its all been caused by this I dont even…
If anyone would like to help out a poor and stressed lcass please take a gander at his collision detection.
if (check_collision(a, coreship)) {
Ship attacking = coreship;
for(int ax =0;ax< a.collision.length;ax++){
Vertex2d corner = a.collision[ax].whole();
corner.add2(core.G.revert_coordinates(a.absolute_position.xy()));
corner.sub(new Vertex2d(32,0,0,0));
for(int at = 0;at < attacking.collision.length;at++){
Vertex2d attacker = attacking.collision[at].whole();
attacker.add2(core.G.revert_coordinates(attacking.absolute_position));
attacker = com.lcass.util.Util.rotate(attacker, attacking.rotpoint, attacking.rotation);
attacker = com.lcass.util.Util.rotate(attacker, a.rotpoint, -a.rotation);
if(((attacker.x >= corner.x) && (attacker.x <= corner.u))|| ((attacker.u >= corner.x) && (attacker.u <= corner.u))){
if(((attacker.y >= corner.y) && (attacker.y <= corner.v))|| ((attacker.v >= corner.y) && (attacker.v <= corner.v))){
a.damage(a.collision[ax].div(32), 100);
coreship.damage(attacking.collision[at].div(32), 100);
}
}
}
}
}