Collision Information. Who collided with what

Started by neo187, October 01, 2011, 09:35:32 PM

Previous topic - Next topic

neo187

Hi Egon,

I've been looking through the forum and the Wiki for this, apologies if it's already been asked. Basically the checkXXXcolision method is very helpful for modifying the direction of the object in case a collision occurs, but is there a way to get information as to what object I have just collided with? So that for e.g. some action could be performed on such object?

Thank you very much!

EgonOlsen

There's a collision listener interface. Just implement that, add an instance of it to the Object3Ds in question and you'll get the information you asked for when a collision happens.

AGP

Sorry to somewhat steer the conversation, but I'll say this again: it would be REALLY helpful to get something like static void drawSphere(SimpleVector pos, SimpleVector size) and static void drawEllipsoid(...) (perhaps inside of the CollisionEvent class itself) to allow us to visually see where our collision objects are.

EgonOlsen

That won't work. To draw something in jPCT, it has to pass the pipeline, i.e. it has to be part of the world and such. You can't initiate immediate draw commands...except for blitting, but that's another story.