vanderlin / ofxBox2d

Openframework wrapper for box2d
zlib License
320 stars 122 forks source link

disable rotating #125

Closed ghost closed 5 years ago

ghost commented 6 years ago

is it possible to disable the rotating of the boxes?

vanderlin commented 5 years ago

Yes very simple, just access the body and set SetFixedRotation(true);

auto rect = make_shared<ofxBox2dRect>();
rect->setPhysics(1.2, 1, 0.2);
rect->setup(box2d.getWorld(), ofGetWidth()/2, 100, 200, 200);

rect->body->SetFixedRotation(true);