Commit: 2dfdbe4081f3b3f25e507f7c12ae26e8e00d6aa7
Author: Martin Felke
Date:   Mon Oct 26 20:25:59 2015 +0100
Branches: fracture_modifier
https://developer.blender.org/rB2dfdbe4081f3b3f25e507f7c12ae26e8e00d6aa7

calculating minimum impulse per object now, also made solver iteration settings 
not visible for compounds any more (they relate only to constraints)

===================================================================

M       extern/bullet2/src/BulletDynamics/Dynamics/btFractureDynamicsWorld.cpp
M       release/scripts/startup/bl_ui/properties_physics_fracture.py

===================================================================

diff --git 
a/extern/bullet2/src/BulletDynamics/Dynamics/btFractureDynamicsWorld.cpp 
b/extern/bullet2/src/BulletDynamics/Dynamics/btFractureDynamicsWorld.cpp
index 1bb8588..3dffe1e 100644
--- a/extern/bullet2/src/BulletDynamics/Dynamics/btFractureDynamicsWorld.cpp
+++ b/extern/bullet2/src/BulletDynamics/Dynamics/btFractureDynamicsWorld.cpp
@@ -920,8 +920,8 @@ void btFractureDynamicsWorld::fractureCallback( )
                        maxImpact = totalImpact;
 
                //some threshold otherwise resting contact would break objects 
after a while
-               if (totalImpact < 1.0f) //40.f
-                       continue;
+               //if (totalImpact < 10.0f) //40.f
+               //      continue;
 
                //              printf("strong impact\n");
 
@@ -1041,11 +1041,25 @@ void btFractureDynamicsWorld::fractureCallback( )
                                if (oldCompound->getNumChildShapes()>1)
                                {
                                        bool needsBreakingCheck = false;
-
+                                       btScalar totalObjImpact = 0.0f;
 
                                        //weaken/break the connections
 
                                        //@todo: propagate along the connection 
graph
+
+                                       for (int 
j=0;j<sFracturePairs[i].m_contactManifolds.size();j++)
+                                       {
+                                               btPersistentManifold* manifold 
= sFracturePairs[i].m_contactManifolds[j];
+                                               for (int 
k=0;k<manifold->getNumContacts();k++)
+                                               {
+                                                       btManifoldPoint& pt = 
manifold->getContactPoint(k);
+                                                       totalObjImpact += 
pt.m_appliedImpulse;
+                                               }
+                                       }
+
+                                       if (totalObjImpact < 
sFracturePairs[i].m_fracObj->m_propagationParameter.m_minimum_impulse)
+                                               continue;
+
                                        for (int 
j=0;j<sFracturePairs[i].m_contactManifolds.size();j++)
                                        {
                                                btPersistentManifold* manifold 
= sFracturePairs[i].m_contactManifolds[j];
diff --git a/release/scripts/startup/bl_ui/properties_physics_fracture.py 
b/release/scripts/startup/bl_ui/properties_physics_fracture.py
index 1920f18..8c8d57a 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fracture.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py
@@ -187,9 +187,10 @@ class PHYSICS_PT_fracture_simulation(PhysicButtonsPanel, 
Panel):
             row.prop(md, "breaking_angle_weighted")
             row.prop(md, "breaking_distance_weighted")
 
-        col = layout.column(align=True)
-        col.prop(md, "solver_iterations_override")
-        col.prop(md, "cluster_solver_iterations_override")
+            col = layout.column(align=True)
+            col.prop(md, "solver_iterations_override")
+            col.prop(md, "cluster_solver_iterations_override")
+
         layout.prop(md, "use_mass_dependent_thresholds")
         layout.prop(md, "mass_threshold_factor")

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to