Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RigidBody with polygon shape has weird physics. #8638

Closed
eon-s opened this issue May 3, 2017 · 2 comments
Closed

RigidBody with polygon shape has weird physics. #8638

eon-s opened this issue May 3, 2017 · 2 comments

Comments

@eon-s
Copy link
Contributor

eon-s commented May 3, 2017

Godot version: Master f527a69

Issue description:
RigicBody2D nodes with polygon shapes have some weird physics.

brknrigid1

brknrigid2

Steps to reproduce:
Try the example project with visible collision shapes enabled (can't draw polygons not even with _draw yet).
Modify the polygon keeping the lower vertex position and the result is always the same.

Link to minimal example project:
brokenrigid.zip
Added an extra rigid body for a more strange effect.

@bojidar-bg
Copy link
Contributor

Related to #7136, was potentially fixed for 3D in #7426.

Basically, the center of mass is assumed to be at the Rigidbody2D's origin, which is why those shapes don't fall nicely. So, if you move the ColisionPolygon2D a bit to the left, it all works.

Additionally, there seems to be some unrelated problem of the rigidbody going to sleep even in some unstable positions because its velocity becomes too small for a moment. If you disable "can sleep", it should be a bit better.

@eon-s
Copy link
Contributor Author

eon-s commented May 4, 2017

@bojidar-bg I see, will close this because is clearly a center of mass issue.

I've seen some sleep related problems with simple shapes a couple of months ago, I'll check if can be reproduced again and open another issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants