Advertisement Jump to content
Sign in to follow this  
Jesse Dager

Mesh Physics bullet physics and assimp

This topic is 1857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

aiMesh::mVertices => btTriangleMesh::addTriangle

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!