Help inheriting from btSoftBody

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

Help inheriting from btSoftBody

Post by Flix »

Hello everybody.

Like other Bullet users that use Ogre for rendering (I suppose), I'm making my own "wrapper".
Instead of using the inner pointer inside the btRigidBody class, I'm using the approach of inheriting from it,
because I like to be able to call the base methods directly from my class, I can implement my own
"upcast" method for collision detection,and probably when the code deletes a base class pointer, my class gets deleted too (I'm not sure it's the best approach but I did it).

Anyway, in order to do the same with the btSoftBody class, I need some little non-breaking changes in its code:
To inherit from Bullet::btSoftBody instead of using a HAS-IT approach:
1) I need a protected empty (no args and no code inside) ctr in the Bullet btSoftBody class and
2) a refactored protected
void _init(btSoftBodyWorldInfo* worldInfo,int node_count,const btVector3* x,const btScalar* m)
method that takes the same arguments as the other and currently unique btSoftBody ctr (that basically will call this new method).
The reason for that is that I don't have 'ready to use' vertices when the ctr is called: I need more time to process a suitable Ogre dynamic mesh. I want to be able to call the new _init(...) method later.

Do you think that it's possible to make these changes ?

P.S: The new constraints looks much smoother, and the improved look of the constraint demos is amazing! Well done :).