superframe icon indicating copy to clipboard operation
superframe copied to clipboard

[aabb-collider] Remove boxhelper when component is removed

Open jgbarah opened this issue 5 years ago • 2 comments

If 'debug' is set to true, a boxhelped is added to the scene for the element with the collider, and for elements potentially colliding with it. If the collider component is removed from the element, all those boxhelpers should be removed. This patch removes them.

jgbarah avatar Dec 26 '20 18:12 jgbarah

Moving to work in progress, because after playing a bit with it, I'm not the patch has undesired side effects.

jgbarah avatar Dec 26 '20 19:12 jgbarah

Removing "WIP", it seems this is ready for prime time... (side effects were from the testing code :-( ).

jgbarah avatar Dec 26 '20 20:12 jgbarah

Oh boxHelper.dispose() is actually new from threejs r145, so this will work only on aframe master with super-three r147 or in next aframe 1.4.0. It's better to verify the function exist before calling it boxHelper.dispose && boxHelper.dispose()

vincentfretin avatar Dec 19 '22 14:12 vincentfretin

I addressed my comments and created #309 Thanks @jgbarah for the initial fix.

vincentfretin avatar Dec 19 '22 14:12 vincentfretin

@dmarcos you can close this one now #309 is merged. Thanks!

vincentfretin avatar Jan 06 '23 18:01 vincentfretin

Closing this in favor of https://github.com/supermedium/superframe/pull/309

dmarcos avatar May 05 '23 17:05 dmarcos