MCPcopy
hub / github.com/aframevr/aframe / onEyeLoaded

Function onEyeLoaded

tests/extras/primitives/primitives/a-sky.test.js:69–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67
68 var loaded = 0;
69 function onEyeLoaded () {
70 if (++loaded < 2) { return; }
71 // Recycle both {color, shader, side, minFilter} attrValues into the pool.
72 leftEye.removeAttribute('material');
73 rightEye.removeAttribute('material');
74 // a-sky's material attrValue is now pulled from the dirtied pool.
75 var skyEl = document.createElement('a-sky');
76 skyEl.setAttribute('material', 'src: sky.webp');
77 skyEl.addEventListener('loaded', function () {
78 try {
79 var material = skyEl.getAttribute('material');
80 assert.equal(material.src, 'sky.webp');
81 assert.equal(material.side, 'back');
82 assert.equal(material.shader, 'flat');
83 assert.equal(material.minFilter, 'linear');
84 done();
85 } catch (e) { done(e); }
86 });
87 sceneEl.appendChild(skyEl);
88 }
89 leftEye.addEventListener('loaded', onEyeLoaded);
90 rightEye.addEventListener('loaded', onEyeLoaded);
91 sceneEl.appendChild(leftEye);

Callers

nothing calls this directly

Calls 3

removeAttributeMethod · 0.80
setAttributeMethod · 0.45
getAttributeMethod · 0.45

Tested by

no test coverage detected