[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60283] branches/soc-2013-rigid_body_sim/ source/blender/blenkernel/intern/rigidbody.c: rigidbody: Fix effectors getting weaker/stronger with different fps

Sergej Reich sergej.reich at googlemail.com
Sat Sep 21 07:12:03 CEST 2013


Revision: 60283
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60283
Author:   sergof
Date:     2013-09-21 05:12:03 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
rigidbody: Fix effectors getting weaker/stronger with different fps

Effectors weaken the force based on fps, for bullet we need to keep it
constant regardless of render fps.
To stay relatively backwards compatible the force will stay the same
when using 24 fps since it's blender's default.

Modified Paths:
--------------
    branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c

Modified: branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c
===================================================================
--- branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c	2013-09-21 05:12:02 UTC (rev 60282)
+++ branches/soc-2013-rigid_body_sim/source/blender/blenkernel/intern/rigidbody.c	2013-09-21 05:12:03 UTC (rev 60283)
@@ -1253,9 +1253,12 @@
 			add_v3_v3v3(eff_force, eff_force_global, eff_force_local);
 			mul_v3_fl(eff_force, 0.5f);
 			/* activate object in case it is deactivated */
-			if (!is_zero_v3(eff_force))
+			if (!is_zero_v3(eff_force)) {
+				/* adjust the force based on fps, use 24 as neutral point since it's blender's default */
+				mul_v3_fl(eff_force, (float)FPS / 24.0f);
 				RB_body_activate(rbo->physics_object);
-			RB_body_apply_central_force(rbo->physics_object, eff_force);
+				RB_body_apply_central_force(rbo->physics_object, eff_force);
+			}
 		}
 
 		/* cleanup */




More information about the Bf-blender-cvs mailing list