enableGravity is commented out
ofZach opened this issue · comments
ofZach commented
this has been commented out
ofxBox2d/src/ofxBox2dBaseShape.cpp
Lines 155 to 157 in 4ff6400
potential fix might be:
void ofxBox2dBaseShape::enableGravity(bool b) {
if (b == false){
bodyDef.gravityScale = 0.0;
} else {
bodyDef.gravityScale = 1.0;
}
}
Vanderlin commented
The bodyDef is only used before the body is created. This should do it, adding to updates I'm working on.
void ofxBox2dBaseShape::enableGravity(bool b) {
if (body) {
body->SetGravityScale(b ? 1 : 0);
}
else {
bodyDef.gravityScale = b ? 1 : 0;
}
}