Confusion on Vector3.CheckExtends

I would expect that a check described as

Checks if a given vector is inside a specific range

would return true if inside the range or false otherwise. What I think it does is instead is reset the minimum to lower values if v is inside range and reset maximum to higher values if v outside range.

Is this correct and how and why is it used?

The naming might definitely not be the most accurate here.

What checkExtends does is if the vector is outside the bound of min or max, it will update their values.

So to compute a bounding box for instance you could simply iterate over all the vertices of a mesh and call checkExtends starting with a infinity value for min and -infinity for max.

1 Like