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:
-rw-r--r--release/scripts/startup/bl_ui/properties_game.py8
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/intern/scene.c3
-rw-r--r--source/blender/blenloader/intern/readfile.c17
-rw-r--r--source/blender/makesdna/DNA_object_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_scene.c25
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp5
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp5
9 files changed, 60 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py
index 857afbd9f09..549e2181a2b 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -622,6 +622,14 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
col.prop(gs, "logic_step_max", text="Max")
col = layout.column()
+ col.label(text="Physics Deactivation:")
+ sub = col.row(align=True)
+ sub.prop(gs, "deactivation_linear_threshold", text="Linear Threshold")
+ sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold")
+ sub = col.row()
+ sub.prop(gs, "deactivation_time", text="Time")
+
+ col = layout.column()
col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()
sub.active = gs.use_occlusion_culling
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;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a0513cf55b1..081264d62df 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7230,9 +7230,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (main->versionfile < 263) {
/* set fluidsim rate. the version patch for this in 2.62 was wrong, so
- * try to correct it, if rate is 0.0 that's likely not intentional */
+ try to correct it, if rate is 0.0 that's likely not intentional */
Object *ob;
-
+
for (ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
for (md = ob->modifiers.first; md; md = md->next) {
@@ -7502,6 +7502,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 8))
+ {
+ /* set new deactivation values for game settings */
+ Scene *sce;
+
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
+ /* Game Settings */
+ sce->gm.lineardeactthreshold = 0.8f;
+ sce->gm.angulardeactthreshold = 1.0f;
+ sce->gm.deactivationtime = 2.0f;
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
{
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 11ca1f1fa8e..44d7ec660f2 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -201,7 +201,7 @@ typedef struct Object {
float rdamping, sizefac;
float margin;
float max_vel; /* clamp the maximum velocity 0.0 is disabled */
- float min_vel; /* clamp the maximum velocity 0.0 is disabled */
+ float min_vel; /* clamp the minimum velocity 0.0 is disabled */
float m_contactProcessingThreshold;
float obstacleRad;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 673156e3d7d..198b6a9bf80 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -625,6 +625,7 @@ typedef struct GameData {
short ticrate, maxlogicstep, physubstep, maxphystep;
short obstacleSimulation, pad1;
float levelHeight;
+ float deactivationtime, lineardeactthreshold, angulardeactthreshold,pad2;
} GameData;
#define STEREO_NOSTEREO 1
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 5b355e56911..17efc25c132 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2577,6 +2577,31 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
"higher value give better physics precision");
RNA_def_property_update(prop, NC_SCENE, NULL);
+ prop = RNA_def_property(srna, "deactivation_linear_threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "lineardeactthreshold");
+ RNA_def_property_ui_range(prop, 0.001, 10000.0, 2, 3);
+ RNA_def_property_range(prop, 0.001, 10000.0);
+ RNA_def_property_ui_text(prop, "Deactivation Linear Threshold",
+ "Linear velocity that an object must be below before the deactivation timer can start");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop = RNA_def_property(srna, "deactivation_angular_threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "angulardeactthreshold");
+ RNA_def_property_ui_range(prop, 0.001, 10000.0, 2, 3);
+ RNA_def_property_range(prop, 0.001, 10000.0);
+ RNA_def_property_ui_text(prop, "Deactivation Angular Threshold",
+ "Angular velocity that an object must be below before the deactivation timer can start");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop = RNA_def_property(srna, "deactivation_time", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "deactivationtime");
+ RNA_def_property_ui_range(prop, 0.0, 60.0, 1, 1);
+ RNA_def_property_range(prop, 0.0, 60.0);
+ RNA_def_property_ui_text(prop, "Deactivation Time",
+ "Amount of time (in seconds) after objects with a velocity less than than a certain "
+ "threshold will deactivate. Time 0.0 means deactivation inactive");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
/* mode */
prop = RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", (1 << 5)); /*XXX mode hardcoded *//* WO_DBVT_CULLING */
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index b62e667c211..0613b137fe8 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -324,8 +324,9 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
{
CcdPhysicsEnvironment* ccdPhysEnv = new CcdPhysicsEnvironment(useDbvtCulling);
ccdPhysEnv->setDebugDrawer(new BlenderDebugDraw());
- ccdPhysEnv->setDeactivationLinearTreshold(0.8f); // default, can be overridden by Python
- ccdPhysEnv->setDeactivationAngularTreshold(1.0f); // default, can be overridden by Python
+ ccdPhysEnv->setDeactivationLinearTreshold(blenderscene->gm.lineardeactthreshold);
+ ccdPhysEnv->setDeactivationAngularTreshold(blenderscene->gm.angulardeactthreshold);
+ ccdPhysEnv->setDeactivationTime(blenderscene->gm.deactivationtime);
SYS_SystemHandle syshandle = SYS_GetSystem(); /*unused*/
int visualizePhysics = SYS_GetCommandLineInt(syshandle,"show_physics",0);
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 92a9b405b7c..21158a9461d 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -60,8 +60,8 @@ extern float gDeactivationTime;
extern bool gDisableDeactivation;
-float gLinearSleepingTreshold = 0.8f;
-float gAngularSleepingTreshold = 1.0f;
+float gLinearSleepingTreshold;
+float gAngularSleepingTreshold;
btVector3 startVel(0,0,0);//-10000);
@@ -519,6 +519,7 @@ void CcdPhysicsController::CreateRigidbody()
body->setAngularFactor(0.f);
}
body->setContactProcessingThreshold(m_cci.m_contactProcessingThreshold);
+ body->setSleepingThresholds(gLinearSleepingTreshold, gAngularSleepingTreshold);
}
if (m_object && m_cci.m_do_anisotropic)