Rob, if your trying to do what I think your trying to do... which is either precalculate the bounding box dimensions, or calculate it realtime, theres one easy way to do it.
Loop through all of the mesh's vertices, find the vertices that are the farthest from the mesh's center in each axis. Remebering the box is aligned to the global coord system(I assume). We then have the dimensions for the bounding box(It will perfectly fit the object. If the Object rotates, the bounding box will have to be recalculated.
So, for example, to find the width of the bounding box. Loop through the vertices of the mesh, Find the location of the vertex farthest in the posotive X axis. This is the "right" most side of the box. Then find the vertes farthes in the negetive X axis. This is the "Left" most side of the box. Now just calculate the distance between them and you have the width of the box. Do the same in the Z/X axis and your set.
If you want this bounding box to not be recalculated every time the object rotates, do yourself a favor and create a cube to represent the bounding box, and child it.
Hope this makes sense.
Loop through all of the mesh's vertices, find the vertices that are the farthest from the mesh's center in each axis. Remebering the box is aligned to the global coord system(I assume). We then have the dimensions for the bounding box(It will perfectly fit the object. If the Object rotates, the bounding box will have to be recalculated.
So, for example, to find the width of the bounding box. Loop through the vertices of the mesh, Find the location of the vertex farthest in the posotive X axis. This is the "right" most side of the box. Then find the vertes farthes in the negetive X axis. This is the "Left" most side of the box. Now just calculate the distance between them and you have the width of the box. Do the same in the Z/X axis and your set.
If you want this bounding box to not be recalculated every time the object rotates, do yourself a favor and create a cube to represent the bounding box, and child it.
Hope this makes sense.