Collisions don't take in count the path

I’m using the above example to see how the collisions work but it surprise me the way the Engine manage the collisions.



public static void main(String[] args)

{

Node _scene=new Node(“Scene”);

CollisionResults _resultados = new BoundingCollisionResults()

{

public void processCollisions() {

int cantObjetosChocados=getNumber();

if (cantObjetosChocados > 0) {

System.out.println(“Collied with “+cantObjetosChocados+” objects!”);

for(int i=0;i<cantObjetosChocados;i++)

{

System.out.println("Collied with "+getCollisionData(i).getTargetMesh().getName());;

}

}

}

};

Box box1=new Box(“BOX 1”,new Vector3f(0.5f,0.5f,0.5f),0.5f,0.5f,0.5f);

box1.setIsCollidable(true);

box1.setLocalTranslation(0,4,0);

BoundingBox bB=new BoundingBox();

box1.setModelBound(bB);

box1.updateModelBound();

box1.calculateCollisions(_scene, _resultados);

_scene.attachChild(box1);

_scene.updateGeometricState(0,true);

Box box2=new Box(“BOX 2”,new Vector3f(0.5f,0.5f,0.5f),0.5f,0.5f,0.5f);

box2.setIsCollidable(true);

box2.setLocalTranslation(0,2,0);

box2.setModelBound(new BoundingBox());

box2.updateModelBound();

box2.calculateCollisions(_scene, _resultados);

_scene.attachChild(box2);

_scene.updateGeometricState(0,true);

Box box3=new Box(“BOX 3”,new Vector3f(0.5f,0.5f,0.5f),0.5f,0.5f,0.5f);

box3.setIsCollidable(true);

box3.setLocalTranslation(0,3.9f,0);

box3.setModelBound(new BoundingBox());

box3.updateModelBound();

box3.calculateCollisions(_scene, _resultados);

_scene.attachChild(box3);

_scene.updateGeometricState(0,true);

}



Is there a way to “catch” the objects which the moving object collied through the path to the final position when I translate it?

Maybe I can make a work around using picking…I dunno…

You have to do call the collideWith each tick, otherwise there is no collision check.

In other words I’ve to move the object several times instead of just one andcheck if there any collision each time?

Yes, every preconfigured implementation of it would have to do the same. You can still use a transformer, it will also be called each tick to move the spatial further.