member variable of some classes

Post Reply
lemonriver
Posts: 23
Joined: Thu Dec 30, 2010 4:04 am
Location: Hangzhou China

member variable of some classes

Post by lemonriver »

What's the meaning of some variable? How can I get details of
usage of them? Any books recommended?

Code: Select all

	/* Config		*/ 
	struct	Config
	{
		eAeroModel::_			aeromodel;		// Aerodynamic model (default: V_Point)
		btScalar				kVCF;			// Velocities correction factor (Baumgarte)
		btScalar				kDP;			// Damping coefficient [0,1]
		btScalar				kDG;			// Drag coefficient [0,+inf]
		btScalar				kLF;			// Lift coefficient [0,+inf]
		btScalar				kPR;			// Pressure coefficient [-inf,+inf]
		btScalar				kVC;			// Volume conversation coefficient [0,+inf]
		btScalar				kDF;			// Dynamic friction coefficient [0,1]
		btScalar				kMT;			// Pose matching coefficient [0,1]		
		btScalar				kCHR;			// Rigid contacts hardness [0,1]
		btScalar				kKHR;			// Kinetic contacts hardness [0,1]
		btScalar				kSHR;			// Soft contacts hardness [0,1]
		btScalar				kAHR;			// Anchors hardness [0,1]
		btScalar				kSRHR_CL;		// Soft vs rigid hardness [0,1] (cluster only)
		btScalar				kSKHR_CL;		// Soft vs kinetic hardness [0,1] (cluster only)
		btScalar				kSSHR_CL;		// Soft vs soft hardness [0,1] (cluster only)
		btScalar				kSR_SPLT_CL;	// Soft vs rigid impulse split [0,1] (cluster only)
		btScalar				kSK_SPLT_CL;	// Soft vs rigid impulse split [0,1] (cluster only)
		btScalar				kSS_SPLT_CL;	// Soft vs rigid impulse split [0,1] (cluster only)
		btScalar				maxvolume;		// Maximum volume ratio for pose
		btScalar				timescale;		// Time scale
		int						viterations;	// Velocities solver iterations
		int						piterations;	// Positions solver iterations
		int						diterations;	// Drift solver iterations
		int						citerations;	// Cluster solver iterations
		int						collisions;		// Collisions flags
		tVSolverArray			m_vsequence;	// Velocity solvers sequence
		tPSolverArray			m_psequence;	// Position solvers sequence
		tPSolverArray			m_dsequence;	// Drift solvers sequence
	};
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm
Contact:

Re: member variable of some classes

Post by dphil »

I have a good idea of a few of them.

kDP - damps forces acting on soft body nodes to reduce their oscillation over time. Imagine a mass hanging on a spring. With a kDP of 0 it would bounce up and down indefinitely. The higher the kDP, the faster the oscillation reduces. Actually, I think normally damping for mass-spring systems just moderates the intra-body forces, but it seems to damp the entire motion of the soft body in my simulation. With a kDP of 1, for example, gravity has very little effect on my soft body because all forces seem to be getting dampened out.

kDG and KLF relate to aerodynamics. See wikipedia pages for "drag coefficient" and "lift (force)". You can see them in action affecting pieces of cloth as they float to the ground in the "aero" soft body demo provided with the source code.

kDF - this is just friction of nodes against surfaces, as with rigid bodies.

kMT is used with setPose(bool, bool). The setPose method and its related coefficients is best described by Nathanael Presson here.

kCHR, kKHR and kSHR control how strict any overlap between the soft body and other types is treated. It's easiest to observe how this works by just trying out different values. For example, in my simulation, dropping a soft ball on a kinematic surface with a kKHR of 1 gave the appearance of a bouncing ball. With a kKHR of <1, the ball sinks slowly a bit into the surface (with kKHR near 0, the ball sinks all the way through).

I can't say much about the others at this point, but hopefully that helps.
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm
Contact:

Re: member variable of some classes

Post by dphil »

On a related note, the material coefficients:

kLST - linear stiffness. Conserves distance between adjacent nodes (like stiffness of a spring; higher value = stronger, more rigid spring). Related to linear or structural springs in a mass-spring system.
kAST - angular stiffness. Conserves angle between adjacent links. Imagine an L-shaped connection between 3 nodes, forming a 90-degree angle. A higher kAST gives a stronger force to keep that angle at 90 degrees. A kAST of 0 would allow one arm of the L to collapse on the other. Related to shear or, more properly, torsional springs in a mass-spring system.
kVST - not quite sure how this one works.
lemonriver
Posts: 23
Joined: Thu Dec 30, 2010 4:04 am
Location: Hangzhou China

Re: member variable of some classes

Post by lemonriver »

Thanks , dphil :)
Another question, how to set the rebound coefficient?
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm
Contact:

Re: member variable of some classes

Post by dphil »

You mean like the restitution coefficient for rigid bodies? Soft bodies don't have that, AFAIK. Their "rebound" behaviour is just a function of the values you set for their various other parameters/coefficients. However there is also the kS*_SPLT_CL coefficients... I have not tested those out myself yet, but I believe that they specify how to proportion the impulse generated by a collision between the soft body and a soft (kSS...), rigid (kSR...) or kinematic (kSK...) body (note the comments all say "soft vs rigid ..."; that is not correct). Their defaults are all 0.5, ie equal split of impulse to both colliding objects. However, I am guessing that if, for example, they were all set to 0, then any impulse from a collision between the soft body and any other body would be fully transmitted to the soft body alone, giving it more "rebound" (or "sloshing" around the obstacle depending on your sb cfg/material params), and leaving the other body unaffected. Again, I am not certain and have not tested this, but it is my guess. Just keep in mind that if you try to use those, it seems they are only in effect when using clusters (softBody->generateClusters(n), where n > 0), in which case make sure to also set the proper collision flags for clusters, which is where soft body Material::m_flags comes in.
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

Re: member variable of some classes

Post by Ehsanizadi »

I found a good reference for learning the physics of the softbodies.

In the chapter 8 (Particle systems) of the book "Physics-based animations" written by: Erleben/Sporring/Henriksen and Dohlmann, you cand find very useful info.
Post Reply