ArtKorchagin
ArtKorchagin

Reputation: 4853

Stop rotation and moving

How stop the rotation and moving of the body?

I do this:

            mBody.setAngularDamping(100);
            mBody.setLinearDamping(100);

but it does not stop the body completely, and

            mBody.setActive(false);

it not freeze body fully.

Upvotes: 0

Views: 1448

Answers (1)

Andrew
Andrew

Reputation: 24846

Just to stop:

body->setLinearVelocity(b2Vec2(0,0));
body->setAngularVelocity(0);

If you want your body to become immovable - make it static:

body->setType(b2_staticBody);

Upvotes: 4

Related Questions