TQ Bro. How about the bound.size function, it is use to get the width of the bounded box.
You want the bounding box of all the objects?
Even easier: you have to take the minimum and maximum X, Y, and Z of all the obejcts, and put them in a vector
I don't know if there's a ready Math Action with an operator for this, I just scanned but can't find anything that seems to find the highest and lowest values in a list of values, so I would go like this:
- Make an Array with all the X values of the objects.
- Get the first value of the Array and put it in HighX.
- Loop through the Array.
- If HighX value is higher than what is in the Array Index, keep it, and go to the next Item in the Array.
- If the value in the Index of the Array is higher than HighX, replace it.
- This way your HighX will be the highest in the Array when you reach the end.
Do the same for Y and Z, and put them in
VectorHIGH.
Do the same for the low of X, Y and Z and put them in
VectorLOW.
Now you have 2 vectors with the highest XYZ and lowest XYZ.
Subtract the
VectorLOW from the
VectorHIGH, and put the results in
VectorBoxSIZE.
Now divide
VectorBoxSIZE by 2, so you get the center of it, let's call it
VectorBoxCENTERRel, because this center is relative to its size, not to the world.
Now you add
VectorBoxCENTERRel to
VectorLOW and put them in
VectorBoxCENTERWorld.
With this data you can now create a bounding box at position
VectorBoxCENTERWorld, with size
VectorBoxSIZE.
There's probably some way to do this faster and with much more class, but this is what I can do: brute force LOL