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

The slab structure bounces and jitters from the point of being placed #3

Open
MrCsabaToth opened this issue Jun 22, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@MrCsabaToth
Copy link
Member

Even if I set the friction to 1.0 the slabs slowly slide on each other due to jitter and an impossible physical state. I'm trying to make them a kinetic body instead of a static body. Also start them as ISLAND_DISABLED state and then enable them at the time the ball is added. But so far that doesn't work.

@MrCsabaToth MrCsabaToth added the bug Something isn't working label Jun 22, 2020
@MrCsabaToth MrCsabaToth self-assigned this Jun 22, 2020
@MrCsabaToth
Copy link
Member Author

It helps that I start the simulation clock when the ball is placed (that's when the simulation actually have to start). Otherwise a huge amount of time can pass between the tower and the ball placement and that would cause the explosion of the slabs. This also guarantees no jitter and movement until the ball is hurdled. However at the point of the hurdle there's still an initial movement and then jitter.

@MrCsabaToth
Copy link
Member Author

So there's no explosion any more just a small bounce. The slabs were floating on each other because the simulation engine needs a margin around the convex hulls. The engine uses that to compute normal vectors related to the simulation so it's needed.

https://pybullet.org/Bullet/phpBB3/viewtopic.php?f=9&t=2358&sid=c757996ff8459a33e0a7674d4e71e66e

De default margin is 0.04 which is way too big, we need rather 0.0025. That helps to decrease the visual gap.Sphere won't have problem. I also tried to transparently apply the gap (shrink the slabs a tiny bit) just within the Physics layer and then of the reverse transformation when the engine enforces sets the new positions.

There's still some bump thought so that logic right now is disabled.

@MrCsabaToth
Copy link
Member Author

Eventually this can be solved by a proper selection of setSleepingThresholds. Maybe we'll also need to remove setActivationState(DISABLE_DEACTIVATION);. We'll see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant