Loading blender scene

Hi everyone, i am trying to load a whole scene made in blender into my game. I have some objects there and i am only able to go around them, not between them, like they are one big object. Is there some way to do what i want or i have to load one by one (pain in the neck)?

Thanks.



EDIT: What i mean by not able to go between them is because there is collision detection on the "big object", i just want that collision on the small objects in the scene, so i think that is a physics problem, please someone move this topic to there.

You can load the scene at once. If you got no dynamic parts in it you can even create one static physics node, attach the whole scene and generate collision geometries with trimesh accuracy. If you need dynamic parts it'll be more complicated to set up the physics nodes, though (still you can load at once).



Can you sketch your setup?



(can't move the topic, lacking privileges in here)

No, there is no dynamic parts. The class extends Node and it has a static physics node, here it is:

private void createScene(PhysicsSpace physicsSpace, Vector3f position) {
      staticPhysicsNode = physicsSpace.createStaticNode();
      staticPhysicsNode.setLocalTranslation(position);
      staticPhysicsNode.createBox("theWholeScene");
      staticPhysicsNode.attachChild(loadTheWholeScene());
      staticPhysicsNode.generatePhysicsGeometry();
      staticPhysicsNode.setMaterial(Material.IRON);
      staticPhysicsNode.setLocalScale(11f);
      this.attachChild(staticPhysicsNode);
   }


The blender model is for test purpose, it only has 3 boxes.
Thanks again.

jME Physics 2 does not recognize your meshes as three single boxes thus it uses the bounding volume to create collision geometry (which probably is one large box/sphere), as you told to avoid trimeshes <- generatePhysicsGeometry()

Call generatePhysicsGeometry(true) to use trimesh accuracy.

Nice, it works. Thanks.

XD

Hi again, the scene has a bunch of duplicate objects and it is taking a long time to load everything. I was wondering if there's some kind of cache to store these objects and decrease the loading time. It's not a big scene and i have to load them all on startup.

Thanks.

You need to use a format that supports reusing objects (and blenders need to use that feature). Not sure which formats support this and if jME loaders make use of this, though. Additionally jME Physics 2 (ODE part) would need an update to make use of shared geometries…

I think that my problem is caused by the round part of the object.



It is a lego piece, on the beginning when it had a few pieces, the loading time was normal but as the number grows it became slower because every piece has 8 circles, the game has more than 200 lego pieces.

I don’t know whether it has a solution or not.

:?