Move Spheres From Corners and Edges

I have created a cube out of six geometries(walls, ceiling, and floor) to make my spheres collide.

I can make my spheres respond to collisions when they hit either walls, ceiling or floor. But I am having

problems to make them move when they hit a corner or an edge. They get stuck there forever.

This is the code that I am using to detect my collisions:

CollisionResults collisions = new CollisionResults();

object1.collideWith(floor.getModelBound(), results);

if(results.size()>0){

object_Physics.setRestitution(10);

object_Physics.setLinearVelocity(object_Physics.getLinearVelocity().negate());

}



how do I know when they collide with a corner or edge, and how do I respond to that?



Thanks!!!

Please, zero007, read the manual once from start to end. You keep asking basic questions and apply questionable methods (e.g. You mix the physics and geometry collision all the time). Explaining every single step to you really makes no sense if you don’t have an idea of the bigger picture. This is not supposed to be bashing, I am serious, this won’t get you anywhere and will cause a lot of fustration on the answerers side.

1 Like