About GIMPACT 0.2 and DevO test demo

User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

About GIMPACT 0.2 and DevO test demo

Post by projectileman »

Hi.
After hours and hours of debugging and profiling, I've found that what is causing the slow down in DevO torus demo is not GIMPACT 0.2, nor its tree algorithms, nor GJK.

There is something suspicious in your test demo:

Code: Select all

/// Create Torus Shape
	{
		m_indexVertexArrays = new btTriangleIndexVertexArray
			(NUM_TRIANGLES,
			&gIndices[0][0],
			3*sizeof(int),
			NUM_VERTICES,
			(Real*) &gVertices[0],sizeof(Real)*3);


		btGImpactMeshShape * trimesh = new btGImpactMeshShape(m_indexVertexArrays);
		trimesh->setLocalScaling(btVector3(1.f,1.f,1.f));		
		trimesh->updateBound();
                trimesh->setMargin(0.05f); ///?????
		m_trimeshShape = trimesh;
        }
Whats wrong? this code calls trimesh->updateBound() and then trimesh->setMargin() . That's the wrong way.
At first you should alter all mesh parameters, like scaling or margin, and then you must call updateBound().

The function updateBound() builds and updates the bounding tree successfully, and it must be called every time when changing the mesh (F.E:Deformable meshes ).

However, I have good news !!
I'll release a new version of GIMPACT, version 0.3, which will comes with more optimizations, quantization, and convex descomposition (better for that torus chain). Also its code will be more readable (no templates).

Thanks DevO for your demo, its helps me improving GImpact and it gives me excelent tools for profiling its performance.

Thanks, and have a nice day.
Att : Francisco
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Re: About GIMPACT 0.2 and DevO test demo

Post by DevO »

Hi.

Now I am confusing.
I agree this is wrong.
But if I change it like this, then there it still no change in simulation speed.

Code: Select all

	
/// Create Torus Shape
	{
		m_indexVertexArrays = new btTriangleIndexVertexArray
			(NUM_TRIANGLES,
			&gIndices[0][0],
			3*sizeof(int),
			NUM_VERTICES,
			(Real*) &gVertices[0],sizeof(Real)*3);

		btGImpactMeshShape * trimesh = new btGImpactMeshShape(m_indexVertexArrays);
		trimesh->setLocalScaling(btVector3(1.f,1.f,1.f));
		trimesh->setMargin(0.05);
		trimesh->updateBound(); ///At first you should alter all mesh parameters, like scaling or margin, and then you must call updateBound().
		m_trimeshShape = trimesh;
	}
Nice to know that GIMPACT 0.3 is on the way!!!

Also the code will be readable, this is great news too!
What is about class naming, with this be changed?
Becouse GIMPACT work closer now with Bullet it would be great to use naming like in Bullet.
For example instate GIM_BOX_TREE calling it gimBoxTree or giBoxTree.

Well thank you in advance for GIMPACT 0.3! :)
User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

Re: About GIMPACT 0.2 and DevO test demo

Post by projectileman »

Ah! I forgot tell you that if you want more speed, you must set collision margin to 0.0 and disable GJK.

More collision margins means more tree nodes to test and more slowdowns.

About GIMPACT 0.3, its API won't change too much: btGImpactCollisionAlgorithm, btGImpactCompoundShape and btGImpactMeshShape expose the same functions and have to be managed in the same way, so you won't have to change your code.
Internally GIM_BOX_TREE is changed by btGImpactBvh.