Page 1 of 1

Deformation demo.

Posted: Fri Oct 08, 2010 6:23 pm
by mi076
Small deformation demo, gimpact shape used.

Video: http://www.youtube.com/watch?v=oALjGVzN8v4

Download: http://code.google.com/p/game-ws/
Select deform_rXXX.7z.exe (self-extracting archive).

Usage: Run demo.exe (in "release" folder).
W,S,A,D and mouse to move.
LMB click to shoot.
F9 switch debug mode (collision triangles and points are visible in debug mode).
ESC to enter GUI / release mouse.


---------------------------
P.S. See also the attachment "HitTriangleDemo.zip" below.

Re: Deformation demo.

Posted: Thu Nov 04, 2010 1:32 am
by ramsampath
hello,

thanks for your demo.

i am trying to use GImpact shapes with GImpact, both deforming shapes as collision shapes..., I update the positions and am calling postUpdate(), but for some reason the collision detection fails.

i was wondering what you had to do in special to get bullet to recognize collisions for deforming GImpact shapes.

thank you.
ram.

Re: Deformation demo.

Posted: Fri Nov 05, 2010 5:44 am
by mi076
I use ray test :
create custom ray callback result with access to LocalShapeInfo (index, subpart id),
register Gimpact collision algorithm and create Gimpact mesh shape.
Send ray, get index, access Gimpact shape's vertex data. Process and, optionally, modify it (deform).

Attached is very very minimal Bullet-like example of above... i have posted it somewhere already... this is little updated version.
but for some reason the collision detection fails.
BTW, just an attempt to guess : may be you are using custom "contact added callback" (it has index and subpart id too, if available)? Have you set

Code: Select all

body->setCollisionFlags(body->getCollisionFlags()|btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
Thanks..

Re: Deformation demo.

Posted: Tue Nov 30, 2010 12:31 am
by ramsampath
thank you - it seems to work.