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:
authorErwin Coumans <blender@erwincoumans.com>2009-05-24 02:35:47 +0400
committerErwin Coumans <blender@erwincoumans.com>2009-05-24 02:35:47 +0400
commiteb8c5f3272b87fffaf017badf55f761de9a04fd1 (patch)
tree6ce64cb7c6c1a2028a8bdb75bb951f6ad0e01bec /source/gameengine/Converter
parenta96ce9453f2a8d39e238d20c1c4dec9fe5becfb5 (diff)
Set default constraint solver mode more compatible to Blender 2.48 settings, this fixes rigid body stacking in this blend file:
http://blenderartists.org/forum/showpost.php?p=1382653&postcount=102 (todo: expose this setting in World setting GUI) Expose contact processing threshold in Advanced GUI, next to rigid body margin, called CPT. Default to 1, makes rigid body stacking a bit more stable, smaller values makes sliding easier (at the cost of easier jittering). Disabled for 'dynamic' objects that don't rotate, because characters etc. always need smooth sliding.
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 06a4da4fce0..a9c839595c2 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1412,11 +1412,22 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
objprop.m_isCompoundChild = isCompoundChild;
objprop.m_hasCompoundChildren = hasCompoundChildren;
objprop.m_margin = blenderobject->margin;
+
// ACTOR is now a separate feature
objprop.m_isactor = (blenderobject->gameflag & OB_ACTOR)!=0;
objprop.m_dyna = (blenderobject->gameflag & OB_DYNAMIC) != 0;
objprop.m_softbody = (blenderobject->gameflag & OB_SOFT_BODY) != 0;
objprop.m_angular_rigidbody = (blenderobject->gameflag & OB_RIGID_BODY) != 0;
+
+ ///contact processing threshold is only for rigid bodies and static geometry, not 'dynamic'
+ if (objprop.m_angular_rigidbody || !objprop.m_dyna )
+ {
+ objprop.m_contactProcessingThreshold = blenderobject->pad3;
+ } else
+ {
+ objprop.m_contactProcessingThreshold = 0.f;
+ }
+
objprop.m_sensor = (blenderobject->gameflag & OB_SENSOR) != 0;
if (objprop.m_softbody)
@@ -1461,6 +1472,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/
objprop.m_soft_welding = blenderobject->bsoft->welding; /* welding */
objprop.m_margin = blenderobject->bsoft->margin;
+ objprop.m_contactProcessingThreshold = 0.f;
} else
{
objprop.m_gamesoftFlag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT;
@@ -1501,6 +1513,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
objprop.m_soft_numclusteriterations= 16;
objprop.m_soft_welding = 0.f;
objprop.m_margin = 0.f;
+ objprop.m_contactProcessingThreshold = 0.f;
}
}