My hard drive decided I should take a break from jME for a while, and now that I'm starting to work with it again I've got a question (surprise surprise).
Scenario:
2 models. model1 has two cubes defined, CubeA, CubeB. model2 is something simple - like a sphere for arguments sake.
The goal? Place model2 on CubeB.
Psuedocode:
Node model1 = ModelLoader.loadModel( model1File );
Node model2 = ModelLoader.loadModel( model2File );
Spatial cubeB = model1.getChild("CubeB");
cubeB.setModelBound( new BoundingBox() );
cubeB.updateModelBound();
cubeB.updateWorldBound();
Vector3f center = cubeB.getWorldBound().getCenter();
model1.attachChild(model2);
model2.setLocalTranslation(center);
Is this the optimum way to accomplish this goal?