btSoftBody orientation

fredde
Posts: 2
Joined: Wed May 06, 2009 1:49 pm

btSoftBody orientation

Post by fredde »

I've just started working with the softbody. I want to use it as a clumsy vehicle and want to apply a force to the direction/orientation it's facing. I've tried adding multiple forces to a couple of nodes/faces (using the direction the normals are pointing from this faces) in the front of the model but as soon as it collides the front normals gets really screwed up.

Does anyone have a good idea how to get an "average" orientation for the complete model (and not just some of the nodes) to make it more trustful?

Many thanx for any suggestions!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btSoftBody orientation

Post by Erwin Coumans »

When enabling collision clusters for soft bodies, the first cluster can provide a global coordinate frame for the soft body.

There are 2 soft body demos using this global coordinate frame, to attach constraints. See Demos\SoftDemo\SoftDemo.cpp, Init_ClusterCar

Code: Select all

	psb->m_cfg.collisions	=	btSoftBody::fCollision::CL_SS+btSoftBody::fCollision::CL_RS;
///pass in a bigger number into generateClusters to create a better approximation of collision clusters
	psb->generateClusters(1);
Hope this helps,
Erwin
fredde
Posts: 2
Joined: Wed May 06, 2009 1:49 pm

Re: btSoftBody orientation

Post by fredde »

Thanks alot, Erwin, that's sounds like exactly what I need! I will try the demo and check how it works...

//Fredrik