EPhysics: don't activate body if not going to apply

forces

Otherwise it won't stop, sleeping thresholds won't work...



SVN revision: 75508
This commit is contained in:
Bruno Dilly 2012-08-21 17:47:18 +00:00
parent ce1b9ca66d
commit a10277b529
1 changed files with 6 additions and 1 deletions

View File

@ -475,7 +475,12 @@ _ephysics_body_outside_render_area_check(EPhysics_Body *body)
void void
ephysics_body_forces_apply(EPhysics_Body *body) ephysics_body_forces_apply(EPhysics_Body *body)
{ {
double rate = ephysics_world_rate_get(body->world); double rate;
if (!((body->force.x) || (body->force.y) || (body->force.torque)))
return;
rate = ephysics_world_rate_get(body->world);
body->rigid_body->activate(1); body->rigid_body->activate(1);
body->rigid_body->applyCentralForce(btVector3(body->force.x / rate, body->rigid_body->applyCentralForce(btVector3(body->force.x / rate,
body->force.y / rate, 0)); body->force.y / rate, 0));