im trying to detect a collision between two cubes and it just doesn’t seem to work
public class collision {
public static boolean cubeCollision(cube c1,cube c2){
return ((c1.x < c2.x+c2.w) && (c1.x+c1.w > c2.x) &&
(c1.z < c2.z+c2.d) && (c1.z+c1.d > c2.z) &&
(c1.y < c2.y+c2.h) && (c1.y+c1.h > c2.y));
}
}
[s]EDIT:
I got this working now, the issue was that i wanst drawing the box the same way as i was detecting collision[/s]
EDIT:
No it’s still not working, the box detects collision when you are above it not inside of it. The x and z axis are fine but the y axis just doesnt wanna work :L