You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem? 1. Create a body with inf mass and inertia and use it to create a shape.
2. Add the shape to the space with space.add_static(shape)
3. Change the value of shape.body.angle or shape.body.position
The expected result would be that the body is moved or rotated to the angle or position it was changed to. What happens is that the shape.body object will report the new values but the collisions will still occur at the position and angle that was set before the call to space.add_static.
I'm running this on archlinux with pymunk 1.0.0 from archlinux aur
As soon as you change the position of a static shape after it has been added to the space you have to call the Space.rehash_static() method. As the shape is static chipmunk (and therefore pymunk) believes that it wont move, and as a result doesnt update its internal collision structure with the new position.
The reason why this is not done automatically is to optimize the static shapes.. and if you for example change the position of many static shapes, you only need to do the rehash call once after all of them are moved.
If you intend to move around the shape, just add it with the normal add() method instead.
(I found another bug while researching this report, point_query did not work correctly with static shapes. That bug has now been fixed in latest trunk)
From AdsumM...@gmail.com on March 18, 2011 10:37:29
What steps will reproduce the problem? 1. Create a body with inf mass and inertia and use it to create a shape.
2. Add the shape to the space with space.add_static(shape)
3. Change the value of shape.body.angle or shape.body.position
The expected result would be that the body is moved or rotated to the angle or position it was changed to. What happens is that the shape.body object will report the new values but the collisions will still occur at the position and angle that was set before the call to space.add_static.
I'm running this on archlinux with pymunk 1.0.0 from archlinux aur
Original issue: http://code.google.com/p/pymunk/issues/detail?id=50
The text was updated successfully, but these errors were encountered: