Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bajabob

#1
Support / Need a little direction on Collusion Detection
December 17, 2010, 08:52:55 AM
I am not new to Java, but am to jPCT! I must say, so far I am really impressed!

I am trying to solve this issue, I cannot register a callback even when my objects supposedly collide. Any input? I'm using the same object twice.

Init:

floor = Loader.load3DS(res.openRawResource(R.raw.object), 1)[0];
walls = Loader.load3DS(res.openRawResource(R.raw.object), 1)[0];

floor.translate(0, 0, -10);
floor.setName("floor");
floor.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
floor.addCollisionListener(this);

walls.translate(0, 0, 0);
walls.setName("walls");
walls.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
walls.addCollisionListener(this);

                                world.addObject(walls);
world.addObject(floor);

walls.strip();
floor.strip();


OnDrawFrame:

                                SimpleVector s = floor.getCenter();
floor.translate(s.x, s.y, s.z+1);


Override "collision":

                                Log.d("COLLUSION DETECTED!!!", "!!!!!!");


Can't wait to find out what I did. My first attempt at 3D.

Bob