behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

SetTransform Allows Filtered Bodies to Collide #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using SetTransform on a Dynamic Body that results in it overlapping another 
body (Static at least it seems) for which both bodies have category/mask bits 
set to not collide with each other, will create a collision event.

What is the expected output? What do you see instead?

Expect SetTransform to not collide bodies that are filtered for no collision. 
As a workaround, if the dynamic body is set to Static, SetTransform called, and 
then changed back to Dynamic body, no collision occurs as is the desired output.

What version of the product are you using? On what operating system?

Discovered this problem using the libgdx port of Box2D for Android, but as far 
as I can tell from comparing source code, libgdx is using recent Box2D C++ 
code, so I'm making an assumption that the issue lies with Box2D. I'm not setup 
to easily test Box2D code directly, so I'm not 100% sure...

Please provide any additional information below.

Original issue reported on code.google.com by droidthi...@gmail.com on 1 Jan 2011 at 7:27

GoogleCodeExporter commented 9 years ago
I could not reproduce this issue.

Original comment by erinca...@gmail.com on 28 Mar 2011 at 3:59

GoogleCodeExporter commented 9 years ago
Having the same error with the same setup, I think the problem lies in the fact 
that the glitchy collision is neither consistent or long term.

Dynamic Bodies grouped together (as a vehicle) with varying joints are shifted 
by a deltaX/deltaY and setTransform(). Each vehicle consists of a body, central 
chasis, and front/left suspension reticule, axle and wheel, with 
revolute,distance and prismatic joints.

After dragging one vehicle, and dropping onto another (same cat/mask bits) 
random body parts will collide with those of the other car. Not consistently, 
and not for any great length of time.

Furthermore, 9/10 times, the setTransform will result in the car locking up as 
if its joints have all become solid.

Original comment by wopstic...@gmail.com on 21 Jun 2011 at 7:15