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
This issue is migrated from here. It was created at 2014/04/09 20:31:54 +0000
Description
When a sprite with a dynamic PhysicsBody is stopped by contact with another PhysicsBody, the velocity of the sprite's PhysicsBody continues to update based on gravitational acceleration -- even though the body itself is not moving because it is obstructed by the second body.
For instance, in the sample code included in the Physics Integration documentation (https://github.com/Yangtb/newPhysics), the circle sprite falls due to the gravity of the PhysicsWorld. When it hits the edge at the bottom of the screen, it stops falling -- but the velocity of the sprite's PhysicsBody continues to change based on the gravitational acceleration. The sprite's PhysicsBody is also never at rest, even when it stops all actual movement.
The correct behavior would be for the velocity of the PhysicsBody to accurately reflect what is visible on the screen. In this case, when the circle sprite's fall has been stopped by the edge, its vertical velocity becomes 0. The PhysicsBody should also be updated to be at rest.
(I'm fairly new to Cocos2D-X and open-source development in general, so I hope this is the correct way to report such a bug. Apologies if I'm going about this the wrong way.)
jefferific added comment:
I've come back to the app where I ran into this issue, and things seem to be working correctly now. Very mysterious. Perhaps something went wrong in the build when I had the problem earlier? At any rate, it's working fine now, so perhaps this isn't an issue that needs addressing.
The text was updated successfully, but these errors were encountered:
Note
This issue is migrated from here. It was created at 2014/04/09 20:31:54 +0000
Description
When a sprite with a dynamic PhysicsBody is stopped by contact with another PhysicsBody, the velocity of the sprite's PhysicsBody continues to update based on gravitational acceleration -- even though the body itself is not moving because it is obstructed by the second body.
For instance, in the sample code included in the Physics Integration documentation (https://github.com/Yangtb/newPhysics), the circle sprite falls due to the gravity of the PhysicsWorld. When it hits the edge at the bottom of the screen, it stops falling -- but the velocity of the sprite's PhysicsBody continues to change based on the gravitational acceleration. The sprite's PhysicsBody is also never at rest, even when it stops all actual movement.
The correct behavior would be for the velocity of the PhysicsBody to accurately reflect what is visible on the screen. In this case, when the circle sprite's fall has been stopped by the edge, its vertical velocity becomes 0. The PhysicsBody should also be updated to be at rest.
(I'm fairly new to Cocos2D-X and open-source development in general, so I hope this is the correct way to report such a bug. Apologies if I'm going about this the wrong way.)
I've come back to the app where I ran into this issue, and things seem to be working correctly now. Very mysterious. Perhaps something went wrong in the build when I had the problem earlier? At any rate, it's working fine now, so perhaps this isn't an issue that needs addressing.
The text was updated successfully, but these errors were encountered: