java - libgdx body from model -


i'm trying make game, using libgdx. create model *g3db file this:

public assetmanager assets; assets = new assetmanager(); assets.load("data/road.g3db", model.class); model road = assets.get("data/road.g3db", model.class); modelinstance roadinstance = new modelinstance(road); 

data/road.g3db а long ribbon road. make in blender 3d. somthing this:

      ****      *    *****         ****     *          *       *  ***            ******* 

my question is: how can create body model? try this:

chainshape shape = new chainshape(); mesh roadmesh = roadinstance.model.meshes.get(0);  float ar[] = new float[roadmesh.getverticesbuffer().capacity()]; roadmesh.getverticesbuffer().get(ar);  shape.createchain(ar); 

but there error:

 al lib: (ee) alc_cleanup: 1 device not closed  assertion failed!   program: c:\program files (x86)\java\jre7\bin\javaw.exe  file: /var/lib/jenkins/workspace/libgdx/gdx/jni/box2d/collision/shapes/b2chainshape.cpp,  line 63 

expression: b2distancesquared(v1, v2) > 0.005f * 0.005f

is there way create body long road ?

box2d is, name says, 2d physics. if have 3d game, 2d physics only, can use under hood , change view 3d. if need 3d physics suggest use physicsbullet. 3d collision detection , rigid body dynamics library. give read: bullet physics on github


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -