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

SetXForm() and ApplyForce() cause unexpected angles #26

Closed
GoogleCodeExporter opened this issue Feb 3, 2016 · 2 comments
Closed

SetXForm() and ApplyForce() cause unexpected angles #26

GoogleCodeExporter opened this issue Feb 3, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Manually set the angle with SetXForm()
2. use ApplyForce() on the center of mass to avoid torque

The angle should then still be whatever is entered in SetXForm(), but
changes to very different values.

This bug was identified in box2d version 2.0.1 with the attached testbed
example.

Original issue reported on code.google.com by AnimateD...@gmail.com on 12 Oct 2009 at 5:21

Attachments:

@GoogleCodeExporter
Copy link
Author

This is how ApplyForce is defined in b2Body:

    /// Apply a force at a world point. If the force is not
    /// applied at the center of mass, it will generate a torque and
    /// affect the angular velocity. This wakes up the body.
    /// @param force the world force vector, usually in Newtons (N).
    /// @param point the world position of the point of application.
    void ApplyForce(const b2Vec2& force, const b2Vec2& point);

This is your call:

testBody->ApplyForce( b2Vec2(10,10), testBody->GetLocalCenter());

GetLocalCenter is a local point, not a world point.

Original comment by erinca...@gmail.com on 20 Nov 2009 at 6:55

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Wow. Its always something simple and I feel dumb every time.

Mr. Catto thank you very much. Everything is working as expected now.

Original comment by AnimateD...@gmail.com on 20 Nov 2009 at 12:29

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