Simple question btSoftBody constructor !!

winspear
Posts: 77
Joined: Thu Nov 26, 2009 6:32 pm

Simple question btSoftBody constructor !!

Post by winspear »

This may be a simple question but seriously the docs on softbody classes are horrible and the examples are even worse.

In the following constructor, can any one please explain what is parameter 2, 3 and 4.

btSoftBody::btSoftBody ( btSoftBodyWorldInfo * worldInfo,
int node_count,
const btVector3 * x,
const btScalar * m
) ;

Thanks
V
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Simple question btSoftBody constructor !!

Post by Flix »

winspear wrote:In the following constructor, can any one please explain what is parameter 2, 3 and 4.

btSoftBody::btSoftBody ( btSoftBodyWorldInfo * worldInfo,
int node_count,
const btVector3 * x,
const btScalar * m
) ;
Well, as far as I remember the btSoftBody ctr is quite "aggressive", in the sense that takes all the nodes (i.e. vertices) as arguments (their links must be specified after the ctr call). So the 2nd srg is the number of nodes and the 3rd the node array ptr. The last is probably the mass of each nodes (or maybe the total mass, please look at the implementation), but can be modified later on.

Hope it helps.

P.S. Since I like inheriting from these Bullet base classes, I've soon added a protected "empty" ctr to btSoftBody.h, so I can pass my nodes after doing some computation more easily.
winspear
Posts: 77
Joined: Thu Nov 26, 2009 6:32 pm

Re: Simple question btSoftBody constructor !!

Post by winspear »

Got it. Thanks for the reply.
If the third argument is supposed to be node array pointer, why would someone name it as "const btVector3 * x" in the constructor.
Weird naming convention. :?