Release: Circle collision and rigid response
by Erik Talvitie · in Torque Game Builder · 06/22/2006 (7:22 pm) · 0 replies
I've been lurking for a long time and been fiddling with TGB on and off since alpha. I was playing around with the latest release and think I may have found a bug that I haven't seen posted before.
I made a simple level just to play with physics a little bit. First I made a rectangular sprite for a floor, and another rotated at 45 degrees to be a ramp. Then I made a circular sprite and set its collision mode to "circle" and response to "rigid" (I haven't tested this very thoroughly in other response modes). Now, I let the circle drop onto the floor and no problem. But then I impulseForced it toward the ramp and it *passed right through.* This is not the "tunneling" phenomenon that's been reported. It literally just rolled right through as if there was no ramp. If, however, I set the ball to drop on the ramp, it would roll down the ramp as it ought to, then bounce off the world limit, come back and once again pass right through the ramp on its way back. I also tried adding several balls and found that they mostly wouldn't interact, so long as they were touching the floor, but if they were bouncing, they'd collide just fine. Things got *really* weird when I tried rolling my circular ball around on a tilemap and it started falling halfway through tiles and rolling through walls.
The interesting part is that all of these symptoms go away when I set the ball to use "polygon" collision instead of circular. I haven't had a chance yet to dig around in the code, but this makes me suspect something wonky is going on with the circular collision mode.
Can anybody else reproduce this behavior?
I made a simple level just to play with physics a little bit. First I made a rectangular sprite for a floor, and another rotated at 45 degrees to be a ramp. Then I made a circular sprite and set its collision mode to "circle" and response to "rigid" (I haven't tested this very thoroughly in other response modes). Now, I let the circle drop onto the floor and no problem. But then I impulseForced it toward the ramp and it *passed right through.* This is not the "tunneling" phenomenon that's been reported. It literally just rolled right through as if there was no ramp. If, however, I set the ball to drop on the ramp, it would roll down the ramp as it ought to, then bounce off the world limit, come back and once again pass right through the ramp on its way back. I also tried adding several balls and found that they mostly wouldn't interact, so long as they were touching the floor, but if they were bouncing, they'd collide just fine. Things got *really* weird when I tried rolling my circular ball around on a tilemap and it started falling halfway through tiles and rolling through walls.
The interesting part is that all of these symptoms go away when I set the ball to use "polygon" collision instead of circular. I haven't had a chance yet to dig around in the code, but this makes me suspect something wonky is going on with the circular collision mode.
Can anybody else reproduce this behavior?