Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

A simple box stack is not stable without sleeping #54

Open
abigplatypus opened this issue Feb 17, 2021 · 0 comments
Open

A simple box stack is not stable without sleeping #54

abigplatypus opened this issue Feb 17, 2021 · 0 comments

Comments

@abigplatypus
Copy link

Hey Randy,

First off, thanks for the code. It's a great learning tool. There's something I wanted to bring to your attention and understand whether it's expected. To reproduce:

  1. Clone the latest version of the repo.
  2. In Demo.cpp, change bool enableSleep = true; to bool enableSleep = false;
  3. In BoxStack.h, change the code that adds the boxes so that it adds a single stack of 5:
for ( i32 i = 0; i < 5; ++i )
{
		        r32 k = 0;
		        r32 j = 0;
			bodyDef.position.Set(  1.0f * j, 1.0f * i + 1.0f,+ 1.0f * k );
			body = scene.CreateBody( bodyDef );
			body->AddBox( boxDef );
}
  1. Run the BoxStack demo.

After a few seconds (~5), the box stack collapses. This is without changing anything else and just by disabling sleep. Is this expected? I'd expect a warm-starting solver to be able to resolve a box of 5 boxes, especially at the default 20 iterations, without needing to put the boxes to sleep.

I'd love any insight!

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

No branches or pull requests

1 participant