cedricpinson / osgjs

Javascript Implementation of OpenSceneGraph [DISCONTINUED] Website archived https://cedricpinson.github.io/osgjs-website/
MIT License
786 stars 202 forks source link

[GC] strange bug on BBox in Node.computeBound #244

Closed Kuranes closed 9 years ago

Kuranes commented 9 years ago

See: https://github.com/cedricpinson/osgjs/tree/feature/multiFrustumAndShadowBounds/sources/osg/Node.js#L231

if using a closure to cache the "new bbox" it doesn't work rightly anymore. ( check frustum culling sample for instance )

Works if adding a member to Node class. But that means Higher Memory overhead. (but better than GC pollution)

Kuranes commented 9 years ago

Thanks to the @stephomi the reason for the bug is clear: it's recursive. No other way than storing that into a member variable of the class. more memory, but way better GC handling. (other solution is using the global mem pool of objects )