Question about _setBoundingSphereRadius() with manual mesh

Problems building or running the engine, queries about how to use features etc.
Post Reply
Niubbo
Goblin
Posts: 211
Joined: Sat Jan 23, 2016 11:26 am
x 17

Question about _setBoundingSphereRadius() with manual mesh

Post by Niubbo »

Ogre Version: 1.11.8
Operating System: win10
Render System: dx9

I created a manual mesh using the vertex buffers and assigning a boundingbox manually, but is not clear to me the meaning of the function _setBoundingSphereRadius() ; isn't the radius calculated automatically using the boundingbox data? what happen if I set a radius bigger than the one of boundingbox set? thanks.

chilly willy
Halfling
Posts: 65
Joined: Tue Jun 02, 2020 4:11 am
x 19

Re: Question about _setBoundingSphereRadius() with manual mesh

Post by chilly willy »

Yes, the bounding radius is automatically calculated when you call Mesh::_setBounds(). Here is the relevant code from that function:

Code: Select all

        mAABB = bounds;
        mBoundRadius = Math::boundingRadiusFromAABB(mAABB);

The warning that "Calling this method is required when building manual meshes." is present in the comments for the whole family of functions for setting the bounds of a mesh, but just calling _setBounds is sufficient.

Niubbo
Goblin
Posts: 211
Joined: Sat Jan 23, 2016 11:26 am
x 17

Re: Question about _setBoundingSphereRadius() with manual mesh

Post by Niubbo »

thanks you, is clear

Post Reply