Recommended way to load a Blender scene (map) in bullet

Pacha
Posts: 26
Joined: Sat Jun 15, 2013 2:29 am

Recommended way to load a Blender scene (map) in bullet

Post by Pacha »

Hello everyone. I am making a game using Bullet + Ogre3D, and I am using a low poly world map. This can't be represented with a height map, as it has some underground parts, buildings, etc. For example this screenshot could be part of the map (of course it is simple and it will be more complex), as you see it has a really weird shape.

Image

So far I used this, but I was wondering if I should consider it to make a really big map later on:

Code: Select all

BtOgre::StaticMeshToShapeConverter converter(ent);
btBvhTriangleMeshShape* colshape = converter.createTrimesh();
btTransform transform;
transform.setIdentity();
btRigidBody* body = new btRigidBody(0, new btDefaultMotionState(), colshape);
body->setWorldTransform(transform);
body->setLinearFactor(btVector3(0, 0, 0));
body->setAngularFactor(btVector3(0, 0, 0));
Physics::getSingleton()->getWorld()->addRigidBody(body);
Thanks.
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Recommended way to load a Blender scene (map) in bullet

Post by Flix »

I'm not familiar with btOgre.
However creating a btBvhTriangleMeshShape for the map should be OK in most cases.

You can use "the internal edge fix" on it to improve collision detection.
Please see the internal edge Bullet Demo or the code I've recently posted here: http://www.bulletphysics.org/Bullet/php ... =17&t=9666.
(I've made the map using Blender too: it's rather small but still bigger than yours :) ).
Pacha
Posts: 26
Joined: Sat Jun 15, 2013 2:29 am

Re: Recommended way to load a Blender scene (map) in bullet

Post by Pacha »

Flix wrote:I'm not familiar with btOgre.
However creating a btBvhTriangleMeshShape for the map should be OK in most cases.

You can use "the internal edge fix" on it to improve collision detection.
Please see the internal edge Bullet Demo or the code I've recently posted here: http://www.bulletphysics.org/Bullet/php ... =17&t=9666.
(I've made the map using Blender too: it's rather small but still bigger than yours :) ).
Oh thanks, will check it out. Also I was wondering what kind of Character Controller you use, as bullet's built-in one is really bugged, and I can't find a better replacement online.

Thank you.
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Recommended way to load a Blender scene (map) in bullet

Post by Flix »

Pacha wrote: Also I was wondering what kind of Character Controller you use, as bullet's built-in one is really bugged, and I can't find a better replacement online.
Well, I've used bullet's built-in one :) , and that was the first time I've ever used it: so I cannot really answer your question :P .