- Home /
Question by
pci · Oct 08, 2014 at 04:04 AM ·
meshboundsdocumentation
Mesh.RecalculateBounds
The documentation for the function contains this comment... "Assigning triangles will automatically Recalculate the bounding volume."
Experimentally I am seeing differences if I manually call this after assigning triangles?
mesh.triangles = newTriangles;
Bounds b1 = mesh.bounds;
mesh.RecalculateBounds();
Bounds b2 = mesh.bounds;
if (b1 != b2)
{
Debug.Log("Bounds "+b1+" => "+b2);
}
Bounds Center: (19.5, 0.8, 19.5), Extents: (28.1, 0.8, 28.2) => Center: (19.5, 0.8, 29.4), Extents: (28.1, 0.8, 38.0)
Is the documentation incorrect, or am I mis-understanding something?
Paul
Comment
Answer by MakeCodeNow · Oct 08, 2014 at 04:11 AM
The documentation is probably out of date. I would personally always call RecalculateBonds (and RecalculateNormals) to be sure everything was fresh and correct.