a-invaders icon indicating copy to clipboard operation
a-invaders copied to clipboard

Explode component not functioning in A-Frame 4.0

Open processprocess opened this issue 9 years ago • 1 comments

Hi dmarcos!

When the A-Frame source is switched from "aframe-core.js" to "https://aframe.io/releases/0.4.0/aframe.min.js" the component breaks.

It looks like "entityEl.getObject3D('mesh');" on line 14 of "explode.js" is returning BufferGeometry instead of THREE.Mesh data, therefore it's not exposing the faces of the object and throws an error.

I'm hitting a wall trying to access the faces of the geometry. Any ideas?

processprocess avatar Jan 12 '17 06:01 processprocess

This works! by adding the following attribute at the start of the explode function. this.el.setAttribute(geometry, buffer: false;);

but: If it has a mixin, it throws errors, explodes and leaves a box left behind. Thus you need to add this: this.el.removeAttribute(mixin); then it looks great, but still throws errors.

If the mixin is empty, it explodes without errors: this.el.setAttribute('mixin',''); but this breaks the component.

the CSS has to set the background to black or else it will alter the colors of the mesh. I wonder how that can be controlled within the component without using CSS.

I've got it updated on my repo if you want to check it out.

processprocess avatar Jan 13 '17 02:01 processprocess