BoudingBox and Vector3f's

I was profiling our JME3 game today and noticed that millions of Vector3f’s where generated (and garbage collected). Especially method distanceToEdge(Vector3f point) in the BoudingBox generated a lot of new Vector3f’s.



Can BoudingBox line 808: Vector3f closest = point.subtract(center); be changed in something with a temporary vector (Vector3f closest = point.subtract(center, tempVector)) that is being re-used each method call? That would save a lot of new Vector3f calls, but I do not know if it creates other issues?

Erf… thanks for this, i’ll fix it asap.

Done in last SVN

Thxs @nehon , I see the SVN update!