Advertisement

Mesh Physics bullet physics and assimp

Started by December 13, 2013 07:31 PM
4 comments, last by beans222 11 years, 2 months ago

I have been working on implementing bullet physics into my current project. I have worked with bullet before and am quite familiar with it, however, I am not as familiar with Assimp.

I have been reading up on both libraries and how they work and what the best way would be to combine them, but after googling excessively and lots of trial and error, I am still at a loss as to where to really begin. Every time I start implementing Bullet, I run into a problem with assimp.

Any suggestions as to where to start? (I have basic collision shapes in the engine as well as bullet initiation. I also can load and render models in the engine so far. I just want help on creating a mesh collider with assimp and bullet).

Thanks!

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)

Read triangles from assimp. Feed triangles to bullet.

Advertisement

Read triangles from assimp. Feed triangles to bullet.

I know that much, but I don't know HOW... That's the problem. I've done mesh physics before with other libraries (my own physics library and a once-over .obj reader) but never with bullet and assimp.

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)

aiMesh::mVertices => btTriangleMesh::addTriangle

aiMesh::mVertices => btTriangleMesh::addTriangle

Thank you! I looked through the documentation and completely missed btTriangleMesh::addTriangle.

I develop to expand the universe. "Live long and code strong!" - Delta_Echo (dream.in.code)

Might be easier to use btTriangleIndexVertexArray::addIndexedMesh, http://bulletphysics.org/Bullet/BulletFull/classbtTriangleIndexVertexArray.html#a106dc4486bccc8b6a3e2c250ad7e238c

You'll want to make copies of the assimp data (just memcpy into suitably sized arrays) then feed it to bullet.

You'll also need to keep track of those pointers as bullet does not take ownership of anything it did not

allocate itself.

New C/C++ Build Tool 'Stir' (doesn't just generate Makefiles, it does the build): https://github.com/space222/stir

This topic is closed to new replies.

Advertisement