Model Bounding

hi again,

I use a ray collision to check if the player selects a unit but the generated bounding volume is a little bit to small. Is there a way to get the size of the model meshs so that I can automatically resize the bounding box? This would be also useful to get an ideal position for the hpbar and the selection circle.

By the way can you suggest me a common size for my game world? (for example 64 units = 1 metre)

The bounding volume is generated automatically, if its not correct check if your mesh data is updated (if you create custom meshes). 1 unit = 1 meter is what most things (physics, water etc.) work with.

you can add an additional box geometry with size you want to get and attach it to a player.

or have a try like this:

[java]

node.getWorldBound().transform(new Transform(Vector3f, Quaternion, Vector3f)); //try to transform it

node.updateModelBound();

//or

geometry.getWorldBound().transform(new Transform(Vector3f, Quaternion, Vector3f)); //try to transform it

geometry.updateModelBound();

[/java]



1 unit = 1 meter would be better, imho.

You should not (have to) mess with the bounds at all.

The genereated Box is not bad but I thought it could be useful if some small scaled and thin models (for example the Ninja) would have a larger bounding volume. When I should not change the bounding box I have still the question to detect the position for the hpbar/selection circle. This could be also useful to walk over the terrain without using the physic system. (Komm mir schon dumm vor immer auf Englisch zu schreiben wenn es sowieso klar ist das Normen antwortet :wink: )