[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36234] trunk/blender/source/gameengine/ Physics/Bullet: Bugfix for #26795 and #26917, Fix a bug that cause the radar sensor to break

Erwin Coumans blender at erwincoumans.com
Wed Apr 20 06:55:59 CEST 2011


Revision: 36234
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36234
Author:   erwin
Date:     2011-04-20 04:55:58 +0000 (Wed, 20 Apr 2011)
Log Message:
-----------
Bugfix for #26795 and #26917, Fix a bug that cause the radar sensor to break
Never memset(&ob, 0,sizeof(class)) when there is a constructor, it overrides all memory.
The problem was that the memset(0) was setting the scaling to (0,0,0), the height of the cone became 'infinity' 
so GJK would iterate 'MAX_ITER' without converging due to this #NAN value

Modified Paths:
--------------
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.h
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

Modified: trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.h
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.h	2011-04-20 04:11:12 UTC (rev 36233)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.h	2011-04-20 04:55:58 UTC (rev 36234)
@@ -252,8 +252,40 @@
 		m_inertiaFactor(1.f),
 		m_do_anisotropic(false),
 		m_anisotropicFriction(1.f,1.f,1.f),
-		m_contactProcessingThreshold(1e10)
+		m_contactProcessingThreshold(1e10f),
+		m_soft_linStiff(1.f),
+		m_soft_angStiff(1.f),
+		m_soft_volume(1.f),
+		m_soft_viterations(0),
+		m_soft_piterations(1),
+		m_soft_diterations(0),
+		m_soft_citerations(4),
+		m_do_fh(false),
+		m_do_rot_fh(false),
+		m_fh_spring(0.f),
+		m_fh_damping(0.f),
+		m_fh_distance(1.f),
+		m_fh_normal(false),
+	m_soft_kVCF(1.f),
+	m_soft_kDG(0.f),
+	m_soft_kLF(0.f),
+	m_soft_kDP(0.f),
+	m_soft_kPR(0.f),
+	m_soft_kVC(0.f),
+	m_soft_kDF(0.2f),
+	m_soft_kMT(0),
+	m_soft_kCHR(1.0f),
+	m_soft_kKHR(0.1f),
+	m_soft_kSHR(1.0f),
+	m_soft_kAHR(0.7f),
+	m_soft_kSRHR_CL(0.1f),
+	m_soft_kSKHR_CL(1.f),
+	m_soft_kSSHR_CL(0.5f),
+	m_soft_kSR_SPLT_CL(0.5f),
+	m_soft_kSK_SPLT_CL(0.5f),
+	m_soft_kSS_SPLT_CL(0.5f)
 	{
+
 	}
 
 	btVector3	m_localInertiaTensor;

Modified: trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2011-04-20 04:11:12 UTC (rev 36233)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2011-04-20 04:55:58 UTC (rev 36234)
@@ -592,6 +592,9 @@
 
 	float subStep = timeStep / float(m_numTimeSubSteps);
 	i = m_dynamicsWorld->stepSimulation(interval,25,subStep);//perform always a full simulation step
+//uncomment next line to see where Bullet spend its time (printf in console)	
+//CProfileManager::dumpAll();
+
 	processFhSprings(curTime,i*subStep);
 
 	for (it=m_controllers.begin(); it!=m_controllers.end(); it++)
@@ -2759,7 +2762,8 @@
 PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float coneradius,float coneheight)
 {
 	CcdConstructionInfo	cinfo;
-	memset(&cinfo, 0, sizeof(cinfo)); /* avoid uninitialized values */
+//don't memset cinfo: this is C++ and values should be set in the constructor!
+
 	// we don't need a CcdShapeConstructionInfo for this shape:
 	// it is simple enough for the standard copy constructor (see CcdPhysicsController::GetReplica)
 	cinfo.m_collisionShape = new btConeShape(coneradius,coneheight);




More information about the Bf-blender-cvs mailing list