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

Collision wonky after changing static properties #15

Closed
GoogleCodeExporter opened this issue Apr 10, 2015 · 1 comment
Closed

Collision wonky after changing static properties #15

GoogleCodeExporter opened this issue Apr 10, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Create a non-static body. Run a few steps of the simulation. Set it to
static (0 density). Other objects won't collide with it anymore.

What is the expected output? What do you see instead?
Objects should collide; they don't. At least not properly.. they sort of
slow down but pass through like jelly.

What version of the product are you using? On what operating system?
2.1.0; Linux version 2.6.28-15-generic running on amd6

Please provide any additional information below.

Sample code:

void Object::setDensity(qreal dens) {
    Q_ASSERT(m_body != NULL);
    if(dens != density()) {
        for(b2Fixture *f = m_body->GetFixtureList(); f; f = f->GetNext()) {
            f->SetDensity(dens);
        }
        m_body->SetMassFromShapes();
        emit propertyChanged();
    }
}

Original issue reported on code.google.com by mnbaya...@gmail.com on 6 Sep 2009 at 3:56

@GoogleCodeExporter
Copy link
Author

Fixed. I now automatically set the body's velocity to zero when you make it 
static.

See the updated Bridge example.

Original comment by erinca...@gmail.com on 20 Sep 2009 at 10:45

  • Changed state: Fixed

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

1 participant