new cursor laser beam

This commit is contained in:
Kevin Ngo
2018-09-25 05:40:08 -07:00
parent cb54591fc4
commit 0061a781a4
9 changed files with 359 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
/**
* Pull a submesh out of a model file.
*/
AFRAME.registerComponent('sub-object', {
schema: {
from: {type: 'selector'},
name: {type: 'string'}
},
init: function () {
var el = this.el;
var data = this.data;
data.from.addEventListener('model-loaded', evt => {
const model = evt.detail.model;
const subset = model.getObjectByName(data.name);
el.setObject3D('mesh', subset.clone());
el.setAttribute('material', 'shader', 'flat');
el.emit('subobjectloaded', null, false);
});
}
});