The collision detection methods implemented on the engine clases should be more intuitives to use, and should be possible to get information from them.
For example a boolean method called Collide from a method called Collision would be great for using it on the Object3D
Object3D Ball=new .....;
if (Ball.Collision.Collide (up, 1)==false) Ball.move (up);
So Collide may recieve the direction or a Simplevector and the distance to check, that would be very helpfull. Another usefull method may be CollidedWith () from Collision that returns the Object3D from wich collide or a boolean to check. For example:
boolean allowed;
Object3D White_Ball=new........
Object3D Black_Ball=new........
if (White_Ball.Collision.CollidedWith (Black_Ball)==true)
--------allowed=true;
--------DoMovement (White_Ball, Black_Ball);
if (White_Ball.Collision.CollidedWith (Black_Ball)!=true)
--------allowed=false;
--------System.out.println ("Error: movement not allowed");
or
//The player class
public class Player {
----int life=100;
----Object3D foot;
----Object3D fist;
----Object3D etc;
etc.
etc.
etc.
----public void setLife (Object3D part) {
--------if (part==foot) life-=20;
--------if (part==fist) life-=10;
--------if (part==null) life-=0;
----}
}
//inside the game class
boolean action;
Player Mel=new Player (...,..., etc.);
Player ssj5=new Player (...,..., etc.);
if (action==true) {
----Mel.setLife (ssj5.body.Collision.collidedWith ());
----ssj5.setlife (Mel.body.Collision.collidedWith ());
}
Another suggestion with the collision detection is for the camera, for example a boolean method called
SphereCollide (SimpleVector or a direction, float radius). For example:
Camera cam_1=new.....;
if (cam_1.SphereCollide (up, 5)==false)
----cam_1.move (up);
else {
----//whatever
}