|
@@ -51267,23 +51267,21 @@ TextGeometry.prototype.computeBoundingSphere = function () {
|
|
if (this.boundingSphere === null) {
|
|
if (this.boundingSphere === null) {
|
|
this.boundingSphere = new THREE.Sphere()
|
|
this.boundingSphere = new THREE.Sphere()
|
|
}
|
|
}
|
|
- //LIVECODING.SPACE changes!!! FIX - move to LCS codebase
|
|
|
|
- if(this.attributes.position) {
|
|
|
|
- var positions = this.attributes.position.array
|
|
|
|
- var itemSize = this.attributes.position.itemSize
|
|
|
|
- if (!positions || !itemSize || positions.length < 2) {
|
|
|
|
- this.boundingSphere.radius = 0
|
|
|
|
- this.boundingSphere.center.set(0, 0, 0)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- utils.computeSphere(positions, this.boundingSphere)
|
|
|
|
- if (isNaN(this.boundingSphere.radius)) {
|
|
|
|
- console.error('THREE.BufferGeometry.computeBoundingSphere(): ' +
|
|
|
|
- 'Computed radius is NaN. The ' +
|
|
|
|
- '"position" attribute is likely to have NaN values.')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ var positions = this.attributes.position.array
|
|
|
|
+ var itemSize = this.attributes.position.itemSize
|
|
|
|
+ if (!positions || !itemSize || positions.length < 2) {
|
|
|
|
+ this.boundingSphere.radius = 0
|
|
|
|
+ this.boundingSphere.center.set(0, 0, 0)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ utils.computeSphere(positions, this.boundingSphere)
|
|
|
|
+ if (isNaN(this.boundingSphere.radius)) {
|
|
|
|
+ console.error('THREE.BufferGeometry.computeBoundingSphere(): ' +
|
|
|
|
+ 'Computed radius is NaN. The ' +
|
|
|
|
+ '"position" attribute is likely to have NaN values.')
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
TextGeometry.prototype.computeBoundingBox = function () {
|
|
TextGeometry.prototype.computeBoundingBox = function () {
|
|
if (this.boundingBox === null) {
|
|
if (this.boundingBox === null) {
|
|
@@ -62753,6 +62751,9 @@ module.exports.Component = registerComponent('vr-mode-ui', {
|
|
uiElement.parentNode.removeChild(uiElement);
|
|
uiElement.parentNode.removeChild(uiElement);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ this.enterVREl = undefined;
|
|
|
|
+ this.enterAREl = undefined;
|
|
|
|
+ this.orientationModalEl = undefined;
|
|
},
|
|
},
|
|
|
|
|
|
updateEnterInterfaces: function () {
|
|
updateEnterInterfaces: function () {
|
|
@@ -63298,14 +63299,11 @@ module.exports.Component = registerComponent('text', {
|
|
this.shaderData = {};
|
|
this.shaderData = {};
|
|
this.geometry = createTextGeometry();
|
|
this.geometry = createTextGeometry();
|
|
this.createOrUpdateMaterial();
|
|
this.createOrUpdateMaterial();
|
|
- this.mesh = new THREE.Mesh(this.geometry, this.material);
|
|
|
|
- this.el.setObject3D(this.attrName, this.mesh);
|
|
|
|
},
|
|
},
|
|
|
|
|
|
update: function (oldData) {
|
|
update: function (oldData) {
|
|
var data = this.data;
|
|
var data = this.data;
|
|
var font = this.currentFont;
|
|
var font = this.currentFont;
|
|
-
|
|
|
|
if (textures[data.font]) {
|
|
if (textures[data.font]) {
|
|
this.texture = textures[data.font];
|
|
this.texture = textures[data.font];
|
|
} else {
|
|
} else {
|
|
@@ -63341,9 +63339,7 @@ module.exports.Component = registerComponent('text', {
|
|
this.material = null;
|
|
this.material = null;
|
|
this.texture.dispose();
|
|
this.texture.dispose();
|
|
this.texture = null;
|
|
this.texture = null;
|
|
- if (this.shaderObject) {
|
|
|
|
- delete this.shaderObject;
|
|
|
|
- }
|
|
|
|
|
|
+ if (this.shaderObject) { delete this.shaderObject; }
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -63360,9 +63356,7 @@ module.exports.Component = registerComponent('text', {
|
|
// Infer shader if using a stock font (or from `-msdf` filename convention).
|
|
// Infer shader if using a stock font (or from `-msdf` filename convention).
|
|
shaderName = data.shader;
|
|
shaderName = data.shader;
|
|
if (MSDF_FONTS.indexOf(data.font) !== -1 || data.font.indexOf('-msdf.') >= 0) {
|
|
if (MSDF_FONTS.indexOf(data.font) !== -1 || data.font.indexOf('-msdf.') >= 0) {
|
|
- //LiveCoding.space FIX
|
|
|
|
- let webgl2 = document.querySelector('a-scene').renderer.capabilities.isWebGL2;
|
|
|
|
- shaderName = webgl2 ? 'msdf' : 'msdf1'
|
|
|
|
|
|
+ shaderName = 'msdf';
|
|
} else if (data.font in FONTS && MSDF_FONTS.indexOf(data.font) === -1) {
|
|
} else if (data.font in FONTS && MSDF_FONTS.indexOf(data.font) === -1) {
|
|
shaderName = 'sdf';
|
|
shaderName = 'sdf';
|
|
}
|
|
}
|
|
@@ -63410,7 +63404,7 @@ module.exports.Component = registerComponent('text', {
|
|
if (!data.font) { warn('No font specified. Using the default font.'); }
|
|
if (!data.font) { warn('No font specified. Using the default font.'); }
|
|
|
|
|
|
// Make invisible during font swap.
|
|
// Make invisible during font swap.
|
|
- this.mesh.visible = false;
|
|
|
|
|
|
+ if (this.mesh) { this.mesh.visible = false; }
|
|
|
|
|
|
// Look up font URL to use, and perform cached load.
|
|
// Look up font URL to use, and perform cached load.
|
|
fontSrc = this.lookupFont(data.font || DEFAULT_FONT) || data.font;
|
|
fontSrc = this.lookupFont(data.font || DEFAULT_FONT) || data.font;
|
|
@@ -63426,14 +63420,7 @@ module.exports.Component = registerComponent('text', {
|
|
if (!fontWidthFactors[fontSrc]) {
|
|
if (!fontWidthFactors[fontSrc]) {
|
|
font.widthFactor = fontWidthFactors[font] = computeFontWidthFactor(font);
|
|
font.widthFactor = fontWidthFactors[font] = computeFontWidthFactor(font);
|
|
}
|
|
}
|
|
-
|
|
|
|
- // Update geometry given font metrics.
|
|
|
|
- self.updateGeometry(geometry, font);
|
|
|
|
-
|
|
|
|
- // Set font and update layout.
|
|
|
|
self.currentFont = font;
|
|
self.currentFont = font;
|
|
- self.updateLayout();
|
|
|
|
-
|
|
|
|
// Look up font image URL to use, and perform cached load.
|
|
// Look up font image URL to use, and perform cached load.
|
|
fontImgSrc = self.getFontImageSrc();
|
|
fontImgSrc = self.getFontImageSrc();
|
|
cache.get(fontImgSrc, function () {
|
|
cache.get(fontImgSrc, function () {
|
|
@@ -63445,6 +63432,11 @@ module.exports.Component = registerComponent('text', {
|
|
texture.needsUpdate = true;
|
|
texture.needsUpdate = true;
|
|
textures[data.font] = texture;
|
|
textures[data.font] = texture;
|
|
self.texture = texture;
|
|
self.texture = texture;
|
|
|
|
+ self.initMesh();
|
|
|
|
+ self.currentFont = font;
|
|
|
|
+ // Update geometry given font metrics.
|
|
|
|
+ self.updateGeometry(geometry, font);
|
|
|
|
+ self.updateLayout();
|
|
self.mesh.visible = true;
|
|
self.mesh.visible = true;
|
|
el.emit('textfontset', {font: data.font, fontObj: font});
|
|
el.emit('textfontset', {font: data.font, fontObj: font});
|
|
}).catch(function (err) {
|
|
}).catch(function (err) {
|
|
@@ -63457,6 +63449,12 @@ module.exports.Component = registerComponent('text', {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ initMesh: function () {
|
|
|
|
+ if (this.mesh) { return; }
|
|
|
|
+ this.mesh = new THREE.Mesh(this.geometry, this.material);
|
|
|
|
+ this.el.setObject3D(this.attrName, this.mesh);
|
|
|
|
+ },
|
|
|
|
+
|
|
getFontImageSrc: function () {
|
|
getFontImageSrc: function () {
|
|
if (this.data.fontImage) { return this.data.fontImage; }
|
|
if (this.data.fontImage) { return this.data.fontImage; }
|
|
var fontSrc = this.lookupFont(this.data.font || DEFAULT_FONT) || this.data.font;
|
|
var fontSrc = this.lookupFont(this.data.font || DEFAULT_FONT) || this.data.font;
|
|
@@ -63488,7 +63486,7 @@ module.exports.Component = registerComponent('text', {
|
|
var x;
|
|
var x;
|
|
var y;
|
|
var y;
|
|
|
|
|
|
- if (!geometry.layout) { return; }
|
|
|
|
|
|
+ if (!mesh || !geometry.layout) { return; }
|
|
|
|
|
|
// Determine width to use (defined width, geometry's width, or default width).
|
|
// Determine width to use (defined width, geometry's width, or default width).
|
|
geometryComponent = el.getAttribute('geometry');
|
|
geometryComponent = el.getAttribute('geometry');
|
|
@@ -71411,7 +71409,7 @@ _dereq_('./core/a-mixin');
|
|
_dereq_('./extras/components/');
|
|
_dereq_('./extras/components/');
|
|
_dereq_('./extras/primitives/');
|
|
_dereq_('./extras/primitives/');
|
|
|
|
|
|
-console.log('A-Frame Version: 1.1.0 (Date 2020-12-09, Commit #41079d2a)');
|
|
|
|
|
|
+console.log('A-Frame Version: 1.1.0 (Date 2020-12-30, Commit #579473b8)');
|
|
console.log('THREE Version (https://github.com/supermedium/three.js):',
|
|
console.log('THREE Version (https://github.com/supermedium/three.js):',
|
|
pkg.dependencies['super-three']);
|
|
pkg.dependencies['super-three']);
|
|
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
|
|
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
|