try to simulate soft body, bind with ogre

foolegg
Posts: 5
Joined: Tue Dec 22, 2009 3:32 pm

try to simulate soft body, bind with ogre

Post by foolegg »

a small test
snapshot5.png
snapshot6.png
this patch and ball is a ogre format mesh, create in blender
snapshot10.png
and I'm trying convert this ball to a convexhull, testing...
You do not have the required permissions to view the files attached to this post.
Last edited by foolegg on Wed Dec 23, 2009 4:12 pm, edited 1 time in total.
foolegg
Posts: 5
Joined: Tue Dec 22, 2009 3:32 pm

Re: try to simulate soft body, combin in ogre

Post by foolegg »

e....

Code: Select all

btConvexHullShape::btConvexHullShape( const btScalar * points = 0, int numPoints = 0, int stride = sizeof(btVector3) )

this constructor optionally takes in a pointer to points. 
Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory. It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint. btConvexHullShape make an internal copy of the points. 
According to my understanding, the *ponit is a array like this format:

Code: Select all

{ x0, y0, z0, x1, y1, z1, x2, y2, z2 ........ }
just like vertices array

and numPoints is the count of vertics

it's correct?
foolegg
Posts: 5
Joined: Tue Dec 22, 2009 3:32 pm

Re: try to simulate soft body, combin in ogre

Post by foolegg »

yes, I deal with convexhull problem, but encounter another...

like this
snapshot11.png
the softbody pass the sphere after collision.

then,I scale the sphere, I enlarge this sphere 5% with

Code: Select all

bshape->setLocalScaling(btVector3)
it well
snapshot12.png
what should I do to deal with this problem? thx for any information.

this is src
soft_dev.tar.gz
in line 329

Code: Select all

    btScalar s = 2.0;
    bshape->setLocalScaling(btVector3(s,s,s));
s = 2.0 work well
s = 1.9 will with trouble

ps: there is some chinese charact in src commit, maybe you system cannot not display it, do not worry about it...
You do not have the required permissions to view the files attached to this post.
foolegg
Posts: 5
Joined: Tue Dec 22, 2009 3:32 pm

Re: try to simulate soft body, combin in ogre

Post by foolegg »

I record this video demo, to show the problem
demo_002.ogv.zip
You do not have the required permissions to view the files attached to this post.