Is it possible to just detect collisions, without simulating one?

113 views
Skip to first unread message

Xaero Degreaz

unread,
Dec 8, 2012, 12:21:37 AM12/8/12
to jinn...@googlegroups.com
First off, great engine, and simple to use!

To be clear, I just want to detect that a collision occurred, but I'm not actually wanting to cause objects to bounce off of each other for some things.

It seems like the default behaviour is to simulate the collision, causing objects to move, which is perfectly fine for 99% of collision detection. However, I'm just needing to detect if Body A is touching Body B, but I don't necessarily want them to *react* to the collision.

I've tried setting the mass of both bodies to 0, but that throws errors on collision. I've also tried setting the Geometry's restitution coefficient to 0, and this still causes a reaction. I'd really hate to start hacking your code to make this possible just in case there is an update in the future.

Thanks in advance!

Morten Silcowitz

unread,
Dec 9, 2012, 7:10:29 AM12/9/12
to jinn...@googlegroups.com
Hi!
unfortunately there isn't any collision filtering system in jinngine,
I just never got around to do that. But you could "hack" that in
pretty easily your self :) Somewhere in the code all the collision
pairs are dispatched for contact point generation. Put in a check that
filters out pairs that you don't want contact point for.

Xaero Degreaz

unread,
Dec 9, 2012, 7:45:53 PM12/9/12
to jinn...@googlegroups.com
Hi, thanks for the response :)

I decided to kinda work around it. When contact is made, I just set the ball as fixed, and make the velocity 0. This helps keep the ball from bouncing too much before assigning the player to "capture" the ball.

It would be really sweet if you added sort of a "physics matrix" like there is inside Unity 3D. It also allows for colliders to be set as triggers, and not so much reactants to collision force :)
Reply all
Reply to author
Forward
0 new messages