crueleva1 / dynamica

Automatically exported from code.google.com/p/dynamica
0 stars 0 forks source link

feature request: animating input mesh #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm  trying to  see if this would be possible,  hacking the current  plugin a 
bit  by  writing  dgdirty every frame in an expression,  I can get bullet to 
rebuild the rbdMesh per frame. 

basic expression something like, 
if (mass == 0 ) 
{
dgDirty $rbdNode;
}

if the mass is greater than 0 then it stops rebuilding the mesh at that frame, 
and  then  runs as a rigid body sim as normal. 

should this be possible?,  I looked into  some of the code last night 
and  it seemed to be  possible if I could change the input to the 
collisionShape node to be the actual mesh, and dirty/clean the proper 
plugs,  it should update properly.  I just don't know what else is happening in 
the bullet side of things when the rbdObject is  being re-initialized,  as it 
seems that in my dgdirty hack test, after a rewind, the objects don't get 
re-built back in their proper place to match the animated input mesh.  Still 
trying to test around with this..  I'd love to help make this work and try to 
collaborate on some of the activation / deactivation  stuff too :-) 

Original issue reported on code.google.com by redpa...@gmail.com on 4 Jan 2011 at 7:48

GoogleCodeExporter commented 8 years ago
this should be relatively straightforward - along the direction you are going. 
we should be able to add a flag to enable/disable this feature and simply 
rebuild the collision shape every frame based on the input mesh transform and 
shape. This would involve running the passive RB creation routine per frame - 
which will certainly slow things down, but should do the trick. One potential 
wrinkle here is in the Bullet world  update - which may currently be 
uninterested in updating collision shapes while the sim is running...this 
feature is on my list too.

Original comment by mich...@mbakr.com on 1 Sep 2011 at 3:14

GoogleCodeExporter commented 8 years ago
It should be possible, but it takes some work/time.

For passive (non-moving/mass=0) objects, Bullet has a btBvhTriangleMeshShape 
that can refit the triangles. Other options are using the GImpact mesh, and 
updating the vertices, or temporarily switching to soft body.

Original comment by erwin.coumans on 21 Mar 2012 at 7:11