c++ - Loading a Bullet Physics mesh from a file -


i'm trying set city environment ogre , bullet, i'm having trouble figuring out how load meshes bullet. google shows references collada importer, seems have been removed svn.

the ogre mesh best thing import, have .dae , .blend files , use if possible.

i had same requirement when using bullet irrlicht. found no solution apart writing physics loading code myself. used object naming convention in 3d editor, , when loading model, iterated through sub-objects , constructed suitable btrigidbody each tagged object.

e.g.

        if (needsbody) {             if (prefix == "ball") {                 body = createspherebody(mesh, density);             }             else if (... 

similarly joints:

            if (parent && parent->body) {                 // add constraint                 ...                 if (prefix == "ball") {                     // ball/socket joint                                         constraint = new btgeneric6dofconstraint(                             *parent->body, *body, frameina, frameinb, true);                 }                 else if (... 

the createspherebody() function calculated radius mesh verts.

hope helps.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -