2014/06/17

Soft body vs Rigid body collision in Bullet for iOS

I have been trying Bullet and OpenGL in iOS recently.

At first I made some rigid bodies and I had them fall to a ground etc, I suppose most starters do that.
And next, I tried soft body. I didn’t know it is really difficult to handle soft bodies in Bullet.



↑You can see a plane like cloth, only one point (front right) is not fixed.
When the screen is tapped (the red point bellow appears where I tapped), one rigid body falls from random position.
It looks nice, doesn’t it?
The cloth is created by ‘CreatePatch’ and the plane is divided by 10 (both sides), but the speed (fps) looks enough in iPhone 5s.

I’m not sure how to show the result of Bullet by OpenGL in iOS. Because I have to get the result like this :
const btVector3& position = cloth_softBody->m_nodes[nodeIndex].m_x;

And more, I need these methods to get each value.
position.x()
position.y()
position.z()

So I made an array which has all data in every drawing timing. I suppose there must be more good way…

I hope a good tutorial website for Bullet in iOS.
Develop | Comments(0) | Trackback(0)
Comment

管理者のみに表示