Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2012-05-30 00:30:33 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2012-05-30 00:30:33 +0400
commit58bc424b3c46ee3ee6644ff578671670c2a1c8ec (patch)
tree147b691cecd0286e750fd73f0c6a2edad8ab9b90 /source/blender/blenkernel
parent1d4ab9daf0ef38066469fb86bed0fc24b2e1bbda (diff)
BGE #30734: add support for physics linear and angular thresholds and deactivation time from python and GUI.
======================== The linear and angular thresholds set the speed limit (in m/s) and rotation limit (in rad/s) under which a rigid body will go to sleep (stop moving) if it stays below the limits for a time equal or longer than the deactivation time (sleeping is disabled is deactivation time is set to 0). These settings help reducing the processing spent on Physics during the game. Previously they were only accessible from python but not working because of a bug. Now the python functions are working and the settings are available in the Physics panel of the World settings when using the Blender Game render engine. Python API: import PhysicsConstraints PhysicsConstraints.setDeactivationLinearTreshold(float) PhysicsConstraints.setDeactivationAngularTreshold(float)
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/intern/scene.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index e2bca1bb93e..24386730ddb 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 263
-#define BLENDER_SUBVERSION 7
+#define BLENDER_SUBVERSION 8
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 63efd194932..62d5459336b 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -516,6 +516,9 @@ Scene *BKE_scene_add(const char *name)
sce->gm.maxlogicstep = 5;
sce->gm.physubstep = 1;
sce->gm.maxphystep = 5;
+ sce->gm.lineardeactthreshold = 0.8f;
+ sce->gm.angulardeactthreshold = 1.0f;
+ sce->gm.deactivationtime = 0.0f;
sce->gm.flag = GAME_DISPLAY_LISTS;
sce->gm.matmode = GAME_MAT_MULTITEX;