My setModelBound don

My setModelBound don

What makes you think it didn't work?

BoundingSphere bound = new BoundingSphere();

bound.setCenter(new Vector3f(0,0,0));

bound.setRadius(15);

morfador.setModelBound(bound);





BoundingSphere bound = new BoundingSphere();

bound.setCenter(new Vector3f(100,100,100));

bound.setRadius(1500);

morfador.setModelBound(bound);





why?


Did you update the scene graph after changing the bounding? Call updateGeometricState on your root node. This will take the new model bounds and translate them into world bounds + propogate up the tree to generate the node's bounds.

i insert into the initPlayer method and after into load method -> rootNode.updategeometricState(0, true)…and still dont work…



Sorry man for my stupid question…



Ps: Sorry for my spelling too…my translation

Why are you manually setting your bounds params like center and size?

I could make this -> BoundSphere bound = new BoundSphere(new Vector3f(10,10,10), 15) or setModelBound( new BoundingSphere(15, new Vector3f(10,10,10)));…for instance…but still dont work…

I don

why are you setting the params though?  Why not just



setModelBound(new BoundingSphere());

updateModelBound();



?

Now I understand your question…

the problem is: when my character morph their TriMesh, the BoundingVolume increase or decrease with the movements…and I dont want this…



Look the trees…the BoundingBox…I want that the BoundingVolume no increase or decrease…



Sorry for may spelling

I can see why you want to set the bounding volume yourself. You wouldn't want to run into a tree from  meters away.  You seemed to manage with the trees though! or did you do something different there?



However note that you can run into issues with culling like this. If the BoundingBox on those trees is outside of the cameraview, the entire tree could be culled. Maybe you can put invisible objects with boundings on a different Node and link their coordinates together. If you do:



invisibleSpatial.setLocalTranslation(mySpatial.getLocalTranslation());



any updates on the translation of mySpatial will work for invisibleSpatial too, as long as you do these updates something like:



Vector3f localtrans = mySpatial.getLocalTranslation(); // modify localtrans to change translation



rather than using setLocalTranslation(). Same goes the other way around of course.



As for your problem, try calling updateWorldBound() on your Spatial after you give it a modelbound.

this size that I want…





But this only work if I remove addController. If I remove the addController method, my character dont morph their TriMesh…



Sorry for my spelling…and thx for all support

Ah, yes. JointController has the following line:



if (j != 0) {

                if (updatePerFrame) updatingGroup.updateModelBound();

            }



so you need to turn off model bounding updating in the controller:



controller.setModelUpdate(false);



obtain the controllers from the model and do this.

Yeah!!! :lol:



Thank you so much!!!



Now its working pretty smoothly…



Thx again…

pretty esmoothly







Thx guys!!!