www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: neo187 on October 01, 2011, 09:35:32 pm

Title: Collision Information. Who collided with what
Post by: neo187 on October 01, 2011, 09:35:32 pm
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!
Title: Re: Collision Information. Who collided with what
Post by: EgonOlsen on October 01, 2011, 10:02:07 pm
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.
Title: Re: Collision Information. Who collided with what
Post by: AGP on October 02, 2011, 08:19:35 am
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.
Title: Re: Collision Information. Who collided with what
Post by: EgonOlsen on October 02, 2011, 09:10:16 pm
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.