diff --git a/build/xeogl.js b/build/xeogl.js index 3c588eac6..7ca711bbe 100644 --- a/build/xeogl.js +++ b/build/xeogl.js @@ -4,7 +4,7 @@ * A WebGL-based 3D visualization engine from xeoLabs * http://xeogl.org/ * - * Built on 2017-06-06 + * Built on 2017-07-05 * * MIT License * Copyright 2017, Lindsay Kay @@ -5431,6 +5431,14 @@ var Canvas2Image = (function () { */ this.viewport = null; + /** + Outline state. + @property outline + @type {renderer.Outline} + */ + this.outline = null; + + //----------------- Renderer dirty flags ------------------------------- /** @@ -5511,6 +5519,7 @@ var Canvas2Image = (function () { object.stationary = this.stationary; object.viewport = this.viewport; object.lights = this.lights; + object.outline = this.outline; // Build hash of the object's state configuration. This is used // to hash the object's shader so that it may be reused by other @@ -5582,8 +5591,9 @@ var Canvas2Image = (function () { this._setChunk(object, 10, this.material.type, this.material); // Supports different material systems this._setChunk(object, 11, "clips", this.clips); this._setChunk(object, 12, "viewport", this.viewport); - this._setChunk(object, 13, "geometry", this.geometry); - this._setChunk(object, 14, "draw", this.geometry, true); // Must be last + this._setChunk(object, 13, "outline", this.outline); + this._setChunk(object, 14, "geometry", this.geometry); + this._setChunk(object, 15, "draw", this.geometry, true); // Must be last // Ambient light is global across everything in display, and // can never be disabled, so grab it now because we want to @@ -5780,8 +5790,8 @@ var Canvas2Image = (function () { object.sortKey = -1; } else { object.sortKey = - ((object.stage.priority + 1) * 10000000000000000) - + ((object.modes.transparent ? 2 : 1) * 100000000000000) + ((object.stage.priority + 1) * 100000000000000) + // + ((object.modes.transparent ? 2 : 1) * 100000000000000) + ((object.layer.priority + 1) * 10000000000000) + ((object.program.id + 1) * 100000000) + ((object.material.id + 1) * 10000) @@ -5844,9 +5854,9 @@ var Canvas2Image = (function () { if (shadowObjectLists.hasOwnProperty(lightId)) { shadowObjectList = shadowObjectLists[lightId]; light = shadowObjectList.light; - // if (light.shadowDirty) { - this._renderShadowMap(light, shadowObjectList.objects); - // } + // if (light.shadowDirty) { + this._renderShadowMap(light, shadowObjectList.objects); + // } } } }; @@ -5929,125 +5939,258 @@ var Canvas2Image = (function () { renderBuf.unbind(); }; - xeogl.renderer.Renderer.prototype._renderObjectList = function (params) { + xeogl.renderer.Renderer.prototype._renderObjectList = (function () { - var gl = this.gl; + var outlinedObjects = []; + var lastChunkId = new Int32Array(30); - var ambient = this._ambient; - var ambientColor; - if (ambient) { - var color = ambient.color; - var intensity = ambient.intensity; - this.ambientColor[0] = color[0] * intensity; - this.ambientColor[1] = color[1] * intensity; - this.ambientColor[2] = color[2] * intensity; - } else { - this.ambientColor[0] = 0; - this.ambientColor[1] = 0; - this.ambientColor[2] = 0; + var transparentObjects = []; + var numTransparentObjects = 0; + + function clearStateTracking() { + for (var i = 0; i < 20; i++) { + lastChunkId[i] = -9999999999; + } } - var frameCtx = this._frameCtx; + function drawObject(frameCtx, object) { + var chunks = object.chunks; + var chunk; + for (var i = 0, len = chunks.length; i < len; i++) { + chunk = chunks[i]; + if (chunk) { + if (chunk.draw && (chunk.unique || lastChunkId[i] !== chunk.id)) { + chunk.draw(frameCtx); + lastChunkId[i] = chunk.id; + } + } + } + } - frameCtx.renderTarget = null; - frameCtx.renderBuf = null; - frameCtx.depthbufEnabled = null; - frameCtx.clearDepth = null; - frameCtx.depthFunc = gl.LESS; - frameCtx.blendEnabled = false; - frameCtx.backfaces = true; - frameCtx.frontface = true; // true == "ccw" else "cw" - frameCtx.textureUnit = 0; - frameCtx.transparent = false; // True while rendering transparency bin - frameCtx.ambientColor = this.ambientColor; - frameCtx.drawElements = 0; - frameCtx.useProgram = 0; - frameCtx.bindTexture = 0; - frameCtx.bindArray = 0; - frameCtx.pass = params.pass; - frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer; - frameCtx.pickViewMatrix = params.pickViewMatrix; - frameCtx.pickProjMatrix = params.pickProjMatrix; - frameCtx.pickIndex = 0; + function drawObjectOutline(frameCtx, object) { + var chunks = object.chunks; + var chunk; + for (var i = 0, len = chunks.length; i < len; i++) { + chunk = chunks[i]; + if (chunk) { + if (chunk.outline && (chunk.unique || lastChunkId[i] !== chunk.id)) { + chunk.outline(frameCtx); + lastChunkId[i] = chunk.id; + } + } + } + } - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + return function (params) { - if (this.transparent) { // Canvas is transparent - gl.clearColor(0, 0, 0, 0); - } else { - gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0); - } + var gl = this.gl; - gl.enable(gl.DEPTH_TEST); - gl.frontFace(gl.CCW); - gl.disable(gl.CULL_FACE); - gl.disable(gl.BLEND); + var ambient = this._ambient; + if (ambient) { + var color = ambient.color; + var intensity = ambient.intensity; + this.ambientColor[0] = color[0] * intensity; + this.ambientColor[1] = color[1] * intensity; + this.ambientColor[2] = color[2] * intensity; + } else { + this.ambientColor[0] = 0; + this.ambientColor[1] = 0; + this.ambientColor[2] = 0; + } - var i; - var len; - var object; - var j; - var lenj; - var chunks; - var chunk; + var frameCtx = this._frameCtx; - var lastChunkId = this._lastChunkId = this._lastChunkId || new Int32Array(30); - for (i = 0; i < 20; i++) { - lastChunkId[i] = -9999999999999; - } + frameCtx.renderTarget = null; + frameCtx.renderBuf = null; + frameCtx.depthbufEnabled = null; + frameCtx.clearDepth = null; + frameCtx.depthFunc = gl.LESS; + frameCtx.blendEnabled = false; + frameCtx.backfaces = true; + frameCtx.frontface = true; // true == "ccw" else "cw" + frameCtx.textureUnit = 0; + frameCtx.transparent = false; // True while rendering transparency bin + frameCtx.ambientColor = this.ambientColor; + frameCtx.drawElements = 0; + frameCtx.useProgram = 0; + frameCtx.bindTexture = 0; + frameCtx.bindArray = 0; + frameCtx.pass = params.pass; + frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer; + frameCtx.pickViewMatrix = params.pickViewMatrix; + frameCtx.pickProjMatrix = params.pickProjMatrix; + frameCtx.pickIndex = 0; - var startTime = (new Date()).getTime(); + gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - if (this.bindOutputFramebuffer) { - this.bindOutputFramebuffer(params.pass); - } + if (this.transparent) { // Canvas is transparent + gl.clearColor(0, 0, 0, 0); + } else { + gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0); + } - if (params.clear) { - gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); - } + gl.enable(gl.DEPTH_TEST); + gl.frontFace(gl.CCW); + gl.enable(gl.CULL_FACE); + gl.depthMask(true); - for (i = 0, len = this._objectListLen; i < len; i++) { - object = this._objectList[i]; - if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) { - continue; + var i; + var len; + var object; + + var startTime = (new Date()).getTime(); + + if (this.bindOutputFramebuffer) { + this.bindOutputFramebuffer(params.pass); } - chunks = object.chunks; - for (j = 0, lenj = chunks.length; j < lenj; j++) { - chunk = chunks[j]; - if (chunk) { - if (chunk.draw && (chunk.unique || lastChunkId[j] !== chunk.id)) { - chunk.draw(frameCtx); - lastChunkId[j] = chunk.id; - } + + if (params.clear) { + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + } + + // Render opaque, non-outlined objects + + var numOutlinedObjects = 0; + + numTransparentObjects = 0; + + clearStateTracking(); + + for (i = 0, len = this._objectListLen; i < len; i++) { + object = this._objectList[i]; + if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) { + continue; } + if (object.modes.transparent) { + transparentObjects[numTransparentObjects++] = object; + continue; + } + if (object.modes.outline) { + outlinedObjects[numOutlinedObjects++] = object; + continue; + } + drawObject(frameCtx, object); } - } - var endTime = Date.now(); - var frameStats = this.stats.frame; + // Render opaque outlined objects - frameStats.renderTime = (endTime - startTime) / 1000.0; - frameStats.drawElements = frameCtx.drawElements; - frameStats.useProgram = frameCtx.useProgram; - frameStats.bindTexture = frameCtx.bindTexture; - frameStats.bindArray = frameCtx.bindArray; + if (numOutlinedObjects > 0) { - if (frameCtx.renderBuf) { - frameCtx.renderBuf.unbind(); - } + // Render objects - var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); + gl.enable(gl.STENCIL_TEST); + gl.stencilFunc(gl.ALWAYS, 1, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + gl.stencilMask(1); + gl.clearStencil(0); + gl.clear(gl.STENCIL_BUFFER_BIT); - for (var ii = 0; ii < numTextureUnits; ii++) { - gl.activeTexture(gl.TEXTURE0 + ii); - gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); - gl.bindTexture(gl.TEXTURE_2D, null); - } + clearStateTracking(); - if (this.unbindOutputFramebuffer) { - this.unbindOutputFramebuffer(params.pass); - } - }; + for (i = 0; i < numOutlinedObjects; i++) { + drawObject(frameCtx, outlinedObjects[i]); + } + + // Render outlines + + gl.stencilFunc(gl.EQUAL, 0, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + gl.stencilMask(0x00); + gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals + + clearStateTracking(); + + for (i = 0; i < numOutlinedObjects; i++) { + drawObjectOutline(frameCtx, outlinedObjects[i]); + } + + gl.disable(gl.STENCIL_TEST); + } + + // Draw transparent objects + + if (numTransparentObjects > 0) { + + gl.enable(gl.CULL_FACE); + gl.enable(gl.BLEND); + // gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + + numOutlinedObjects = 0; + + clearStateTracking(); + + for (i = 0; i < numTransparentObjects; i++) { + object = transparentObjects[i]; + if (object.modes.outline) { + outlinedObjects[numOutlinedObjects++] = object; // Build outlined list + continue; + } + drawObject(frameCtx, object); + } + + // Transparent outlined objects are not supported yet + + //if (numOutlinedObjects > 0) { + // + // gl.disable(gl.CULL_FACE); + // gl.enable(gl.STENCIL_TEST); + // gl.stencilFunc(gl.ALWAYS, 1, 1); + // gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + // gl.stencilMask(1); + // gl.clearStencil(0); + // gl.clear(gl.STENCIL_BUFFER_BIT); + // // gl.enable(gl.DEPTH_TEST); + // + // clearStateTracking(); + // + // for (i = 0, len = numOutlinedObjects; i < len; i++) { + // drawObject(frameCtx, outlinedObjects[i]); + // } + // + // gl.stencilFunc(gl.EQUAL, 0, 1); + // gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + // gl.stencilMask(0x00); + // gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals + // + // clearStateTracking(); + // + // for (i = 0, len = numOutlinedObjects; i < len; i++) { + // drawObjectOutline(frameCtx, outlinedObjects[i]); + // } + // + // gl.disable(gl.STENCIL_TEST); + //} + + gl.disable(gl.BLEND); + } + + var endTime = Date.now(); + var frameStats = this.stats.frame; + + frameStats.renderTime = (endTime - startTime) / 1000.0; + frameStats.drawElements = frameCtx.drawElements; + frameStats.useProgram = frameCtx.useProgram; + frameStats.bindTexture = frameCtx.bindTexture; + frameStats.bindArray = frameCtx.bindArray; + + if (frameCtx.renderBuf) { + frameCtx.renderBuf.unbind(); + } + + var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); + + for (var ii = 0; ii < numTextureUnits; ii++) { + gl.activeTexture(gl.TEXTURE0 + ii); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); + gl.bindTexture(gl.TEXTURE_2D, null); + } + + if (this.unbindOutputFramebuffer) { + this.unbindOutputFramebuffer(params.pass); + } + }; + })(); /** * Attempts to pick an object. @@ -8136,6 +8279,23 @@ var Canvas2Image = (function () { xeogl.renderer.Viewport = xeogl.renderer.State.extend({ _ids: new xeogl.utils.Map({}) }); + + /** + + Outline state. + + renderer.Outline + @module xeogl + + @constructor + @param cfg {*} Configs + @param [cfg.thickness=15] {Number} Thickness of the outline in pixels. + @param [cfg.color=[1,0,0]] {Array of Number} The outline color, + @extends renderer.State + */ + xeogl.renderer.Outline = xeogl.renderer.State.extend({ + _ids: new xeogl.utils.Map({}) + }); })(); ;(function () { @@ -8287,6 +8447,12 @@ var Canvas2Image = (function () { */ this.pickPrimitive = null; + /** + * The outline program + * @type webgl.Program + */ + this.outline = null; + /** * The count of display objects using this program * @type Number @@ -8345,6 +8511,7 @@ var Canvas2Image = (function () { this.shadow = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexShadow, this.source.fragmentShadow); this.pickObject = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexPickObject, this.source.fragmentPickObject); this.pickPrimitive = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexPickPrimitive, this.source.fragmentPickPrimitive); + this.outline = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexOutline, this.source.fragmentOutline); if (!this.draw.allocated) { this.errorLog = ["Draw program failed to allocate"].concat(this.draw.errorLog); @@ -8366,6 +8533,11 @@ var Canvas2Image = (function () { return; } + if (!this.outline.allocated) { + this.errorLog = ["Outline effect program failed to allocate"].concat(this.outline.errorLog); + return; + } + this.allocated = true; if (!this.draw.compiled) { @@ -8388,6 +8560,11 @@ var Canvas2Image = (function () { return; } + if (!this.outline.compiled) { + this.errorLog = ["Outline effect program failed to compile"].concat(this.outline.errorLog); + return; + } + this.compiled = true; if (!this.draw.linked) { @@ -8410,6 +8587,11 @@ var Canvas2Image = (function () { return; } + if (!this.outline.linked) { + this.errorLog = ["Outline effect program failed to link"].concat(this.outline.errorLog); + return; + } + this.linked = true; if (!this.draw.validated) { @@ -8432,9 +8614,35 @@ var Canvas2Image = (function () { return; } + if (!this.outline.validated) { + this.errorLog = ["Outline effect program failed to validate"].concat(this.outline.errorLog); + return; + } + this.validated = true; }; + /** + * Destroys this program. + */ + xeogl.renderer.Program.prototype.destroy = function() { + if (this.draw) { + this.draw.destroy(); + } + if (this.shadow) { + this.shadow.destroy(); + } + if (this.pickObject) { + this.pickObject.destroy(); + } + if (this.pickPrimitive) { + this.pickPrimitive.destroy(); + } + if (this.outline) { + this.outline.destroy(); + } + }; + })(); ;(function () { @@ -8497,15 +8705,12 @@ var Canvas2Image = (function () { var program = programState.program; - program.draw.destroy(); - program.shadow.destroy(); - program.pickObject.destroy(); - program.pickPrimitive.destroy(); - xeogl.renderer.ProgramSourceFactory.putSource(program.hash); delete this._programStates[program.hash]; + program.destroy(); + this.stats.memory.programs--; } }; @@ -8545,12 +8750,15 @@ var Canvas2Image = (function () { * @param {String} fragmentDraw Fragment shader source for drawing. * @param {String} vertexShadow Vertex shader source for drawing the shadow buffer. * @param {String} fragmentShadow Fragment shader source for drawing the shadow buffer. + * @param {String} vertexOutline Vertex shader source for drawing outlines. + * @param {String} fragmentOutline Fragment shader source for drawing outlines. */ xeogl.renderer.ProgramSource = function (hash, vertexPickObject, fragmentPickObject, vertexPickPrimitive, fragmentPickPrimitive, vertexDraw, fragmentDraw, - vertexShadow, fragmentShadow) { + vertexShadow, fragmentShadow, + vertexOutline, fragmentOutline) { /** * Hash code identifying the capabilities of the {@link xeogl.renderer.Program} that is compiled from this source @@ -8606,6 +8814,18 @@ var Canvas2Image = (function () { */ this.fragmentShadow = fragmentShadow; + /** + * Vertex shader source for rendering outlines. + * @type {Array of String} + */ + this.vertexOutline = vertexOutline; + + /** + * Fragment shader source for rendering outlines. + * @type {Array of String} + */ + this.fragmentOutline = fragmentOutline; + /** * Count of {@link xeogl.renderer.Program}s compiled from this program source code * @type Number @@ -8649,6 +8869,8 @@ var Canvas2Image = (function () { var fragmentPickPrimSrc; var vertexShadowSrc; var fragmentShadowSrc; + var vertexOutlineSrc; + var fragmentOutlineSrc; /** * Get source code for a program to render the given states. @@ -8688,7 +8910,9 @@ var Canvas2Image = (function () { vertexDraw(), fragmentDraw(), vertexShadow(), - fragmentShadow() + fragmentShadow(), + vertexOutline(), + fragmentOutline() ); cache[hash] = source; @@ -8874,6 +9098,75 @@ var Canvas2Image = (function () { return fragmentShadowSrc = end(); } + function vertexOutline() { + begin(); + add("attribute vec4 position;"); + add("uniform mat4 modelMatrix;"); + add("uniform mat4 viewMatrix;"); + add("uniform mat4 projMatrix;"); + add("uniform float thickness;"); + + if (normals) { + add("attribute vec3 normal;"); + } + + if (states.billboard.active) { + add("void billboard(inout mat4 mat) {"); + add(" mat[0][0] = 1.0;"); + add(" mat[0][1] = 0.0;"); + add(" mat[0][2] = 0.0;"); + if (states.billboard.spherical) { + add(" mat[1][0] = 0.0;"); + add(" mat[1][1] = 1.0;"); + add(" mat[1][2] = 0.0;"); + } + add(" mat[2][0] = 0.0;"); + add(" mat[2][1] = 0.0;"); + add(" mat[2][2] =1.0;"); + add("}"); + } + + add("void main(void) {"); + + add("mat4 viewMatrix2 = viewMatrix;"); + add("mat4 modelMatrix2 = modelMatrix;"); + + if (states.stationary.active) { + add("viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;") + } + + if (states.billboard.active) { + add("billboard(modelMatrix2);"); + add("billboard(viewMatrix2);"); + } + + // Displacement + + if (normals) { + add("vec4 projPos = projMatrix * viewMatrix2 * modelMatrix2 * vec4(position.xyz, 1.0); "); + add(" vec3 offset = (normalize(normal) * (thickness * 0.0005 * (projPos.z/1.0)));"); + } else { + add(" vec3 offset = vec3(0.0, 0.0, 0.0);"); + } + + add("vec4 worldVertex = modelMatrix * vec4(position.xyz + offset, 1.0); "); + + add(" gl_Position = projMatrix * (viewMatrix * worldVertex);"); + add("}"); + return vertexOutlineSrc = end(); + } + + function fragmentOutline() { + begin(); + add("precision " + getFSFloatPrecision(states.gl) + " float;"); + add("uniform vec3 color;"); + add("void main(void) {"); + add(" gl_FragColor = vec4(color, 1.0);"); + add("}"); + + return fragmentOutlineSrc = end(); + } + function vertexDraw() { var vertex = states.shader.vertex; @@ -9640,7 +9933,8 @@ var Canvas2Image = (function () { } if (light.type === "dir" && light.space === "view") { add("uniform vec3 lightDir" + i + ";"); - } if (light.type === "point" && light.space === "view") { + } + if (light.type === "point" && light.space === "view") { add("uniform vec3 lightPos" + i + ";"); } else { add("varying vec4 vViewLightReverseDirAndDist" + i + ";"); @@ -10352,6 +10646,10 @@ var Canvas2Image = (function () { } } } + }, + + outline: function(frameCtx) { + this.drawPick(frameCtx); } }); @@ -10527,6 +10825,10 @@ var Canvas2Image = (function () { if (pickPositions) { gl.drawArrays(state.primitive, 0, pickPositions.numItems / 3); } + }, + + outline: function(frameCtx) { + this.draw(frameCtx); } }); @@ -10559,6 +10861,10 @@ var Canvas2Image = (function () { var pickPrimitive = this.program.pickPrimitive; this._aPositionPickPrimitive = pickPrimitive.getAttribute("position"); this._aColorPickPrimitive = pickPrimitive.getAttribute("color"); + + var outline = this.program.outline; + this._aPositionOutline = outline.getAttribute("position"); + this._aNormalOutline = outline.getAttribute("normal"); }, draw: function (frameCtx) { @@ -10642,6 +10948,26 @@ var Canvas2Image = (function () { if (this._aColorPickPrimitive) { this._aColorPickPrimitive.bindFloatArrayBuffer(state.getPickColors()); } + }, + + outline: function (frameCtx) { + + var state = this.state; + + if (this._aPositionOutline) { + this._aPositionOutline.bindFloatArrayBuffer(state.positions); + frameCtx.bindArray++; + } + + if (this._aNormalOutline) { + this._aNormalOutline.bindFloatArrayBuffer(state.normals); + frameCtx.bindArray++; + } + + if (state.indices) { + state.indices.bind(); + frameCtx.bindArray++; + } } }); @@ -10825,6 +11151,7 @@ var Canvas2Image = (function () { this._uModelMatrixShadow = this.program.shadow.getUniform("modelMatrix"); this._uModelMatrixPickObject = this.program.pickObject.getUniform("modelMatrix"); this._uModelMatrixPickPrimitive = this.program.pickPrimitive.getUniform("modelMatrix"); + this._uModelMatrixOutline = this.program.outline.getUniform("modelMatrix"); }, draw: function () { @@ -10852,6 +11179,12 @@ var Canvas2Image = (function () { if (this._uModelMatrixPickPrimitive) { this._uModelMatrixPickPrimitive.setValue(this.state.getMatrix()); } + }, + + outline: function () { + if (this._uModelMatrixOutline) { + this._uModelMatrixOutline.setValue(this.state.getMatrix()); + } } }); @@ -10896,29 +11229,6 @@ var Canvas2Image = (function () { } frameCtx.frontface = frontface; } - - var transparent = state.transparent; - - if (frameCtx.transparent !== transparent) { - if (!frameCtx.pick) { - if (transparent) { - - // Entering a transparency bin - - gl.enable(gl.BLEND); - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - frameCtx.blendEnabled = true; - } else { - - // Leaving a transparency bin - - gl.disable(gl.BLEND); - frameCtx.blendEnabled = false; - } - } - frameCtx.transparent = transparent; - } }, shadow: function (frameCtx) { @@ -11016,6 +11326,37 @@ var Canvas2Image = (function () { "use strict"; + xeogl.renderer.ChunkFactory.createChunkType({ + + type: "outline", + + build: function () { + + var outline = this.program.outline; + + this._uColor = outline.getUniform("color"); + this._uThickness = outline.getUniform("thickness"); + }, + + outline: function (frameCtx) { + + var state = this.state; + + if (this._uColor) { + this._uColor.setValue(state.color); + } + + if (this._uThickness) { + this._uThickness.setValue(state.thickness); + } + } + }); + +})(); +;(function () { + + "use strict"; + xeogl.renderer.ChunkFactory.createChunkType({ type: "phongMaterial", @@ -11748,6 +12089,10 @@ var Canvas2Image = (function () { pickPrimitive: function () { this.program.pickPrimitive.bind(); + }, + + outline: function () { + this.program.outline.bind(); } }); })(); @@ -11767,6 +12112,7 @@ var Canvas2Image = (function () { this._uProjMatrixShadow = this.program.shadow.getUniform("shadowProjMatrix"); this._uProjMatrixPickObject = this.program.pickObject.getUniform("projMatrix"); this._uProjMatrixPickPrimitive = this.program.pickPrimitive.getUniform("projMatrix"); + this._uProjMatrixOutline = this.program.outline.getUniform("projMatrix"); }, draw: function () { @@ -11791,6 +12137,12 @@ var Canvas2Image = (function () { if (this._uProjMatrixPickPrimitive) { this._uProjMatrixPickPrimitive.setValue(frameCtx.pickProjMatrix || this.state.getMatrix()); } + }, + + outline: function (frameCtx) { + if (this._uProjMatrixOutline) { + this._uProjMatrixOutline.setValue(this.state.getMatrix()); + } } }); @@ -11919,6 +12271,7 @@ var Canvas2Image = (function () { this._uViewMatrixShadow = this.program.pickObject.getUniform("shadowViewMatrix"); this._uViewMatrixPickObject = this.program.pickObject.getUniform("viewMatrix"); this._uViewMatrixPickPrimitive = this.program.pickPrimitive.getUniform("viewMatrix"); + this._uViewMatrixOutline = this.program.outline.getUniform("viewMatrix"); }, draw: function () { @@ -11949,6 +12302,12 @@ var Canvas2Image = (function () { if (this._uViewMatrixPickPrimitive) { this._uViewMatrixPickPrimitive.setValue(frameCtx.pickViewMatrix || this.state.getMatrix()); } + }, + + outline: function () { + if (this._uViewMatrixOutline) { + this._uViewMatrixOutline.setValue(this.state.getMatrix()); + } } }); @@ -11973,18 +12332,19 @@ var Canvas2Image = (function () { }, shadow: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); }, pickObject: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); }, pickPrimitive: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); + }, + + outline: function() { + this.draw(); } }); @@ -13620,6 +13980,7 @@ var Canvas2Image = (function () { dummy = this.stage; dummy = this.transform; dummy = this.viewport; + dummy = this.outline; }, // Called by each component that is created with this Scene as parent. @@ -14546,6 +14907,32 @@ var Canvas2Image = (function () { } }, + /** + * The default {{#crossLink "Outline"}}{{/crossLink}} provided by this Scene. + * + * This {{#crossLink "Outline"}}{{/crossLink}} has + * an {{#crossLink "Component/id:property"}}id{{/crossLink}} equal to "default.outline", + * a {{#crossLink "Outline/color:property"}}color{{/crossLink}} set to ````[1,1,0]```` + * a {{#crossLink "Outline/thickness:property"}}thickness{{/crossLink}} set to ````15````. + * + * {{#crossLink "Entity"}}Entities{{/crossLink}} within this Scene are attached to this + * {{#crossLink "Outline"}}{{/crossLink}} by default. + * + * @property outline + * @final + * @type Outline + */ + outline: { + get: function () { + return this.components["default.outline"] || + new xeogl.Outline(this, { + id: "default.outline", + thickness: 15, + color: [1,1,0] + }); + } + }, + /** * The World-space 3D boundary of this Scene. * @@ -16652,13 +17039,15 @@ var Canvas2Image = (function () { this.contextAttr.alpha = this.transparent; if (this.contextAttr.alpha === undefined || this.contextAttr.alpha === null) { - this.contextAttr.alphs = this.transparent; + this.contextAttr.alpha = this.transparent; } if (this.contextAttr.preserveDrawingBuffer === undefined || this.contextAttr.preserveDrawingBuffer === null) { this.contextAttr.preserveDrawingBuffer = false; } + this.contextAttr.stencil = true; + if (!cfg.canvas) { // Canvas not supplied, create one automatically @@ -18379,6 +18768,8 @@ var Canvas2Image = (function () { var aabb = worldBoundary.aabb; var sphere = worldBoundary.sphere; + e.entity.modes.outline = true; + this._boundaryHelper.geometry.aabb = aabb; // this._boundaryHelper.visibility.visible = true; @@ -32932,6 +33323,187 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { }); })();;/** + * An outline rendering effect for emphasis. + * + * @module xeogl + * @submodule outline + */;/** + A **Outline** renders an outline around attached {{#crossLink "Entity"}}Entities{{/crossLink}}. + + ## Overview + + TODO + + ## Usage + + ````javascript + + var outline = new xeogl.Outline({ + thickness: 15, // Default + color: [1,0,0] // Default + }); + + new xeogl.Entity({ + geometry: new xeogl.TorusGeometry(), + outline: outline, + modes: new xeogl.Modes({ + outline: false // Hide the outline (default) + }); + }); + + new xeogl.Entity({ + geometry: new xeogl.BoxGeometry(), + outline: outline, + modes: new xeogl.Modes({ + outline: true // Show the outline + }); + }); + ```` + + @class Outline + @module xeogl + @submodule outline + @constructor + @param [scene] {Scene} Parent {{#crossLink "Scene"}}Scene{{/crossLink}}, creates this Outline within the + default {{#crossLink "Scene"}}Scene{{/crossLink}} when omitted. + @param [cfg] {*} Outline configuration + @param [cfg.id] {String} Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}}, generated automatically when omitted. + @param [cfg.meta] {String:Object} Optional map of user-defined metadata to attach to this Outline. + @param [cfg.thickness=15] {Number} Thickness of the outline in pixels. + @param [cfg.color=[1,1,0]] {Float32Array} The RGB outline color. + @extends Component + */ +(function () { + + "use strict"; + + xeogl.Outline = xeogl.Component.extend({ + + type: "xeogl.Outline", + + _init: function (cfg) { + + this._state = new xeogl.renderer.Outline({ + thickness: 15, + color: xeogl.math.vec3([1.0, 1.0, 0.0]) + }); + + this.thickness = cfg.thickness; + this.color = cfg.color; + }, + + _props: { + + /** + * The Outline's thickness in pixels. + * + * Fires a {{#crossLink "Outline/thickness:event"}}{{/crossLink}} event on change. + * + * @property thickness + * @default 15 + * @type Number + */ + thickness: { + + set: function (value) { + + // TODO: Only accept rendering thickness in range [0...MAX_thickness] + + value = value || 15; + + value = Math.round(value); + + + if (value === this._state.thickness) { + return; + } + + this._state.thickness = value; + + this._renderer.imageDirty = true; + + /** + * Fired whenever this Outline's {{#crossLink "Outline/thickness:property"}}{{/crossLink}} property changes. + * + * @event thickness + * @param value The property's new value + */ + this.fire("thickness", this._state.thickness); + }, + + get: function () { + return this._state.thickness; + } + }, + + /** + The Outline's RGB color. + + Fires a {{#crossLink "Outline/color:event"}}{{/crossLink}} event on change. + + @property color + @default [1.0, 1.0, 0.0] + @type Float32Array + */ + color: { + + set: function (value) { + + var color = this._state.color; + + if (!color) { + color = this._state.color = new Float32Array(3); + + } else if (value && color[0] === value[0] && color[1] === value[1] && color[2] === value[2]) { + return; + } + + if (value) { + color[0] = value[0]; + color[1] = value[1]; + color[2] = value[2]; + + } else { + color[0] = 1; + color[1] = 1; + color[2] = 0; + } + + this._renderer.imageDirty = true; + + /** + * Fired whenever this Outline's {{#crossLink "Outline/color:property"}}{{/crossLink}} property changes. + * + * @event color + * @param value {Float32Array} The property's new value + */ + this.fire("color", this._state.color); + }, + + get: function () { + return this._state.color; + } + } + }, + + _compile: function () { + this._renderer.outline = this._state; + }, + + _getJSON: function () { + return { + thickness: this._state.thickness, + color: xeogl.math.vecToArray(this._state.color) + }; + }, + + _destroy: function () { + this._state.destroy(); + } + }); + +})(); +;/** * Components to define the surface appearance of Entities. * * @module xeogl @@ -37618,6 +38190,8 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { {{#crossLink "Scene/transform:property"}}transform{{/crossLink}} (which is an identity matrix which performs no transformation). @param [cfg.viewport] {String|Viewport} ID or instance of a {{#crossLink "Viewport"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink "Scene"}}Scene{{/crossLink}}'s default instance, {{#crossLink "Scene/viewport:property"}}{{/crossLink}}, which is automatically resizes to the canvas. + @param [cfg.outline] {String|Outline} ID or instance of a {{#crossLink "Outline"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink "Scene"}}Scene{{/crossLink}}'s default instance, + {{#crossLink "Scene/outline:property"}}{{/crossLink}}. @param [cfg.loading] {Boolean} Flag which indicates that this Entity is freshly loaded. This will increment the {{#crossLink "Spinner/processes:property"}}Spinner processes{{/crossLink}} count, and then when this Entity is first rendered, will decrement the count again. @@ -37669,6 +38243,7 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { this.billboard = cfg.billboard; this.stationary = cfg.stationary; this.viewport = cfg.viewport; + this.outline = cfg.outline; // Cached boundary for each coordinate space // The Entity's Geometry component caches the Local-space boundary @@ -38493,6 +39068,41 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { } }, + /** + * The {{#crossLink "Outline"}}Outline{{/crossLink}} attached to this Entity. + * + * Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent + * {{#crossLink "Scene"}}Scene{{/crossLink}}'s default {{#crossLink "Scene/outline:property"}}Outline{{/crossLink}} when set to + * a null or undefined value. + * + * Fires an {{#crossLink "Entity/outline:event"}}{{/crossLink}} event on change. + * + * @property outline + * @type Outline + */ + outline: { + + set: function (value) { + + /** + * Fired whenever this Entity's {{#crossLink "Entity/Outline:property"}}{{/crossLink}} property changes. + * + * @event Outline + * @param value The property's new value + */ + this._attach({ + name: "outline", + type: "xeogl.Outline", + component: value, + sceneDefault: true + }); + }, + + get: function () { + return this._attached.outline; + } + }, + /** * Local-space 3D boundary of this Entity. * @@ -38906,6 +39516,7 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { attached.billboard._compile(); attached.stationary._compile(); attached.viewport._compile(); + attached.outline._compile(); // (Re)build this Entity in the renderer; for each Entity in teh scene graph, // there is an "object" in the renderer, that has the same ID as the entity @@ -38958,7 +39569,8 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { transform: attached.transform.id, billboard: attached.billboard.id, stationary: attached.stationary.id, - viewport: attached.viewport.id + viewport: attached.viewport.id, + outline: attached.outline.id }; }, @@ -39927,7 +40539,8 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { clippable true, // Enable effect of xeogl.Clip components transparent : false, // Disable transparency backfaces : true, // Render backfaces - frontface : "ccw" + frontface : "ccw", // Front faces have counter-clockwise vertex winding + outline: false // Don't outline for emphasis }); var boxGeometry = new xeogl.BoxGeometry(); @@ -39972,6 +40585,7 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { {{#crossLink "Entity"}}Entities{{/crossLink}} are things like helpers or indicators that should not be included in boundary calculations. @param [cfg.castShadow=true] {Boolean} Whether attached {{#crossLink "Entity"}}Entities{{/crossLink}} cast shadows. @param [cfg.receiveShadow=true] {Boolean} Whether attached {{#crossLink "Entity"}}Entities{{/crossLink}} receive shadows. + @param [cfg.outline=false] {Boolean} Whether an outline is drawn around the attached {{#crossLink "Entity"}}Entities{{/crossLink}}. @extends Component */ (function () { @@ -39993,6 +40607,7 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { collidable: null, castShadow: null, receiveShadow: null, + outline: null, hash: "" }); @@ -40004,6 +40619,7 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { this.collidable = cfg.collidable; this.castShadow = cfg.castShadow; this.receiveShadow = cfg.receiveShadow; + this.outline = cfg.outline; }, _props: { @@ -40114,7 +40730,7 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { this._state.transparent = value; - this._renderer.stateOrderDirty = true; + this._renderer.imageDirty = true; /** Fired whenever this Modes' {{#crossLink "Modes/transparent:property"}}{{/crossLink}} property changes. @@ -40327,6 +40943,43 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { get: function () { return this._state.receiveShadow; } + }, + + /** + Whether an outline is drawn around attached {{#crossLink "Entity"}}Entities{{/crossLink}}. + + Fires a {{#crossLink "Modes/outline:event"}}{{/crossLink}} event on change. + + @property outline + @default false + @type Boolean + */ + outline: { + + set: function (value) { + + value = !!value; + + if (value === this._state.outline) { + return; + } + + this._state.outline = value; + + this._renderer.imageDirty = true; + + /** + Fired whenever this Modes' {{#crossLink "Modes/outline:property"}}{{/crossLink}} property changes. + + @event outline + @param value The property's new value + */ + this.fire("outline", this._state.outline); + }, + + get: function () { + return this._state.outline; + } } }, @@ -40343,7 +40996,8 @@ xeogl.GLTFLoaderUtils = Object.create(Object, { frontface: this._state.frontface, collidable: this._state.collidable, castShadow: this._state.castShadow, - receiveShadow: this._state.receiveShadow + receiveShadow: this._state.receiveShadow, + outline: this._state.outline }; }, diff --git a/build/xeogl.min.js b/build/xeogl.min.js index f3eab42c8..842c64efd 100644 --- a/build/xeogl.min.js +++ b/build/xeogl.min.js @@ -4,7 +4,7 @@ * A WebGL-based 3D visualization engine from xeoLabs * http://xeogl.org/ * - * Built on 2017-06-06 + * Built on 2017-07-05 * * MIT License * Copyright 2017, Lindsay Kay @@ -13,13 +13,13 @@ */ !function(){"use strict";var a=function(){this.version=null,this.WEBGL_INFO=function(){var a={WEBGL:!1},b=document.createElement("canvas");if(!b)return a;var c=b.getContext("webgl",{antialias:!0})||b.getContext("experimental-webgl",{antialias:!0});return a.WEBGL=!!c,a.WEBGL?(a.ANTIALIAS=c.getContextAttributes().antialias,c.getShaderPrecisionFormat?c.getShaderPrecisionFormat(c.FRAGMENT_SHADER,c.HIGH_FLOAT).precision>0?a.FS_MAX_FLOAT_PRECISION="highp":c.getShaderPrecisionFormat(c.FRAGMENT_SHADER,c.MEDIUM_FLOAT).precision>0?a.FS_MAX_FLOAT_PRECISION="mediump":a.FS_MAX_FLOAT_PRECISION="lowp":a.FS_MAX_FLOAT_PRECISION="mediump",a.DEPTH_BUFFER_BITS=c.getParameter(c.DEPTH_BITS),a.MAX_TEXTURE_SIZE=c.getParameter(c.MAX_TEXTURE_SIZE),a.MAX_CUBE_MAP_SIZE=c.getParameter(c.MAX_CUBE_MAP_TEXTURE_SIZE),a.MAX_RENDERBUFFER_SIZE=c.getParameter(c.MAX_RENDERBUFFER_SIZE),a.MAX_TEXTURE_UNITS=c.getParameter(c.MAX_COMBINED_TEXTURE_IMAGE_UNITS),a.MAX_TEXTURE_IMAGE_UNITS=c.getParameter(c.MAX_TEXTURE_IMAGE_UNITS),a.MAX_VERTEX_ATTRIBS=c.getParameter(c.MAX_VERTEX_ATTRIBS),a.MAX_VERTEX_UNIFORM_VECTORS=c.getParameter(c.MAX_VERTEX_UNIFORM_VECTORS),a.MAX_FRAGMENT_UNIFORM_VECTORS=c.getParameter(c.MAX_FRAGMENT_UNIFORM_VECTORS),a.MAX_VARYING_VECTORS=c.getParameter(c.MAX_VARYING_VECTORS),a.SUPPORTED_EXTENSIONS={},c.getSupportedExtensions().forEach(function(b){a.SUPPORTED_EXTENSIONS[b]=!0}),a):a}(),this.stats={build:{version:a.version},client:{browser:navigator&&navigator.userAgent?navigator.userAgent:"n/a"},components:{scenes:0,entities:0},memory:{meshes:0,positions:0,colors:0,normals:0,tangents:0,uvs:0,indices:0,textures:0,programs:0},frame:{frameCount:0,fps:0,useProgram:0,bindTexture:0,bindArray:0,drawElements:0,tasksRun:0,tasksScheduled:0}},this._sceneIDMap=null,this._scene=null,this.scenes={},this._scenesRenderInfo={},this._superTypes={},this._taskQueue=[];var b=this;!function(){function a(){g=Date.now();var a=b._runScheduledTasks(g+k),c=b._taskQueue.length;b.stats.frame.tasksRun=a,b.stats.frame.tasksScheduled=c,b.stats.frame.tasksBudget=k,j.time=g;for(h in b.scenes)b.scenes.hasOwnProperty(h)&&(i=b.scenes[h],j.sceneId=h,j.startTime=i.startTime,j.deltaTime=null!=j.prevTime?j.time-j.prevTime:0,i.fire("tick",j,!0));j.prevTime=g}function c(){var a,c,d,e=b.scenes,f=b._scenesRenderInfo;for(h in e)e.hasOwnProperty(h)&&(a=e[h],c=f[h],d=a.ticksPerRender,c.ticksPerRender!==d&&(c.ticksPerRender=d,c.renderCountdown=d),0==--c.renderCountdown&&(a.render(!1),c.renderCountdown=d))}var d,e,f,g,h,i,j={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},k=10,l=0,m=[],n=30,o=0,p=function(){d=Date.now(),l>0&&(e=d-l,f=1e3/e,o+=f,m.push(f),m.length>=n&&(o-=m.shift()),b.stats.frame.fps=Math.round(o/m.length)),a(),c(),l=d,window.requestAnimationFrame(p)};window.requestAnimationFrame(p)}()};a.prototype={constructor:a,get scene(){return this._scene||(this._scene=new window.xeogl.Scene({id:"default.scene"}))},set scene(a){this._scene=a},_addScene:function(b){if(this._sceneIDMap=this._sceneIDMap||new window.xeogl.utils.Map,b.id){if(this.scenes[b.id])return void console.error("[ERROR] Scene "+a._inQuotes(b.id)+" already exists")}else b.id=this._sceneIDMap.addItem(b);this.scenes[b.id]=b;var c=b.ticksPerRender;this._scenesRenderInfo[b.id]={ticksPerRender:c,renderCountdown:c},this.stats.components.scenes++;var d=this;b.on("destroyed",function(){d._sceneIDMap.removeItem(b.id),delete d.scenes[b.id],delete d._scenesRenderInfo[b.id],d.stats.components.scenes--})},scheduleTask:function(a,b){this._taskQueue.push(a),this._taskQueue.push(b)},deferTask:function(a,b){b?a.call(b):a()},_runScheduledTasks:function(a){for(var b,c,d=(new Date).getTime(),e=this._taskQueue,f=0;e.length>0&&d=0;d--)if(c[d]===b)return!0;return!1},_copy:function(a){return this._apply(a,{})},_apply:function(a,b){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_apply2:function(a,b){for(var c in a)a.hasOwnProperty(c)&&void 0!==a[c]&&null!==a[c]&&(b[c]=a[c]);return b},_applyIf:function(a,b){for(var c in a)a.hasOwnProperty(c)&&(void 0!==b[c]&&null!==b[c]||(b[c]=a[c]));return b},_isEmptyObject:function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},_inQuotes:function(a){return this._isNumeric(a)?""+a:"'"+a+"'"},_concat:function(a,b){var c=new a.constructor(a.length+b.length);return c.set(a),c.set(b,a.length),c}},window.xeogl=window.xeogl=new a}();var Canvas2Image=function(){var a=document.createElement("canvas"),b=String.fromCharCode,c="image/octet-stream",d=!1;if(!a.getContext)return{saveAsBMP:function(){},saveAsPNG:function(){},saveAsJPEG:function(){}};var e=!!a.getContext("2d").getImageData,f=!!a.toDataURL,g=!!window.btoa,h=function(a){var b=parseInt(a.width),c=parseInt(a.height);return a.getContext("2d").getImageData(0,0,b,c)},i=function(a){var c,d,e="";if("string"==typeof a)e=a;else for(d=a,c=0;c>=4,c[e]=b[19===e?3&a|8:a]);return c.join("")}}()}(),function(){"use strict";xeogl.utils=xeogl.utils||{},xeogl.utils.Map=function(a,b){this.items=a||[],b=b||0;var c=b+1;this.addItem=function(){var a;if(2===arguments.length){var b=arguments[0];if(a=arguments[1],this.items[b])throw"ID clash: '"+b+"'";return this.items[b]=a,b}for(;;){a=arguments[0]||{};var d=c++;if(!this.items[d])return this.items[d]=a,d}},this.removeItem=function(a){var b=this.items[a];return delete this.items[a],b}}}(),function(){"use strict";var a=new Float32Array(16),b=new Float32Array(16),c=new Float32Array(4),d=xeogl.math={DEGTORAD:.0174532925,vec2:function(a){return new Float32Array(a||2)},vec3:function(a){return new Float32Array(a||3)},vec4:function(a){return new Float32Array(a||4)},mat3:function(a){return new Float32Array(a||9)},mat3ToMat4:function(a,b){},mat4:function(a){return new Float32Array(a||16)},mat4ToMat3:function(a,b){},createUUID:function(){var a,b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),c=new Array(36),d=0;return function(){for(var e=0;e<36;e++)8===e||13===e||18===e||23===e?c[e]="-":14===e?c[e]="4":(d<=2&&(d=33554432+16777216*Math.random()|0),a=15&d,d>>=4,c[e]=b[19===e?3&a|8:a]);return c.join("")}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},fmod:function(a,b){if(a0?(c=.5/Math.sqrt(n+1),b[3]=.25/c,b[0]=(l-j)*c,b[1]=(g-k)*c,b[2]=(h-f)*c):e>i&&e>m?(c=2*Math.sqrt(1+e-i-m),b[3]=(l-j)/c,b[0]=.25*c,b[1]=(f+h)/c,b[2]=(g+k)/c):i>m?(c=2*Math.sqrt(1+i-e-m),b[3]=(g-k)/c,b[0]=(f+h)/c,b[1]=.25*c,b[2]=(j+l)/c):(c=2*Math.sqrt(1+m-e-i),b[3]=(h-f)/c,b[0]=(g+k)/c,b[1]=(j+l)/c,b[2]=.25*c),b},vec3PairToQuaternion:function(a,b,c){c=c||d.vec4();var e=Math.sqrt(d.dotVec3(a,a)*d.dotVec3(b,b)),f=e+d.dotVec3(a,b);return f<1e-8*e?(f=0,Math.abs(a[0])>Math.abs(a[2])?(c[0]=-a[1],c[1]=a[0],c[2]=0):(c[0]=0,c[1]=-a[2],c[2]=a[1])):d.cross3Vec3(a,b,c),c[3]=f,d.normalizeQuaternion(c)},angleAxisToQuaternion:function(a,b){b=b||d.vec4();var c=a[3]/2,e=Math.sin(c);return b[0]=e*a[0],b[1]=e*a[1],b[2]=e*a[2],b[3]=Math.cos(c),b},quaternionToEuler:function(a,b,c){c=c||d.vec4();var e=a[3]/2,f=Math.sin(e);return c[0]=f*a[0],c[1]=f*a[1],c[2]=f*a[2],c[3]=Math.cos(e),c},mulQuaternions:function(a,b,c){c=c||d.vec4();var e=a[0],f=a[1],g=a[2],h=a[3],i=b[0],j=b[1],k=b[2],l=b[3];return c[0]=h*i+e*l+f*k-g*j,c[1]=h*j+f*l+g*i-e*k,c[2]=h*k+g*l+e*j-f*i,c[3]=h*l-e*i-f*j-g*k,c},vec3ApplyQuaternion:function(a,b,c){c=c||d.vec3();var e=b[0],f=b[1],g=b[2],h=a[0],i=a[1],j=a[2],k=a[3],l=k*e+i*g-j*f,m=k*f+j*e-h*g,n=k*g+h*f-i*e,o=-h*e-i*f-j*g;return c[0]=l*k+o*-h+m*-j-n*-i,c[1]=m*k+o*-i+n*-h-l*-j,c[2]=n*k+o*-j+l*-i-m*-h,c},quaternionToMat4:function(a,b){b=d.identityMat4(b);var c=a[0],e=a[1],f=a[2],g=a[3],h=2*c,i=2*e,j=2*f,k=h*g,l=i*g,m=j*g,n=h*c,o=i*c,p=j*c,q=i*e,r=j*e,s=j*f;return b[0]=1-(q+s),b[1]=o+m,b[2]=p-l,b[4]=o-m,b[5]=1-(n+s),b[6]=r+k,b[8]=p+l,b[9]=r-k,b[10]=1-(n+q),b},quaternionToRotationMat4:function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=c+c,h=d+d,i=e+e,j=c*g,k=c*h,l=c*i,m=d*h,n=d*i,o=e*i,p=f*g,q=f*h,r=f*i;return b[0]=1-(m+o),b[4]=k-r,b[8]=l+q,b[1]=k+r,b[5]=1-(j+o),b[9]=n-p,b[2]=l-q,b[6]=n+p,b[10]=1-(j+m),b[3]=0,b[7]=0,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b},normalizeQuaternion:function(a,b){b=b||a;var c=d.lenVec4([a[0],a[1],a[2],a[3]]);return b[0]=a[0]/c,b[1]=a[1]/c,b[2]=a[2]/c,b[3]=a[3]/c,b},conjugateQuaternion:function(a,b){return b=b||a,b[0]=-a[0],b[1]=-a[1],b[2]=-a[2],b[3]=a[3],b},inverseQuaternion:function(a,b){return d.normalizeQuaternion(d.conjugateQuaternion(a,b))},quaternionToAngleAxis:function(a,b){b=b||d.vec4(),a=d.normalizeQuaternion(a,c);var e=a[3],f=2*Math.acos(e),g=Math.sqrt(1-e*e);return g<.001?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):(b[0]=a[0]/g,b[0]=a[1]/g,b[0]=a[2]/g),b[3]=f,b}}}(),function(){"use strict";var a=xeogl.math;a.AABB3=function(a){return new Float32Array(a||6)},a.AABB2=function(a){return new Float32Array(a||4)},a.OBB3=function(a){return new Float32Array(a||32)},a.OBB2=function(a){return new Float32Array(a||16)},a.transformOBB3=function(a,b,c){c=c||b;var d,e,f,g,h=b.length,i=a[0],j=a[1],k=a[2],l=a[3],m=a[4],n=a[5],o=a[6],p=a[7],q=a[8],r=a[9],s=a[10],t=a[11],u=a[12],v=a[13],w=a[14],x=a[15];for(d=0;di?h:i,g[1]+=j>k?j:k,g[2]+=l>m?l:m,Math.abs(a.lenVec3(g))}}(),a.getAABB3Center=function(b,c){var d=c||a.vec3();return d[0]=.5*(b[3]+b[0]),d[1]=.5*(b[4]+b[1]),d[2]=.5*(b[5]+b[2]),d},a.getAABB2Center=function(b,c){var d=c||a.vec2();return d[0]=(b[2]+b[0])/2,d[1]=(b[3]+b[1])/2,d},a.collapseAABB3=function(b){return b=b||a.AABB3(),b[0]=1e7,b[1]=1e7,b[2]=1e7,b[3]=-1e7,b[4]=-1e7,b[5]=-1e7,b},a.AABB3ToOBB3=function(b,c){return c=c||a.OBB3(),c[0]=b[0],c[1]=b[1],c[2]=b[2],c[3]=1,c[4]=b[3],c[5]=b[1],c[6]=b[2],c[7]=1,c[8]=b[3],c[9]=b[4],c[10]=b[2],c[11]=1,c[12]=b[0],c[13]=b[4],c[14]=b[2],c[15]=1,c[16]=b[0],c[17]=b[1],c[18]=b[5],c[19]=1,c[20]=b[3],c[21]=b[1],c[22]=b[5],c[23]=1,c[24]=b[3],c[25]=b[4],c[26]=b[5],c[27]=1,c[28]=b[0],c[29]=b[4],c[30]=b[5],c[31]=1,c},a.positions3ToAABB3=function(b,c){c=c||a.AABB3();for(var d,e,f,g=1e5,h=1e5,i=1e5,j=-1e5,k=-1e5,l=-1e5,m=0,n=b.length;mj&&(j=d),e>k&&(k=e),f>l&&(l=f);return c[0]=g,c[1]=h,c[2]=i,c[3]=j,c[4]=k,c[5]=l,c},a.OBB3ToAABB3=function(b,c){c=c||a.AABB3();for(var d,e,f,g=1e5,h=1e5,i=1e5,j=-1e5,k=-1e5,l=-1e5,m=0,n=b.length;mj&&(j=d),e>k&&(k=e),f>l&&(l=f);return c[0]=g,c[1]=h,c[2]=i,c[3]=j,c[4]=k,c[5]=l,c},a.points3ToAABB3=function(b,c){c=c||a.AABB3();for(var d,e,f,g=1e5,h=1e5,i=1e5,j=-1e5,k=-1e5,l=-1e5,m=0,n=b.length;mj&&(j=d),e>k&&(k=e),f>l&&(l=f);return c[0]=g,c[1]=h,c[2]=i,c[3]=j,c[4]=k,c[5]=l,c},a.points3ToSphere3=function(){var b=new Float32Array(3);return function(c,d){d=d||a.vec4();var e,f=0,g=0,h=0,i=c.length;for(e=0;ek&&(k=j);return d[3]=k,d}}(),a.OBB3ToSphere3=function(){var b=new Float32Array(3),c=new Float32Array(3);return function(d,e){e=e||a.vec4();var f,g=0,h=0,i=0,j=d.length,k=j/4;for(f=0;fm&&(m=l);return e[3]=m,e}}(),a.getSphere3Center=function(b,c){return c=c||a.vec3(),c[0]=b[0],c[1]=b[1],c[2]=b[2],c},a.expandAABB3=function(a,b){return a[0]>b[0]&&(a[0]=b[0]),a[1]>b[1]&&(a[1]=b[1]),a[2]>b[2]&&(a[2]=b[2]),a[3]b[0]&&(a[3]=b[0]),a[4]>b[1]&&(a[4]=b[1]),a[5]>b[2]&&(a[5]=b[2]),a},a.collapseAABB2=function(b){return b=b||a.AABB2(),b[0]=1e7,b[1]=1e7,b[2]=-1e7,b[3]=-1e7,b},a.OBB3ToAABB2=function(b,c){c=c||a.AABB2();for(var d,e,f,g,h=1e7,i=1e7,j=-1e7,k=-1e7,l=0,m=b.length;lj&&(j=d),e>k&&(k=e);return c[0]=h,c[1]=i,c[2]=j,c[3]=k,c},a.expandAABB2=function(a,b){return a[0]>b[0]&&(a[0]=b[0]),a[1]>b[1]&&(a[1]=b[1]),a[2]b[0]&&(a[0]=b[0]),a[1]>b[1]&&(a[1]=b[1]),a[2]p)return null;var s=a.cross3Vec3(q,m,f),t=a.dotVec3(h,s);if(t<0||r+t>p)return null;var u=a.dotVec3(n,s)/p;return l[0]=g[0]+u*h[0],l[1]=g[1]+u*h[1],l[2]=g[2]+u*h[2],l}}(),a.rayPlaneIntersect=function(){var b=new Float32Array(3),c=new Float32Array(3),d=new Float32Array(3),e=new Float32Array(3);return function(f,g,h,i,j,k){k=k||a.vec3(),g=a.normalizeVec3(g,b);var l=a.subVec3(i,h,c),m=a.subVec3(j,h,d),n=a.cross3Vec3(l,m,e);a.normalizeVec3(n,n);var o=-a.dotVec3(h,n),p=-(a.dotVec3(f,n)+o)/a.dotVec3(g,n);return k[0]=f[0]+p*g[0],k[1]=f[1]+p*g[1],k[2]=f[2]+p*g[2],k}}(),a.cartesianToBarycentric=function(){var b=new Float32Array(3),c=new Float32Array(3),d=new Float32Array(3);return function(e,f,g,h,i){var j=a.subVec3(h,f,b),k=a.subVec3(g,f,c),l=a.subVec3(e,f,d),m=a.dotVec3(j,j),n=a.dotVec3(j,k),o=a.dotVec3(j,l),p=a.dotVec3(k,k),q=a.dotVec3(k,l),r=m*p-n*n;if(0===r)return null;var s=1/r,t=(p*o-n*q)*s,u=(m*q-n*o)*s;return i[0]=1-t-u,i[1]=u,i[2]=t,i}}(),a.barycentricInsideTriangle=function(a){var b=a[1],c=a[2];return c>=0&&b>=0&&c+b<1},a.barycentricToCartesian=function(b,c,d,e,f){f=f||a.vec3();var g=b[0],h=b[1],i=b[2];return f[0]=c[0]*g+d[0]*h+e[0]*i,f[1]=c[1]*g+d[1]*h+e[1]*i,f[2]=c[2]*g+d[2]*h+e[2]*i,f}}(),function(){"use strict";var a=xeogl.math;a.buildNormals=function(){var b=a.vec3(),c=a.vec3(),d=a.vec3(),e=a.vec3(),f=a.vec3(),g=a.vec3();return function(h,i,j){var k,l,m,n,o,p=new Array(h.length/3);for(k=0,l=i.length;k>24&255)/255,i=(n>>16&255)/255,h=(n>>8&255)/255,g=(255&n)/255,f=b[o],c=3*f,l[d]=a[c],l[d+1]=a[c+1],l[d+2]=a[c+2],m[e]=g,m[e+1]=h,m[e+2]=i,m[e+3]=j,f=b[o+1],c=3*f,l[d+3]=a[c],l[d+4]=a[c+1],l[d+5]=a[c+2],m[e+4]=g,m[e+5]=h,m[e+6]=i,m[e+7]=j,f=b[o+2],c=3*f,l[d+6]=a[c],l[d+7]=a[c+1],l[d+8]=a[c+2],m[e+8]=g,m[e+9]=h,m[e+10]=i,m[e+11]=j,n++;return{positions:l,colors:m}}}(),function(){"use strict";var a=xeogl.math;a.tangentQuadraticBezier=function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},a.tangentQuadraticBezier=function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},a.tangentSpline=function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},a.catmullRomInterpolate=function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e;return(2*b-2*c+f+g)*(e*h)+(-3*b+3*c-2*f-g)*h+f*e+b},a.b2p0=function(a,b){var c=1-a;return c*c*b},a.b2p1=function(a,b){return 2*(1-a)*a*b},a.b2p2=function(a,b){return a*a*b},a.b2=function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},a.b3p0=function(a,b){var c=1-a;return c*c*c*b},a.b3p1=function(a,b){var c=1-a;return 3*c*c*a*b},a.b3p2=function(a,b){return 3*(1-a)*a*a*b},a.b3p3=function(a,b){return a*a*a*b},a.b3=function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}}(),function(){"use strict";var a=xeogl.math;a.canvasPosToWorldRay=function(){var b=a.mat4(),c=a.mat4(),d=a.vec4(),e=a.vec4(),f=a.vec4(),g=a.vec4();return function(h,i,j,k){var l=h.scene.canvas.canvas,m=h.view.matrix,n=h.project.matrix,o=a.mulMat4(n,m,b),p=a.inverseMat4(o,c),q=l.width,r=l.height,s=(i[0]-q/2)/(q/2),t=-(i[1]-r/2)/(r/2);d[0]=s,d[1]=t,d[2]=-1,d[3]=1,a.transformVec4(p,d,e),a.mulVec4Scalar(e,1/e[3]),f[0]=s,f[1]=t,f[2]=1,f[3]=1,a.transformVec4(p,f,g),a.mulVec4Scalar(g,1/g[3]),j[0]=g[0],j[1]=g[1],j[2]=g[2],a.subVec3(g,e,k),a.normalizeVec3(k)}}(),a.canvasPosToLocalRay=function(){var b=a.vec3(),c=a.vec3();return function(d,e,f,g,h){a.canvasPosToWorldRay(d,f,b,c),a.worldRayToLocalRay(e,b,c,g,h)}}(),a.worldRayToLocalRay=function(){var b=a.mat4(),c=a.vec4(),d=a.vec4();return function(e,f,g,h,i){var j=e.transform.leafMatrix,k=a.inverseMat4(j,b);c[0]=f[0],c[1]=f[1],c[2]=f[2],c[3]=1,a.transformVec4(k,c,d),h[0]=d[0],h[1]=d[1],h[2]=d[2],a.transformVec3(k,g,i)}}()}(),function(){"use strict";xeogl.renderer=xeogl.renderer||{},xeogl.renderer.Renderer=function(a,b,c,d){d=d||{},this.stats=a||{},this.gl=c,this.canvas=b,this._programFactory=new xeogl.renderer.ProgramFactory(this.stats,c),this._objectFactory=new xeogl.renderer.ObjectFactory,this._chunkFactory=new xeogl.renderer.ChunkFactory,this._shadowLightObjects={},this.transparent=!0===d.transparent,this.bindOutputFramebuffer=null,this.unbindOutputFramebuffer=null,this.objects={},this._ambient=null,this.ambientColor=xeogl.math.vec4([0,0,0,1]),this._objectList=[],this._objectListLen=0,this._objectPickList=[],this._objectPickListLen=0,this._shadowObjectLists={},this._frameCtx={canvas:this.canvas,renderTarget:null,renderBuf:null,depthbufEnabled:null,clearDepth:null,depthFunc:null,blendEnabled:!1,backfaces:!0,frontface:!0,textureUnit:0,transparent:!1,ambientColor:null,drawElements:0,useProgram:0,bindTexture:0,bindArray:null,pass:null,bindOutputFramebuffer:null,pickIndex:0,shadowViewMatrix:null,shadowProjmatrix:null,pickViewMatrix:null,pickProjmatrix:null},this.visibility=null,this.cull=null,this.modes=null,this.layer=null,this.stage=null,this.depthBuf=null,this.colorBuf=null,this.lights=null,this.material=null,this.modelTransform=null,this.viewTransform=null,this.projTransform=null,this.billboard=null,this.stationary=null,this.colorTarget=null,this.depthTarget=null,this.clips=null,this.shader=null,this.shaderParams=null,this.geometry=null,this.viewport=null,this.objectListDirty=!0,this.stateOrderDirty=!0,this.stateSortDirty=!0,this.imageDirty=!0},xeogl.renderer.Renderer.prototype.webglRestored=function(a){this.gl=a,this._programFactory.webglRestored(a),this._chunkFactory.webglRestored(),this.pickBuf&&this.pickBuf.webglRestored(a),this.imageDirty=!0},xeogl.renderer.Renderer.prototype.buildObject=function(a){var b=this.objects[a];b||(b=this._objectFactory.get(a),b.hash=""),b.stage=this.stage,b.layer=this.layer,b.colorTarget=this.colorTarget,b.depthTarget=this.depthTarget,b.material=this.material,b.geometry=this.geometry,b.visibility=this.visibility,b.cull=this.cull,b.modes=this.modes,b.billboard=this.billboard,b.stationary=this.stationary,b.viewport=this.viewport,b.lights=this.lights;var c=[this.geometry.hash,this.shader.hash,this.clips.hash,this.material.hash,this.lights.hash,this.modes.hash,this.billboard.hash,this.stationary.hash].join(";");if(c!==b.hash){b.program&&this._programFactory.put(b.program),b.program=this._programFactory.get(c,this),b.hash=c,!0;var d=b.program;if(d){var e=d.program;if(!(e.allocated&&e.compiled&&e.validated&&e.linked))return this.objects[a]&&this.removeObject(a),{error:!0,errorLog:e.errorLog}}}return this._setChunk(b,0,"program",b.program),this._setChunk(b,1,"modelTransform",this.modelTransform),this._setChunk(b,2,"viewTransform",this.viewTransform),this._setChunk(b,3,"projTransform",this.projTransform),this._setChunk(b,4,"modes",this.modes),this._setChunk(b,5,"shader",this.shader),this._setChunk(b,6,"shaderParams",this.shaderParams),this._setChunk(b,7,"depthBuf",this.depthBuf),this._setChunk(b,8,"colorBuf",this.colorBuf),this._setChunk(b,9,"lights",this.lights),this._setChunk(b,10,this.material.type,this.material),this._setChunk(b,11,"clips",this.clips),this._setChunk(b,12,"viewport",this.viewport),this._setChunk(b,13,"geometry",this.geometry),this._setChunk(b,14,"draw",this.geometry,!0),this._setAmbientAndSpotLights(this.lights),this.objects[a]?this.stateOrderDirty=!0:(this.objects[a]=b,this.objectListDirty=!0),b.compiled=!0,b},xeogl.renderer.Renderer.prototype._mapShadowLightObject=function(a,b){for(var c,d,e=0,f=a.length;e=1?q-1:-1;var r=this._objectPickList[q];if(r&&(g={entity:r.id},f.pickSurface)){h.clear(),this._pickPrimitive(r,n,o),this.gl.finish(),p=h.read(i,j);var s=p[0]+256*p[1]+256*p[2]*256+256*p[3]*256*256;s*=3,g.primIndex=s,n&&(g.origin=k,g.direction=l)}return h.unbind(),g}}(),xeogl.renderer.Renderer.prototype._pickObject=function(a,b){var c=this.gl,d=this._frameCtx;d.depthbufEnabled=null,d.clearDepth=null,d.depthFunc=c.LESS,d.blendEnabled=!1,d.backfaces=!0,d.frontface=!0,d.textureUnit=0,d.drawElements=0,d.useProgram=0,d.bindTexture=0,d.bindArray=0,d.pickViewMatrix=a,d.pickProjMatrix=b,d.pickIndex=0,c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),c.clearColor(0,0,0,0),c.enable(c.DEPTH_TEST),c.frontFace(c.CCW),c.disable(c.CULL_FACE),c.disable(c.BLEND),c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT);var e,f,g,h,i,j,k=this._lastChunkId=this._lastChunkId||new Int32Array(30);for(e=0;e<20;e++)k[e]=-9999999999999;this._objectPickListLen=0;var l;for(e=0,f=this._objectListLen;ethis.length?(this.destroy(),this._allocate(a,a.length)):(this.gl.bindBuffer(this.type,this._handle),b||0===b?this.gl.bufferSubData(this.type,b*this.itemByteSize,a):this.gl.bufferData(this.type,a,this.usage),this.gl.bindBuffer(this.type,null)))},xeogl.renderer.webgl.ArrayBuffer.prototype.bind=function(){this.allocated&&this.gl.bindBuffer(this.type,this._handle)},xeogl.renderer.webgl.ArrayBuffer.prototype.unbind=function(){this.allocated&&this.gl.bindBuffer(this.type,null)},xeogl.renderer.webgl.ArrayBuffer.prototype.destroy=function(){this.allocated&&(this.gl.deleteBuffer(this._handle),this._handle=null,this.allocated=!1)}}(),function(){"use strict";xeogl.renderer.webgl.Attribute=function(a,b){this.gl=a,this.location=b},xeogl.renderer.webgl.Attribute.prototype.bindFloatArrayBuffer=function(a){a&&(a.bind(),this.gl.enableVertexAttribArray(this.location),this.gl.vertexAttribPointer(this.location,a.itemSize,this.gl.FLOAT,!1,0,0))},xeogl.renderer.webgl.Attribute.prototype.bindInterleavedFloatArrayBuffer=function(a,b,c){this.gl.enableVertexAttribArray(this.location),this.gl.vertexAttribPointer(this.location,a,this.gl.FLOAT,!1,b,c)}}(),function(){"use strict";function a(a){for(var b,c,d=[],e=0,f=a.length;e0&&"/"===b.charAt(c+1)&&(b=b.substring(0,c)),d.push(b);return d.join("\n")}xeogl.renderer.webgl.Program=function(b,c,d,e){if(this.stats=b,this.gl=c,this.allocated=!1,this.compiled=!1,this.linked=!1,this.validated=!1,this.errorLog=null,this.uniforms={},this.samplers={},this.attributes={},this._vertexShader=new xeogl.renderer.webgl.Shader(c,c.VERTEX_SHADER,a(d)),this._fragmentShader=new xeogl.renderer.webgl.Shader(c,c.FRAGMENT_SHADER,a(e)),!this._vertexShader.allocated)return void(this.errorLog=["Vertex shader failed to allocate"].concat(this._vertexShader.errorLog));if(!this._fragmentShader.allocated)return void(this.errorLog=["Fragment shader failed to allocate"].concat(this._fragmentShader.errorLog));if(this.allocated=!0,!this._vertexShader.compiled)return void(this.errorLog=["Vertex shader failed to compile"].concat(this._vertexShader.errorLog));if(!this._fragmentShader.compiled)return void(this.errorLog=["Fragment shader failed to compile"].concat(this._fragmentShader.errorLog));this.compiled=!0;var f,g,h,i,j;if(this.handle=c.createProgram(),!this.handle)return void(this.errorLog=["Failed to allocate program"]);if(c.attachShader(this.handle,this._vertexShader.handle),c.attachShader(this.handle,this._fragmentShader.handle),c.linkProgram(this.handle),this.linked=c.getProgramParameter(this.handle,c.LINK_STATUS),this.validated=!0,!this.linked||!this.validated)return this.errorLog=[],this.errorLog.push(""),this.errorLog.push(c.getProgramInfoLog(this.handle)),this.errorLog.push("\nVertex shader:\n"),this.errorLog=this.errorLog.concat(d),this.errorLog.push("\nFragment shader:\n"),void(this.errorLog=this.errorLog.concat(e));var k=c.getProgramParameter(this.handle,c.ACTIVE_UNIFORMS);for(g=0;gb){var d=b/c,e=a.width*d,f=a.height*d,g=document.createElement("canvas");g.width=xeogl.renderer.webgl.nextHighestPowerOfTwo(e),g.height=xeogl.renderer.webgl.nextHighestPowerOfTwo(f);g.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,g.width,g.height),a=g}return a},xeogl.renderer.webgl.ensureImageSizePowerOfTwo=function(a){if(!xeogl.renderer.webgl.isPowerOfTwo(a.width)||!xeogl.renderer.webgl.isPowerOfTwo(a.height)){var b=document.createElement("canvas");b.width=xeogl.renderer.webgl.nextHighestPowerOfTwo(a.width),b.height=xeogl.renderer.webgl.nextHighestPowerOfTwo(a.height);b.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,b.width,b.height),a=b}return a},xeogl.renderer.webgl.isPowerOfTwo=function(a){return 0==(a&a-1)},xeogl.renderer.webgl.nextHighestPowerOfTwo=function(a){--a;for(var b=1;b<32;b<<=1)a|=a>>b;return a+1}}(),function(){"use strict";xeogl.renderer.webgl.Uniform=function(a,b,c,d){var e=null,f=null;if(c===b.BOOL)e=function(a){f!==a&&(f=a,b.uniform1i(d,a))};else if(c===b.BOOL_VEC2)f=new Array(2),e=function(a){f[0]===a[0]&&f[1]===a[1]||(f[0]=a[0],f[1]=a[1],b.uniform2iv(d,a))};else if(c===b.BOOL_VEC3)f=new Array(3),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]||(f[0]=a[0],f[1]=a[1],f[2]=a[2],b.uniform3iv(d,a))};else if(c===b.BOOL_VEC4)f=new Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3],b.uniform4iv(d,a))};else if(c===b.INT)e=function(a){f!==a&&(f=a,b.uniform1iv(d,a))};else if(c===b.INT_VEC2)f=new Uint32Array(2),e=function(a){f[0]===a[0]&&f[1]===a[1]||(f.set(a),b.uniform2iv(d,a))};else if(c===b.INT_VEC3)f=new Uint32Array(3),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]||(f.set(a),b.uniform3iv(d,a))};else if(c===b.INT_VEC4)f=new Uint32Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f.set(a),b.uniform4iv(d,a))};else if(c===b.FLOAT)e=function(a){f!==a&&(f=a,b.uniform1f(d,a))};else if(c===b.FLOAT_VEC2)f=new Float32Array(2),e=function(a){f[0]===a[0]&&f[1]===a[1]||(f.set(a),b.uniform2fv(d,a))};else if(c===b.FLOAT_VEC3)f=new Float32Array(3),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]||(f.set(a),b.uniform3fv(d,a))};else if(c===b.FLOAT_VEC4)f=new Float32Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f.set(a),b.uniform4fv(d,a))};else if(c===b.FLOAT_MAT2)f=new Float32Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f.set(a),b.uniformMatrix2fv(d,b.FALSE,a))};else if(c===b.FLOAT_MAT3)f=new Float32Array(9),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]&&f[4]===a[4]&&f[5]===a[5]&&f[6]===a[6]&&f[7]===a[7]&&f[8]===a[8]||(f.set(a),b.uniformMatrix3fv(d,b.FALSE,a))};else{if(c!==b.FLOAT_MAT4)throw"Unsupported shader uniform type: "+c;f=new Float32Array(16),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]&&f[4]===a[4]&&f[5]===a[5]&&f[6]===a[6]&&f[7]===a[7]&&f[8]===a[8]&&f[9]===a[9]&&f[10]===a[10]&&f[11]===a[11]&&f[12]===a[12]&&f[13]===a[13]&&f[14]===a[14]&&f[15]===a[15]||(f.set(a),b.uniformMatrix4fv(d,b.FALSE,a))}}this.setValue=e,this.getLocation=function(){return d}}}(),function(){"use strict";xeogl.renderer=xeogl.renderer||{},xeogl.renderer.State=Class.extend({__init:function(a){this.id=this._ids.addItem({}),this.hash=a.hash||""+this.id;for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])},destroy:function(){this._ids.removeItem(this.id)}}),xeogl.renderer.Visibility=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Cull=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Modes=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Layer=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Stage=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.DepthBuf=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.ColorBuf=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Lights=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.PhongMaterial=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.SpecularMaterial=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.MetallicMaterial=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Transform=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Billboard=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Stationary=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.RenderTarget=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.RenderTarget.DEPTH=0,xeogl.renderer.RenderTarget.COLOR=1,xeogl.renderer.Clips=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.MorphTargets=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Shader=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.ShaderParams=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Texture=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.CubeTexture=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Fresnel=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Geometry=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.ProgramState=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Viewport=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})})}(),function(){"use strict";xeogl.renderer.Object=function(a){this.id=a,this.hash=null,this.sortKey=null,this.chunks=[],this.program=null,this.stage=null,this.modes=null,this.layer=null,this.material=null,this.compiled=!1}}(),function(){"use strict";xeogl.renderer.ObjectFactory=function(){var a=[],b=0;this.get=function(c){var d;return b>0?(d=a[--b],d.id=c,d.compiled=!1,d):new xeogl.renderer.Object(c)},this.put=function(c){a[b++]=c}}}(),function(){"use strict";xeogl.renderer=xeogl.renderer||{},xeogl.renderer.Program=function(a,b,c,d){this.stats=a,this.hash=c.hash,this.source=c,this.gl=d,this.draw=null,this.pickObject=null,this.pickPrimitive=null,this.useCount=0,this.allocated=!1,this.compiled=!1,this.linked=!1,this.validated=!1,this.errorLog=null,this.build(d)},xeogl.renderer.Program.prototype.build=function(a){return this.gl=a,this.allocated=!1,this.compiled=!1,this.linked=!1,this.validated=!1,this.errorLog=null,this.draw=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexDraw,this.source.fragmentDraw),this.shadow=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexShadow,this.source.fragmentShadow),this.pickObject=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexPickObject,this.source.fragmentPickObject),this.pickPrimitive=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexPickPrimitive,this.source.fragmentPickPrimitive),this.draw.allocated?this.shadow.allocated?this.pickObject.allocated?this.pickPrimitive.allocated?(this.allocated=!0,this.draw.compiled?this.shadow.compiled?this.pickObject.compiled?this.pickPrimitive.compiled?(this.compiled=!0,this.draw.linked?this.shadow.linked?this.pickObject.linked?this.pickPrimitive.linked?(this.linked=!0,this.draw.validated?this.shadow.validated?this.pickObject.validated?this.pickPrimitive.validated?void(this.validated=!0):void(this.errorLog=["Primitive-picking program failed to validate"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to validate"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to validate"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to validate"].concat(this.draw.errorLog))):void(this.errorLog=["Primitive-picking program failed to link"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to link"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to link"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to link"].concat(this.draw.errorLog))):void(this.errorLog=["Primitive-picking program failed to compile"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to compile"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to compile"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to compile"].concat(this.draw.errorLog))):void(this.errorLog=["Primitive-picking program failed to allocate"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to allocate"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to allocate"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to allocate"].concat(this.draw.errorLog))}}(),function(){"use strict";xeogl.renderer.ProgramFactory=function(a,b){this.stats=a,this._gl=b,this._programStates={}},xeogl.renderer.ProgramFactory.prototype.get=function(a,b){var c=this._programStates[a];if(!c){var d=xeogl.renderer.ProgramSourceFactory.getSource(a,b),e=new xeogl.renderer.Program(this.stats,a,d,this._gl);c=new xeogl.renderer.ProgramState({program:e,useCount:0}),this._programStates[a]=c,this.stats.memory.programs++}return c.useCount++,c},xeogl.renderer.ProgramFactory.prototype.put=function(a){if(--a.useCount<=0){var b=a.program;b.draw.destroy(),b.shadow.destroy(),b.pickObject.destroy(),b.pickPrimitive.destroy(),xeogl.renderer.ProgramSourceFactory.putSource(b.hash),delete this._programStates[b.hash],this.stats.memory.programs--}},xeogl.renderer.ProgramFactory.prototype.webglRestored=function(a){this._gl=a;for(var b in this._programStates)this._programStates.hasOwnProperty(b)&&this._programStates[b].build(a)},xeogl.renderer.ProgramFactory.prototype.destroy=function(){}}(),function(){"use strict";xeogl.renderer.ProgramSource=function(a,b,c,d,e,f,g,h,i){this.hash=a,this.vertexPickObject=b,this.fragmentPickObject=c,this.vertexPickPrimitive=d,this.fragmentPickPrimitive=e,this.vertexDraw=f,this.fragmentDraw=g,this.vertexShadow=h,this.fragmentShadow=i,this.useCount=0}}(),function(){"use strict";xeogl.renderer.ProgramSourceFactory=new function(){function a(){if(!r.modes.receiveShadow)return!1;var a=r.lights.lights;if(!a)return!1;for(var b=0,c=a.length;b 1.0) {"),o(" discard;"),o("}")),o("float occlusion = 1.0;"),o(e.ambient?"vec3 ambientColor = materialAmbient;":"vec3 ambientColor = vec3(1.0, 1.0, 1.0);"),o(e.diffuse?"vec3 diffuseColor = materialDiffuse;":e.baseColor?"vec3 diffuseColor = materialBaseColor;":"vec3 diffuseColor = vec3(1.0, 1.0, 1.0);"),f.colors&&o("diffuseColor *= vColor.rgb;"),o(e.emissive?"vec3 emissiveColor = materialEmissive;":"vec3 emissiveColor = vec3(0.0, 0.0, 0.0);"),o(e.specular?"vec3 specular = materialSpecular;":"vec3 specular = vec3(1.0, 1.0, 1.0);"),o(void 0!==e.opacity?"float opacity = materialOpacity;":"float opacity = 1.0;"),f.colors&&o("opacity *= vColor.a;"),o(void 0!==e.glossiness?"float glossiness = materialGlossiness;":"float glossiness = 1.0;"),o(void 0!==e.metallic?"float metallic = materialMetallic;":"float metallic = 1.0;"),o(void 0!==e.roughness?"float roughness = materialRoughness;":"float roughness = 1.0;"),o(void 0!==e.specularF0?"float specularF0 = materialSpecularF0;":"float specularF0 = 1.0;"),f.uv&&(f.normals&&e.normalMap||e.ambientMap||e.baseColorMap||e.diffuseMap||e.occlusionMap||e.emissiveMap||e.metallicMap||e.roughnessMap||e.metallicRoughnessMap||e.specularMap||e.glossinessMap||e.specularGlossinessMap||e.opacityMap)&&(o("vec4 texturePos = vec4(vUV.s, vUV.t, 1.0, 1.0);"),o("vec2 textureCoord;")),f.uv&&e.ambientMap&&(o(e.ambientMap.matrix?"textureCoord = (ambientMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("ambientColor *= texture2D(ambientMap, textureCoord).rgb;")),f.uv&&e.diffuseMap&&(o(e.diffuseMap.matrix?"textureCoord = (diffuseMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("diffuseColor *= texture2D(diffuseMap, textureCoord).rgb;")),f.uv&&e.baseColorMap&&(o(e.baseColorMap.matrix?"textureCoord = (baseColorMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("diffuseColor *= texture2D(baseColorMap, textureCoord).rgb;")),f.uv&&e.emissiveMap&&(o(e.emissiveMap.matrix?"textureCoord = (emissiveMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("emissiveColor *= texture2D(emissiveMap, textureCoord).rgb;")),f.uv&&e.opacityMap&&(o(e.opacityMap.matrix?"textureCoord = (opacityMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("opacity *= texture2D(opacityMap, textureCoord).r;")),f.uv&&e.occlusionMap&&(o(e.occlusionMap.matrix?"textureCoord = (occlusionMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("occlusion *= texture2D(occlusionMap, textureCoord).r;")),f.normals&&(j.length>0||r.lights.lightMap||r.lights.reflectionMap)){f.uv&&e.normalMap?(o(e.normalMap.matrix?"textureCoord = (normalMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("vec3 viewNormal = vTBN * normalize( texture2D(normalMap, vec2(textureCoord.x, textureCoord.y) ).rgb * 2.0 - 1.0);")):o("vec3 viewNormal = normalize(vViewNormal);"),f.uv&&e.specularMap&&(o(e.specularMap.matrix?"textureCoord = (specularMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("specular *= texture2D(specularMap, textureCoord).rgb;")),f.uv&&e.glossinessMap&&(o(e.glossinessMap.matrix?"textureCoord = (glossinessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("glossiness *= texture2D(glossinessMap, textureCoord).r;")),f.uv&&e.specularGlossinessMap&&(o(e.specularGlossinessMap.matrix?"textureCoord = (materialSpecularGlossinessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("vec4 specGlossRGB = texture2D(materialSpecularGlossinessMap, textureCoord).rgba;"),o("specular *= specGlossRGB.rgb;"),o("glossiness *= specGlossRGB.a;")),f.uv&&e.metallicMap&&(o(e.metallicMap.matrix?"textureCoord = (metallicMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("metallic *= texture2D(metallicMap, textureCoord).r;")),f.uv&&e.roughnessMap&&(o(e.roughnessMap.matrix?"textureCoord = (roughnessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("roughness *= texture2D(roughnessMap, textureCoord).r;")),f.uv&&e.metallicRoughnessMap&&(o(e.metallicRoughnessMap.matrix?"textureCoord = (metallicRoughnessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),o("vec3 metalRoughRGB = texture2D(metallicRoughnessMap, textureCoord).rgb;"),o("metallic *= metalRoughRGB.r;"),o("roughness *= metalRoughRGB.g;")),o("vec3 viewEyeDir = normalize(-vViewPosition);"),(e.diffuseFresnel||e.specularFresnel||e.opacityFresnel||e.emissiveFresnel||e.reflectivityFresnel)&&(e.diffuseFresnel&&(o("float diffuseFresnel = fresnel(viewEyeDir, viewNormal, diffuseFresnelEdgeBias, diffuseFresnelCenterBias, diffuseFresnelPower);"),o("diffuseColor *= mix(diffuseFresnelEdgeColor, diffuseFresnelCenterColor, diffuseFresnel);")),e.specularFresnel&&(o("float specularFresnel = fresnel(viewEyeDir, viewNormal, specularFresnelEdgeBias, specularFresnelCenterBias, specularFresnelPower);"),o("specular *= mix(specularFresnelEdgeColor, specularFresnelCenterColor, specularFresnel);")),e.opacityFresnel&&(o("float opacityFresnel = fresnel(viewEyeDir, viewNormal, opacityFresnelEdgeBias, opacityFresnelCenterBias, opacityFresnelPower);"),o("opacity *= mix(opacityFresnelEdgeColor.r, opacityFresnelCenterColor.r, opacityFresnel);")),e.emissiveFresnel&&(o("float emissiveFresnel = fresnel(viewEyeDir, viewNormal, emissiveFresnelEdgeBias, emissiveFresnelCenterBias, emissiveFresnelPower);"),o("emissiveColor *= mix(emissiveFresnelEdgeColor, emissiveFresnelCenterColor, emissiveFresnel);"))),o("IncidentLight light;"),o("Material material;"),o("Geometry geometry;"),o("ReflectedLight reflectedLight = ReflectedLight(vec3(0.0,0.0,0.0), vec3(0.0,0.0,0.0));"),o("vec3 viewLightDir;"),g&&(o("material.diffuseColor = diffuseColor;"),o("material.specularColor = specular;"),o("material.shine = materialShininess;")),i&&(o("float oneMinusSpecularStrength = 1.0 - max(max(specular.r, specular.g ),specular.b);"),o("material.diffuseColor = diffuseColor * oneMinusSpecularStrength;"),o("material.specularRoughness = clamp( 1.0 - glossiness, 0.04, 1.0 );"),o("material.specularColor = specular;")),h&&(o("float dielectricSpecular = 0.16 * specularF0 * specularF0;"),o("material.diffuseColor = diffuseColor * (1.0 - dielectricSpecular) * (1.0 - metallic);"),o("material.specularRoughness = clamp(roughness, 0.04, 1.0);"),o("material.specularColor = mix(vec3(dielectricSpecular), diffuseColor, metallic);")),o("geometry.position = vViewPosition;"),r.lights.lightMap&&o("geometry.worldNormal = normalize(vWorldNormal);"),o("geometry.viewNormal = viewNormal;"),o("geometry.viewEyeDir = viewEyeDir;"),g&&(r.lights.lightMap||r.lights.reflectionMap)&&o("computePhongLightMapping(geometry, material, reflectedLight);"),(i||h)&&(r.lights.lightMap||r.lights.reflectionMap)&&o("computePBRLightMapping(geometry, material, reflectedLight);");var d;for(b=0,c=j.length;b depth + 0.005) ? 0.7 : 1.0;"));g?(o("ambientColor *= lightAmbient;"),o("vec3 outgoingLight = (shadow * occlusion * (ambientColor + reflectedLight.diffuse + reflectedLight.specular)) + emissiveColor;")):o("vec3 outgoingLight = (shadow * occlusion * reflectedLight.diffuse) + (shadow * occlusion * reflectedLight.specular) + emissiveColor;")}else o("ambientColor *= lightAmbient;"),o("vec3 outgoingLight = emissiveColor + ambientColor;");return o("gl_FragColor = vec4(outgoingLight, opacity);"),o("}"),p()}function n(){M=[]}function o(a){M.push(a||"")}function p(){return M}function q(a){return a.getShaderPrecisionFormat?a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision>0?"highp":a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision>0?"mediump":"lowp":"mediump"}var r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L={},M="";this.getSource=function(n,o){var p=L[n];return p?(p.useCount++,p):(r=o,v=b(),w=d(),x=e(),s="phongMaterial"===r.material.type,t="MetallicMaterial"===r.material.type,u="SpecularMaterial"===r.material.type,y=c(),z=r.material.diffuseFresnel,A=r.material.specularFresnel,B=r.material.opacityFresnel,C=r.material.reflectivityFresnel,D=r.material.emissiveFresnel,E=a(),p=new xeogl.renderer.ProgramSource(n,f(),g(),h(),i(),l(),m(),j(),k()),L[n]=p,p)},this.putSource=function(a){var b=L[a];b&&0==--b.useCount&&(L[b.hash]=null)}}}(),function(){"use strict";xeogl.renderer.Chunk=function(){},xeogl.renderer.Chunk.prototype.init=function(a,b,c){this.id=a,this.program=b,this.state=c,this.useCount=0,this.build&&this.build()}}(),function(){"use strict";xeogl.renderer.ChunkFactory=function(){this.types=xeogl.renderer.ChunkFactory.types},xeogl.renderer.ChunkFactory.types={},xeogl.renderer.ChunkFactory.createChunkType=function(a){if(!a.type)throw"'type' expected in params";var b=xeogl.renderer.Chunk,c=function(){this.init.apply(this,arguments)};return c.prototype=new b,c.prototype.constructor=c,xeogl._apply(a,c.prototype),xeogl.renderer.ChunkFactory.types[a.type]={constructor:c,chunks:{},freeChunks:[],freeChunksLen:0},c},xeogl.renderer.ChunkFactory.prototype.getChunk=function(a,b,c,d){var e=this.types[b];if(!e)throw"chunk type not supported: '"+b+"'";var f=e.chunks[a];return f?(f.useCount++,f):(e.freeChunksLen>0&&(f=e.freeChunks[--e.freeChunksLen]),f?f.init(a,c,d):f=new e.constructor(a,c,d),f.useCount=1,e.chunks[a]=f,f)},xeogl.renderer.ChunkFactory.prototype.putChunk=function(a){if(0===a.useCount)return void console.error("xeogl.renderer.Chunkfactory.putChunk: chunk put too many times!");if(0===--a.useCount){var b=this.types[a.type];delete b.chunks[a.id],b.freeChunks[b.freeChunksLen++]=a}},xeogl.renderer.ChunkFactory.prototype.webglRestored=function(a){var b,c,d,e=this.types;for(var f in e)if(e.hasOwnProperty(f)){b=e[f],c=b.chunks;for(var g in c)c.hasOwnProperty(g)&&(d=c[g],d.build&&d.build())}}}(),function(){"use strict";xeogl.renderer.ChunkFactory.createChunkType({type:"clips",build:function(){var a,b;this._uClipModeDraw=this._uClipModeDraw||[],this._uClipPlaneDraw=this._uClipPlaneDraw||[];var c=this.program.draw;for(a=0,b=this.state.clips.length;a>16&255,e=a.pickIndex>>8&255,f=255&a.pickIndex;this._uPickColorObject.setValue([f/255,e/255,d/255,1])}b.indices&&(c.drawElements(b.primitive,b.indices.numItems,b.indices.itemType,0),a.drawElements++)},pickPrimitive:function(){var a=this.state,b=this.program.gl,c=a.getPickPositions();c&&b.drawArrays(a.primitive,0,c.numItems/3)}})}(),function(){"use strict";xeogl.renderer.ChunkFactory.createChunkType({type:"geometry",build:function(){var a=this.program.draw;this._aPositionDraw=a.getAttribute("position"),this._aNormalDraw=a.getAttribute("normal"),this._aUVDraw=a.getAttribute("uv"),this._aTangentDraw=a.getAttribute("tangent"),this._aColorDraw=a.getAttribute("color"),this._aPositionShadow=this.program.shadow.getAttribute("position");var b=this.program.pickObject;this._aPositionPickObject=b.getAttribute("position");var c=this.program.pickPrimitive;this._aPositionPickPrimitive=c.getAttribute("position"),this._aColorPickPrimitive=c.getAttribute("color")},draw:function(a){var b=this.state;this._aPositionDraw&&(this._aPositionDraw.bindFloatArrayBuffer(b.positions),a.bindArray++),this._aNormalDraw&&(this._aNormalDraw.bindFloatArrayBuffer(b.normals),a.bindArray++),this._aUVDraw&&(this._aUVDraw.bindFloatArrayBuffer(b.uv),a.bindArray++),this._aColorDraw&&(this._aColorDraw.bindFloatArrayBuffer(b.colors),a.bindArray++),this._aTangentDraw&&(this._aTangentDraw.bindFloatArrayBuffer(b.getTangents()),a.bindArray++),b.indices&&(b.indices.bind(),a.bindArray++)},shadow:function(a){var b=this.state;this._aPositionShadow&&(this._aPositionShadow.bindFloatArrayBuffer(b.positions),a.bindArray++),b.indices&&(b.indices.bind(),a.bindArray++)},pickObject:function(){var a=this.state;this._aPositionPickObject&&this._aPositionPickObject.bindFloatArrayBuffer(a.positions),a.indices&&a.indices.bind()},pickPrimitive:function(){var a=this.state;this._aPositionPickPrimitive&&this._aPositionPickPrimitive.bindFloatArrayBuffer(a.getPickPositions()),this._aColorPickPrimitive&&this._aColorPickPrimitive.bindFloatArrayBuffer(a.getPickColors())}})}(),function(){"use strict";xeogl.renderer.ChunkFactory.createChunkType({type:"lights",build:function(){this._uLightAmbientColor=this._uLightAmbientColor||[],this._uLightAmbientIntensity=this._uLightAmbientIntensity||[],this._uLightColor=this._uLightColor||[],this._uLightIntensity=this._uLightIntensity||[],this._uLightDir=this._uLightDir||[],this._uLightPos=this._uLightPos||[],this._uLightAttenuation=this._uLightAttenuation||[],this._uShadowViewMatrix=this._uShadowViewMatrix||[],this._uShadowProjMatrix=this._uShadowProjMatrix||[];for(var a,b=this.state.lights,c=this.program,d=0,e=b.length;d0)return[k[0],e+m.join(",\n"+l),k[1]].join("\n"+d)}return h}(a,"",0)}function b(a){return a.replace(d,function(a,b){return b?a:a+" "})}function c(a,b,c){return b in a?a[b]:c}var d=/("(?:[^"]|\\.)*")|[:,]/g;return function(){return a(this.json,null,"\t")}}()},js:{get:function(){return"new "+this.type+"("+this.string+");"}}},destroy:function(){if(!this.destroyed){var a,b,c,d,e,f;if(this._attachments)for(a in this._attachments)if(this._attachments.hasOwnProperty(a)){for(b=this._attachments[a],c=b.component,d=b.subs,e=0,f=d.length;e-1){var I=H.geometry;if("triangles"===I.primitive){G.primitive="triangle";var J=G.primIndex,K=I.indices,L=I.positions,M=K[J],N=K[J+1],O=K[J+2],P=3*M,Q=3*N,R=3*O;g[0]=M,g[1]=N,g[2]=O,G.indices=g,d[0]=L[P],d[1]=L[P+1],d[2]=L[P+2],e[0]=L[Q],e[1]=L[Q+1],e[2]=L[Q+2],f[0]=L[R],f[1]=L[R+1],f[2]=L[R+2];var S;F.canvasPos?(S=F.canvasPos,G.canvasPos=F.canvasPos,a.canvasPosToLocalRay(H.camera,H,S,b,c)):F.origin&&F.direction&&a.worldRayToLocalRay(H,F.origin,F.direction,b,c),a.normalizeVec3(c),a.rayPlaneIntersect(b,c,d,e,f,h),G.localPos=h,G.position=h,r[0]=h[0],r[1]=h[1],r[2]=h[2],r[3]=1,a.transformVec4(H.transform.leafMatrix,r,s),i[0]=s[0],i[1]=s[1],i[2]=s[2],G.worldPos=i,a.transformVec4(H.camera.view.matrix,s,t),j[0]=t[0],j[1]=t[1],j[2]=t[2],G.viewPos=j,a.cartesianToBarycentric(h,d,e,f,k),G.bary=k;var T=I.normals;if(T){l[0]=T[P],l[1]=T[P+1],l[2]=T[P+2],m[0]=T[Q],m[1]=T[Q+1],m[2]=T[Q+2],n[0]=T[R],n[1]=T[R+1],n[2]=T[R+2];var U=a.addVec3(a.addVec3(a.mulVec3Scalar(l,k[0],u),a.mulVec3Scalar(m,k[1],v),w),a.mulVec3Scalar(n,k[2],x),y);G.normal=a.transformVec3(H.transform.leafMatrix,U,z)}var V=I.uv;V&&(o[0]=V[2*M],o[1]=V[2*M+1],p[0]=V[2*N],p[1]=V[2*N+1],q[0]=V[2*O],q[1]=V[2*O+1],G.uv=a.addVec3(a.addVec3(a.mulVec2Scalar(o,k[0],A),a.mulVec2Scalar(p,k[1],B),C),a.mulVec2Scalar(q,k[2],D),E))}}return G}}}(),clear:function(){for(var a in this.components)this.components.hasOwnProperty(a)&&this.components[a].destroy();this._initDefaults(),this._dirtyEntities={}},_getSharedComponent:function(a,b){var c,d;if(xeogl._isObject(a)?(c=a.type||"xeogl.Component",d=xeogl[c.substring(6)]):xeogl._isString(a)?(c=a,d=xeogl[c.substring(6)]):(d=a,c=a.prototype.type),!d)return void this.error("Component type not found: "+c);if(!xeogl._isComponentType(c,"xeogl.Component"))return void this.error("Expected a xeogl.Component type or subtype");var e,f;return void 0!==b&&(f="__shared."+c+"."+b,e=this._sharedComponents[f])?(this._sharedCounts[f]++,e):a&&a.id&&this.components[a.id]?(this.error("Component "+xeogl._inQuotes(a.id)+" already exists in Scene - ignoring ID, will randomly-generate instead"),null):(e=new d(this,a),void 0!==b&&(this._sharedComponents[f]=e,this._sharedComponentIDs[e.id]=f,this._sharedCounts[f]=1,e.on("destroyed",function(){void 0!==this._sharedComponentIDs[e.id]&&this._putSharedComponent(e)},this)),e)},_putSharedComponent:function(a){var b=this._sharedComponentIDs[a.id];if(void 0!==b){if(--this._sharedCounts[b]>0)return;delete this._sharedComponents[b],delete this._sharedComponentIDs[a.id],delete this._sharedCounts[b]}a.destroy()},_compile:function(a,b,c){var d,e=0;for(var f in this._dirtyEntities)this._dirtyEntities.hasOwnProperty(f)&&(d=this._dirtyEntities[f],d._valid()&&(d._compileAsynch(),delete this._dirtyEntities[f],e++));this._renderer.render({pass:a,clear:b,force:c});var g=this.canvas;if(g.transparent||g.backgroundImage||g.backgroundColor)this._lastAmbientColor=null;else{var h=this._renderer.ambientColor;this._lastAmbientColor&&this._lastAmbientColor[0]===h[0]&&this._lastAmbientColor[1]===h[1]&&this._lastAmbientColor[2]===h[2]&&this._lastAmbientColor[3]===h[3]||(g.backgroundColor=h,this._lastAmbientColor||(this._lastAmbientColor=xeogl.math.vec4()),this._lastAmbientColor.set(h))}},_getJSON:function(){var a,b=[];for(var c in this.components)if(this.components.hasOwnProperty(c)){if(a=this.components[c],!a._getJSON)continue;b.push(a.json)}return{passes:this._passes,clearEachPass:this._clearEachPass,components:b}},_destroy:function(){this.clear()}})}(),function(){"use strict";xeogl.MorphTargets=xeogl.Component.extend({type:"xeogl.MorphTargets",_init:function(a){this.scene.on("webglContextRestored",function(){}),this.targets=a.targets,this.factor=a.factor},_props:{targets:{set:function(a){},get:function(){}},factor:{set:function(a){},get:function(){return 0}},_compile:function(){this._renderer.MorphTargets=this._state}},_getJSON:function(){return{targets:this.targets,factor:this.factor}}})}(),function(){"use strict";var a=xeogl.math;xeogl.CameraFlightAnimation=xeogl.Component.extend({type:"xeogl.CameraFlightAnimation",_init:function(b){this._aabbHelper=this.create({type:"xeogl.Entity",camera:b.camera,geometry:this.create({type:"xeogl.AABBGeometry"}),material:this.create({type:"xeogl.PhongMaterial",diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],emissive:[.5,1,.5],lineWidth:2}),visibility:this.create({type:"xeogl.Visibility",visible:!1}),modes:this.create({type:"xeogl.Modes",collidable:!1})}),this._obbHelper=this.create({type:"xeogl.Entity",camera:b.camera,geometry:this.create({type:"xeogl.OBBGeometry",material:this.create({type:"xeogl.PhongMaterial",diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],emissive:[.5,1,.5],lineWidth:2})}),visibility:this.create({type:"xeogl.Visibility",visible:!1}),modes:this.create({type:"xeogl.Modes",collidable:!1})}),this._look1=a.vec3(),this._eye1=a.vec3(),this._up1=a.vec3(),this._look2=a.vec3(),this._eye2=a.vec3(),this._up2=a.vec3(),this._flying=!1,this._flyEyeLookUp=!1,this._callback=null,this._callbackScope=null,this._onTick=null,this._time1=null,this._time2=null,this.easing=!1!==b.easing,this.duration=b.duration,this.fit=b.fit,this.fitFOV=b.fitFOV,this.trail=b.trail,this.camera=b.camera},flyTo:function(){var b=a.vec3();return function(c,d,e){c=c||this.scene,this._flying&&this.stop();var f=this._attached.camera;if(!f)return void(d&&(e?d.call(e):d()));this._flying=!1,this._callback=d,this._callbackScope=e;var g=f.view;this._eye1[0]=g.eye[0],this._eye1[1]=g.eye[1],this._eye1[2]=g.eye[2],this._look1[0]=g.look[0],this._look1[1]=g.look[1],this._look1[2]=g.look[2],this._up1[0]=g.up[0],this._up1[1]=g.up[1],this._up1[2]=g.up[2];var h,i,j,k,l;if(c.worldBoundary)h=c.worldBoundary.aabb;else if(c.aabb)h=c.aabb;else if(6===c.length)h=c;else if(c.eye||c.look||c.up)i=c.eye,j=c.look,k=c.up;else{var m=c;if((xeogl._isNumeric(m)||xeogl._isString(m))&&(l=m, -!(m=this.scene.components[l])))return this.error("Component not found: "+xeogl._inQuotes(l)),void(d&&(e?d.call(e):d()));var n=m.worldBoundary;if(!n)return this.error("Can't fly to component "+xeogl._inQuotes(l)+" - does not have a worldBoundary"),void(d&&(e?d.call(e):d()));h=n.aabb}var o=c.offset;if(h){if(h[3]<=h[0]||h[4]<=h[1]||h[5]<=h[2])return;!1!==c.showAABB&&(this._aabbHelper.geometry.aabb=h,this._aabbHelper.visibility.visible=!0);var p=a.getAABB3Center(h);this._look2=c.look||p,o&&(this._look2[0]+=o[0],this._look2[1]+=o[1],this._look2[2]+=o[2]);var q=a.normalizeVec3(a.subVec3(this._eye1,this._look1,b)),r=(c.look,a.getAABB3Diag(h)),s=Math.abs(r/Math.tan((c.fitFOV||this._fitFOV)*xeogl.math.DEGTORAD));this._eye2[0]=this._look2[0]+q[0]*s,this._eye2[1]=this._look2[1]+q[1]*s,this._eye2[2]=this._look2[2]+q[2]*s,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyEyeLookUp=!1}else(i||j||k)&&(j=j||this._look1,i=i||this._eye1,k=k||this._up1,this._look2[0]=j[0],this._look2[1]=j[1],this._look2[2]=j[2],this._eye2[0]=i[0],this._eye2[1]=i[1],this._eye2[2]=i[2],this._up2[0]=k[0],this._up2[1]=k[1],this._up2[2]=k[2],this._flyEyeLookUp=!0);this.fire("started",c,!0),this._time1=Date.now(),this._time2=this._time1+(c.duration?1e3*c.duration:this._duration),this._flying=!0,xeogl.scheduleTask(this._update,this)}}(),jumpTo:function(a){var b=this;xeogl.scheduleTask(function(){b._jumpTo(a)})},_jumpTo:function(){var b=(a.vec3(),a.vec3()),c=a.vec3(),d=a.vec3(),e=a.vec3(),f=a.vec3();return function(g){this._flying&&this.stop();var h=this._attached.camera;if(h){var i,j,k,l=h.view;if(g.worldBoundary)j=g.worldBoundary.sphere;else if(g.sphere)j=g.sphere;else if(g.aabb)i=g.aabb;else if(6===g.length)i=g;else if(4===g.length)j=g;else if(g.eye||g.look||g.up)b=g.eye,c=g.look,d=g.up;else{var m=g;if((xeogl._isNumeric(m)||xeogl._isString(m))&&(k=m,!(m=this.scene.components[k])))return void this.error("Component not found: "+xeogl._inQuotes(k));var n=m.worldBoundary;if(!n)return void this.error("Can't jump to component "+xeogl._inQuotes(k)+" - does not have a worldBoundary");j=n.sphere}g.offset;if(i||j){var o;if(i){if(i[3]<=i[0]||i[4]<=i[1]||i[5]<=i[2])return;o=a.getAABB3Diag(i),a.getAABB3Center(i,c)}else{if(j[3]<=0)return;o=2*j[3],c[0]=j[0],c[1]=j[1],c[2]=j[2]}this._trail?a.subVec3(l.look,c,e):a.subVec3(l.eye,l.look,e),a.normalizeVec3(e);var p;p=(void 0!==g.fit?g.fit:this._fit)?Math.abs(o/Math.tan((g.fitFOV||this._fitFOV)*xeogl.math.DEGTORAD)):a.lenVec3(a.subVec3(l.eye,l.look,f)),a.mulVec3Scalar(e,p),l.eye=a.addVec3(c,e,b),l.look=c}else(b||c||d)&&(b&&(l.eye=b),c&&(l.look=c),d&&(l.up=d))}}}(),_update:function(){var b=a.vec3(),c=a.vec3(),d=a.vec3(),e=a.vec3(),f=a.vec3();return function(){if(this._flying){var g=Date.now(),h=(g-this._time1)/(this._time2-this._time1),i=h>=1;h>1&&(h=1),h=this.easing?this._ease(h,0,1,1):h;var j=this._attached.camera.view;if(this._flyEyeLookUp)j.eye=a.lerpVec3(h,0,1,this._eye1,this._eye2,c),j.look=a.lerpVec3(h,0,1,this._look1,this._look2,d),j.up=a.lerpVec3(h,0,1,this._up1,this._up2,e);else{a.lerpVec3(h,0,1,this._look1,this._look2,d);var k;this._trail?a.subVec3(d,j.look,b):a.subVec3(j.eye,j.look,b),a.normalizeVec3(b),a.lerpVec3(h,0,1,this._eye1,this._eye2,c),a.subVec3(c,d,f),k=a.lenVec3(f),a.mulVec3Scalar(b,k),j.eye=a.addVec3(d,b,c),j.look=d}if(i)return void this.stop();xeogl.scheduleTask(this._update,this)}}}(),_ease:function(a,b,c,d){return a/=d,-c*a*(a-2)+b},stop:function(){if(this._flying){this._aabbHelper.visibility.visible=!1,this._flying=!1,this._time1=null,this._time2=null;var a=this._callback;a&&(this._callback=null,this._callbackScope?a.call(this._callbackScope):a()),this.fire("stopped",!0,!0)}},cancel:function(){this._flying&&(this._aabbHelper.visibility.visible=!1,this._flying=!1,this._time1=null,this._time2=null,this._callback&&(this._callback=null),this.fire("canceled",!0,!0))},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0}),this._aabbHelper.camera=this._attached.camera,this.stop()},get:function(){return this._attached.camera}},duration:{set:function(a){a=a||.5,this._duration=1e3*a,this.stop()},get:function(){return this._duration/1e3}},fit:{set:function(a){this._fit=!1!==a,this.fire("fit",this._fit)},get:function(){return this._fit}},fitFOV:{set:function(a){a=a||45,this._fitFOV=a},get:function(){return this._fitFOV}},trail:{set:function(a){this._trail=!!a,this.fire("trail",this._trail)},get:function(){return this._trail}}},_getJSON:function(){var a={duration:this._duration,fitFOV:this._fitFOV,fit:this._fit,trail:this._trail};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.stop()}})}(),function(){"use strict";xeogl.Camera=xeogl.Component.extend({type:"xeogl.Camera",_init:function(a){this.project=a.project,this.view=a.view},_props:{project:{set:function(a){this._attach({name:"project",type:"xeogl.Transform",component:a,sceneDefault:!0,on:{matrix:{callback:function(){this.fire("projectMatrix")},scope:this}}})},get:function(){return this._attached.project}},view:{set:function(a){this._attach({name:"view",type:"xeogl.Transform",component:a,sceneDefault:!0,on:{matrix:{callback:function(){this.fire("viewMatrix")},scope:this}}})},get:function(){return this._attached.view}}},_compile:function(){this._renderer.projTransform=this._attached.project._state,this._renderer.viewTransform=this._attached.view._state},_getJSON:function(){return{project:this._attached.project.id,view:this._attached.view.id}}})}(),function(){"use strict";xeogl.Canvas=xeogl.Component.extend({type:"xeogl.Canvas",serializable:!1,_WEBGL_CONTEXT_NAMES:["webgl","experimental-webgl","webkit-3d","moz-webgl","moz-glweb20"],_init:function(a){if(this.canvas=null,this.overlay=null,this.gl=null,this.webgl2=!1,this.transparent=!!a.transparent,this.contextAttr=a.contextAttr||{},this.contextAttr.alpha=this.transparent,void 0!==this.contextAttr.alpha&&null!==this.contextAttr.alpha||(this.contextAttr.alphs=this.transparent),void 0!==this.contextAttr.preserveDrawingBuffer&&null!==this.contextAttr.preserveDrawingBuffer||(this.contextAttr.preserveDrawingBuffer=!1),a.canvas?xeogl._isString(a.canvas)?(this.canvas=document.getElementById(a.canvas),this.canvas||(this.error("Canvas element not found: "+xeogl._inQuotes(a.canvas)+" - creating default canvas instead."),this._createCanvas())):this.canvas=a.canvas:this._createCanvas(),!this.canvas)return void this.error("Faied to create canvas");this.canvas.width=this.canvas.clientWidth,this.canvas.height=this.canvas.clientHeight,this.boundary=[this.canvas.offsetLeft,this.canvas.offsetTop,this.canvas.clientWidth,this.canvas.clientHeight],this._createBackground(),this._createOverlay(),this._initWebGL(a);var b=this;this.canvas.addEventListener("webglcontextlost",function(){b.fire("webglContextLost")},!1),this.canvas.addEventListener("webglcontextrestored",function(){b._initWebGL(),b.gl&&b.fire("webglContextRestored",b.gl)},!1);var c=null,d=null,e=null,f=null,g=null,h=null;this._tick=this.scene.on("tick",function(){var a=b.canvas,i=window.innerWidth!==c||window.innerHeight!==d,j=a.clientWidth!==e||a.clientHeight!==f,k=a.offsetLeft!==g||a.offsetTop!==h;if(i||j||k){if(b._spinner._adjustPosition(),j){var l,m=a.clientWidth,n=a.clientHeight,o=0;for(var p in xeogl.scenes)xeogl.scenes.hasOwnProperty(p)&&(l=xeogl.scenes[p],o+=l.canvas.canvas.clientWidth*l.canvas.canvas.clientHeight);xeogl.stats.memory.pixels=o,a.width=a.clientWidth,a.height=a.clientHeight;var q=b.boundary;q[0]=a.offsetLeft,q[1]=a.offsetTop,q[2]=m,q[3]=n,b.fire("boundary",q),e=m,f=n}i&&(c=window.innerWidth,d=window.innerHeight),k&&(g=a.offsetLeft,h=a.offsetTop)}}),this.canvas.oncontextmenu=function(a){a.preventDefault()},this._spinner=new xeogl.Spinner(this.scene,{canvas:this.canvas}),this.backgroundColor=a.backgroundColor,this.backgroundImage=a.backgroundImage},_createCanvas:function(){var a="xeogl-canvas-"+xeogl.math.createUUID(),b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d=c.style;d.height="100%",d.width="100%",d.padding="0",d.margin="0",d.background="rgba(0,0,0,0);",d.float="left",d.left="0",d.top="0",d.position="absolute",d.opacity="1.0",d["z-index"]="-10000",c.innerHTML+='',b.appendChild(c),this.canvas=document.getElementById(a)},_createBackground:function(){var a=document.createElement("div"),b=a.style;b.padding="0",b.margin="0",b.background=null,b.backgroundImage=null,b.float="left",b.left="0",b.top="0",b.width="100%",b.height="100%",b.position="absolute",b.opacity=1,b["z-index"]="-20000",this.canvas.parentElement.appendChild(a),this._backgroundElement=a},_createOverlay:function(){var a=document.createElement("div"),b=a.style;b.padding="0",b.margin="0",b.background="black",b.float="left",b.left="0",b.top="0",b.width="100%",b.height="100%",b.position="absolute",b.opacity=0,b["z-index"]="100000",this.canvas.parentElement.appendChild(a),this.overlay=a},_getElementXY:function(a){for(var b=0,c=0;a;)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{x:b,y:c}},_initWebGL:function(a){if(a.webgl2){try{this.gl=this.canvas.getContext("webgl2",this.contextAttr)}catch(c){}this.gl?this.webgl2=!0:this.warn("Failed to get a WebGL 2 context - defaulting to WebGL 1.")}if(!this.gl)for(var b=0;!this.gl&&b
',this._canvas.parentElement.appendChild(b),this._element=b,this._adjustPosition(),this.processes=0,this.textures=a.textures},_props:{textures:{set:function(a){a=!1!==a,this._textures=a,this.fire("textures",this._textures)},get:function(){return this._textures}},processes:{set:function(a){a=a||0,this._processes!==a&&(a<0||(this._processes=a,this._element.style.visibility=this._processes>0?"visible":"hidden",this.fire("processes",this._processes)))},get:function(){return this._processes}}},_adjustPosition:function(){if(this._canvas&&this._element){var a=this._canvas,b=this._element,c=b.style;c.left=a.offsetLeft+.5*a.clientWidth-.5*b.clientWidth+"px",c.top=a.offsetTop+.5*a.clientHeight-.5*b.clientHeight+"px"}},_injectSpinnerCSS:function(){if(!a){var b=document.createElement("style");b.innerHTML=this._spinnerCSS,document.body.appendChild(b),a=!0}},_spinnerCSS:".sk-fading-circle { margin: 100px auto; width: 100px; height:100px; position: relative; } .sk-fading-circle .sk-circle { width: 120%; height: 120%; position: absolute; left: 0; top: 0; } .sk-fading-circle .sk-circle:before { content: ''; display: block; margin: 0 auto; width: 15%; height: 15%; background-color: #ff8800; border-radius: 100%; -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; } .sk-fading-circle .sk-circle2 { -webkit-transform: rotate(30deg); -ms-transform: rotate(30deg); transform: rotate(30deg); } .sk-fading-circle .sk-circle3 { -webkit-transform: rotate(60deg); -ms-transform: rotate(60deg); transform: rotate(60deg); } .sk-fading-circle .sk-circle4 { -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .sk-fading-circle .sk-circle5 { -webkit-transform: rotate(120deg); -ms-transform: rotate(120deg); transform: rotate(120deg); } .sk-fading-circle .sk-circle6 { -webkit-transform: rotate(150deg); -ms-transform: rotate(150deg); transform: rotate(150deg); } .sk-fading-circle .sk-circle7 { -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .sk-fading-circle .sk-circle8 { -webkit-transform: rotate(210deg); -ms-transform: rotate(210deg); transform: rotate(210deg); } .sk-fading-circle .sk-circle9 { -webkit-transform: rotate(240deg); -ms-transform: rotate(240deg); transform: rotate(240deg); } .sk-fading-circle .sk-circle10 { -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .sk-fading-circle .sk-circle11 { -webkit-transform: rotate(300deg); -ms-transform: rotate(300deg); transform: rotate(300deg); } .sk-fading-circle .sk-circle12 { -webkit-transform: rotate(330deg); -ms-transform: rotate(330deg); transform: rotate(330deg); } .sk-fading-circle .sk-circle2:before { -webkit-animation-delay: -1.1s; animation-delay: -1.1s; } .sk-fading-circle .sk-circle3:before { -webkit-animation-delay: -1s; animation-delay: -1s; } .sk-fading-circle .sk-circle4:before { -webkit-animation-delay: -0.9s; animation-delay: -0.9s; } .sk-fading-circle .sk-circle5:before { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } .sk-fading-circle .sk-circle6:before { -webkit-animation-delay: -0.7s; animation-delay: -0.7s; } .sk-fading-circle .sk-circle7:before { -webkit-animation-delay: -0.6s; animation-delay: -0.6s; } .sk-fading-circle .sk-circle8:before { -webkit-animation-delay: -0.5s; animation-delay: -0.5s; } .sk-fading-circle .sk-circle9:before { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; } .sk-fading-circle .sk-circle10:before { -webkit-animation-delay: -0.3s; animation-delay: -0.3s; } .sk-fading-circle .sk-circle11:before { -webkit-animation-delay: -0.2s; animation-delay: -0.2s; } .sk-fading-circle .sk-circle12:before { -webkit-animation-delay: -0.1s; animation-delay: -0.1s; } @-webkit-keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } } @keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } }"})}(),function(){"use strict";xeogl.Clip=xeogl.Component.extend({type:"xeogl.Clip",_init:function(a){this._state={mode:"disabled",dir:[1,0,0],dist:1},this.mode=a.mode,this.dir=a.dir,this.dist=a.dist},_props:{mode:{set:function(a){this._state.mode=a||"disabled",this._renderer.imageDirty=!0,this.fire("mode",this._state.mode)},get:function(){return this._state.mode}},dir:{set:function(a){this._state.dir=a||xeogl.math.vec3([1,0,0]),this._renderer.imageDirty=!0,this.fire("dir",this._state.dir)},get:function(){return this._state.dir}},dist:{set:function(a){this._state.dist=void 0!==a?a:1,this._renderer.imageDirty=!0,this.fire("dist",this._state.dist)},get:function(){return this._state.dist}}},_getJSON:function(){return{mode:this._state.mode,dir:xeogl.math.vecToArray(this._state.dir),dist:this._state.dist}}})}(),function(){"use strict";xeogl.Clips=xeogl.Component.extend({type:"xeogl.Clips",_init:function(a){this._state=new xeogl.renderer.Clips({clips:[],hash:""}),this._dirty=!0,this._clips=[],this._dirtySubs=[],this._destroyedSubs=[],this.clips=a.clips},_props:{clips:{set:function(a){function b(){h.fire("dirty",!0)}function c(){for(var a=this.id,b=0,c=h._clips.length;bMath.abs(m)?m=0:l=0,0!==l&&d.view.rotateEyeY(l),0!==m&&d.view.rotateEyeX(m)}}}})}else this.scene.off(this._onTick);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.KeyboardPanCamera=xeogl.Component.extend({type:"xeogl.KeyboardPanCamera",_init:function(a){this._onTick=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c=this;this._onTick=this.scene.on("tick",function(a){var d=c._attached.camera;if(d&&b.mouseover){var e=a.deltaTime;if(!b.ctrlDown&&!b.altDown){var f=b.keyDown[b.KEY_W],g=b.keyDown[b.KEY_S],h=b.keyDown[b.KEY_A],i=b.keyDown[b.KEY_D],j=b.keyDown[b.KEY_Z],k=b.keyDown[b.KEY_X];if(f||g||h||i||k||j){var l=0,m=0,n=0,o=.01*c._sensitivity;g?m=e*o:f&&(m=-e*o),i?l=e*o:h&&(l=-e*o),k?n=e*o:j&&(n=-e*o),d.view.pan([l,m,n])}}}})}else this._onTick&&this.scene.off(this._onTick);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.KeyboardZoomCamera=xeogl.Component.extend({type:"xeogl.KeyboardZoomCamera",_init:function(a){this._onTick=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c=this;this._onTick=this.scene.on("tick",function(a){var d=c._attached.camera;if(d&&b.mouseover){var e=a.deltaTime;if(!b.ctrlDown&&!b.altDown){var f=b.keyDown[b.KEY_ADD],g=b.keyDown[b.KEY_SUBTRACT];if(f||g){var h=0,i=.01*c.sensitivity;g?h=e*i:f&&(h=-e*i),d.view.zoom(h)}}}})}else null!==this._onTick&&this.scene.off(this._onTick);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MouseRotateCamera=xeogl.Component.extend({type:"xeogl.MouseRotateCamera",_init:function(a){this._onTick=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},firstPerson:{set:function(a){a=!!a,this._firstPerson=a,this.fire("firstPerson",this._firstPerson)},get:function(){return this._firstPerson}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c,d,e,f=0,g=0,h=!1,i=!1;this._onMouseDown=b.on("mousedown",function(a){b.mouseover&&(f=0,g=0,i&&(!b.mouseDownLeft||b.mouseDownRight||b.keyDown[b.KEY_SHIFT]||b.mouseDownMiddle?h=!1:(h=!0,c=a[0],d=a[1])))},this),this._onMouseUp=b.on("mouseup",function(){h=!1,f=0,g=0}),this._onMouseEnter=b.on("mouseenter",function(){i=!0,f=0,g=0}),this._onMouseLeave=b.on("mouseleave",function(){i=!1,f=0,g=0}),this._onMouseMove=b.on("mousemove",function(a){if(i&&h){var b=(a[0]-c)*this._sensitivity,f=(a[1]-d)*this._sensitivity;c=a[0],d=a[1];var g=this._attached.camera;g&&i&&h&&(0!==b&&(e=-b*this._sensitivity,this._firstPerson?g.view.rotateLookY(e):g.view.rotateEyeY(e)),0!==f&&(e=f*this._sensitivity,this._firstPerson?g.view.rotateLookX(-e):g.view.rotateEyeX(e)))}},this)}else b.off(this._onTick),b.off(this._onMouseDown),b.off(this._onMouseUp),b.off(this._onMouseMove),b.off(this._onMouseEnter),b.off(this._onMouseLeave);this.fire("active",this._active=a)}}, -get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MousePanCamera=xeogl.Component.extend({type:"xeogl.MousePanCamera",_init:function(a){this._onTick=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a?.03*a:.03,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c,d,e=0,f=0,g=!1,h=this;this._onTick=this.scene.on("tick",function(){var a=h._attached.camera;a&&(0===e&&0===f||(a.view.pan([e,f,0]),e=0,f=0))}),this._onMouseDown=b.on("mousedown",function(a){b.mouseDownLeft&&b.mouseDownRight||b.mouseDownLeft&&b.keyDown[b.KEY_SHIFT]||b.mouseDownMiddle?(c=a[0],d=a[1],g=!0):g=!1}),this._onMouseUp=b.on("mouseup",function(){g=!1}),this._onMouseUp=b.on("mouseout",function(){g=!1}),this._onMouseMove=b.on("mousemove",function(a){g&&(e+=(a[0]-c)*h._sensitivity,f+=(a[1]-d)*h._sensitivity,c=a[0],d=a[1])})}else b.off(this._onTick),b.off(this._onMouseDown),b.off(this._onMouseUp),b.off(this._onMouseMove);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MousePickEntity=xeogl.Component.extend({type:"xeogl.MousePickEntity",_init:function(a){this.pickSurface=a.pickSurface,this.active=!1!==a.active},_props:{active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c,d,e=this,f=2,g=!1,h=!1;this._onMouseEnter=b.on("mouseenter",function(){g=!0}),this._onMouseLeave=b.on("mouseleave",function(){g=!1}),this._onMouseDown=b.on("mousedown",function(a){g&&(h=!0,c=a[0],d=a[1])}),this._onMouseUp=b.on("mouseup",function(a){if(h&&g){if(c>=a[0]-f&&c<=a[0]+f&&d>=a[1]-f&&d<=a[1]+f){var b=e.scene.pick({canvasPos:a,pickSurface:e._pickSurface});b?e.fire("pick",b):e.fire("nopick",{canvasPos:a})}h=!1}})}else b.off(this._onMouseDown),b.off(this._onMouseUp);this.fire("active",this._active=a)}},get:function(){return this._active}},pickSurface:{set:function(a){a=!!a,this._pickSurface!==a&&(this._dirty=!1,this.fire("pickSurface",this._pickSurface=a))},get:function(){return this._pickSurface}}},_getJSON:function(){return{pickSurface:this._pickSurface,active:this._active}},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MouseZoomCamera=xeogl.Component.extend({type:"xeogl.MouseZoomCamera",_init:function(a){this._onTick=null,this._onMouseWheel=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){if(a){var b=0,c=0,d=!1,e=!1,f=0,g=xeogl.math.vec3(),h=xeogl.math.vec3(),i=xeogl.math.vec3(),j=this;this._onMouseWheel=this.scene.input.on("mousewheel",function(a){b=a,0===b?(e=!1,d=!1):d=!0}),this._onTick=this.scene.on("tick",function(){var a=j._attached.camera;if(a){var k=a.view.eye,l=a.view.look;g[0]=k[0],g[1]=k[1],g[2]=k[2],h[0]=l[0],h[1]=l[1],h[2]=l[2],xeogl.math.subVec3(g,h,i);var m=Math.abs(xeogl.math.lenVec3(i)),n=1e3,o=j._sensitivity*(2+m/n);d&&(c=b*o,f=0,d=!1,e=!0),e&&(b>0?(f+=.2*o)>c&&(e=!1):b<0&&(f-=.2*o)1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},radius:{set:function(a){a=a||1,this._radius!==a&&(a<0&&(this.warn("negative radius not allowed - will invert"),a*=-1),this._radius=a,this._needUpdate(),this.fire("radius",this._radius))},get:function(){return this._radius}},tube:{set:function(a){a=a||.3,this._tube!==a&&(a<0&&(this.warn("negative tube not allowed - will invert"),a*=-1),this._tube=a,this._needUpdate(),this.fire("tube",this._tube))},get:function(){return this._tube}},radialSegments:{set:function(a){a=a||32,this._radialSegments!==a&&(a<0&&(this.warn("negative radialSegments not allowed - will invert"),a*=-1),this._radialSegments=a,this._needUpdate(),this.fire("radialSegments",this._radialSegments))},get:function(){return this._radialSegments}},tubeSegments:{set:function(a){a=a||24,this._tubeSegments!==a&&(a<0&&(this.warn("negative tubeSegments not allowed - will invert"),a*=-1),this._tubeSegments=a,this._needUpdate(),this.fire("tubeSegments",this._tubeSegments))},get:function(){return this._tubeSegments}},arc:{set:function(a){a=a||2*Math.PI,this._arc!==a&&(a<0&&(this.warn("negative arc not allowed - will invert"),a*=-1),this._arc=a,this._needUpdate(),this.fire("arc",this._arc))},get:function(){return this._arc}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),radius:this._radius,tube:this._tube,radialSegments:this._radialSegments,tubeSegments:this._tubeSegments,arc:this._arc}}})}(),function(){"use strict";xeogl.SphereGeometry=xeogl.Geometry.extend({type:"xeogl.SphereGeometry",_init:function(a){this._super(a),this.lod=a.lod,this.center=a.center,this.radius=a.radius,this.heightSegments=a.heightSegments,this.widthSegments=a.widthSegments},_update:function(){var a=this._radius,b=Math.floor(this._lod*this._heightSegments),c=Math.floor(this._lod*this._widthSegments);b<18&&(b=18),c<18&&(c=18);var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s=[],t=[],u=[],v=[],w=this._center[0],x=this._center[1],y=this._center[2];for(d=0;d<=b;d++)for(f=d*Math.PI/b,g=Math.sin(f),h=Math.cos(f),e=0;e<=c;e++)i=2*e*Math.PI/c,j=Math.sin(i),k=Math.cos(i),l=k*g,m=h,n=j*g,o=1-e/c,p=d/b,t.push(l),t.push(m),t.push(n),u.push(o),u.push(p),s.push(w+a*l),s.push(x+a*m),s.push(y+a*n);for(d=0;d1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},radius:{set:function(a){a=a||1,this._radius!==a&&(a<0&&(this.warn("negative radius not allowed - will invert"),a*=-1),this._radius=a,this._needUpdate(),this.fire("radius",this._radius))},get:function(){return this._radius}},heightSegments:{set:function(a){a=a||18,this._heightSegments!==a&&(a<0&&(this.warn("negative heightSegments not allowed - will invert"),a*=-1),this._heightSegments=a,this._needUpdate(),this.fire("heightSegments",this._heightSegments))},get:function(){return this._heightSegments}},widthSegments:{set:function(a){a=a||24,this._widthSegments!==a&&(a<0&&(this.warn("negative widthSegments not allowed - will invert"),a*=-1),this._widthSegments=a,this._needUpdate(),this.fire("widthSegments",this._widthSegments))},get:function(){return this._widthSegments}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),radius:this._radius,heightSegments:this._heightSegments,widthSegments:this._widthSegments}}})}(),function(){"use strict";xeogl.BoundingSphereGeometry=xeogl.SphereGeometry.extend({type:"xeogl.BoundingSphereGeometry",_init:function(a){this._super(a),a.boundary?this.boundary=a.boundary:a.sphere&&(this.sphere=a.sphere)},_props:{boundary:{set:function(a){var b=!1,c=this;this._attach({name:"boundary",type:"xeogl.Boundary3D",component:a,sceneDefault:!1,on:{updated:function(){b||(b=!0,xeogl.scheduleTask(function(){c._setFromSphere(c._attached.boundary.sphere),b=!1}))}},onAttached:function(){c._setFromSphere(c._attached.boundary.sphere)}})},get:function(){return this._attached.boundary}},sphere:{set:function(a){a&&(this._attached.boundary&&(this.boundary=null),this._setFromSphere(a))}}},_setFromSphere:function(){var a=xeogl.math.vec3();return function(b){a[0]=b[0],a[1]=b[1],a[2]=b[2],this.center=a,this.radius=b[4]}}()})}(),function(){"use strict";xeogl.OBBGeometry=xeogl.Geometry.extend({type:"xeogl.OBBGeometry",_init:function(a){this._super(a),this.primitive=a.primitive||"lines",this.indices=[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7],a.boundary?this.boundary=a.boundary:a.obb?this.obb=a.obb:a.positions?this.positions=a.positions:this.positions=[1,1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1]},_props:{boundary:{set:function(a){var b=!1,c=this;this._attach({name:"boundary",type:"xeogl.Boundary3D",component:a,sceneDefault:!1,on:{updated:function(){b||(b=!0,xeogl.scheduleTask(function(){c._setPositionsFromOBB(c._attached.boundary.obb),b=!1}))}},onAttached:function(){c._setPositionsFromOBB(c._attached.boundary.obb)}})},get:function(){return this._attached.boundary}},obb:{set:function(a){a&&(this._attached.boundary&&(this.boundary=null),this._setPositionsFromOBB(a))}}},_setPositionsFromOBB:function(a){this.positions=[a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10],a[12],a[13],a[14],a[16],a[17],a[18],a[20],a[21],a[22],a[24],a[25],a[26],a[28],a[29],a[30]]},_getJSON:function(){var a={};return this._attached.boundary?a.boundary=this._attached.boundary.id:this.positions&&(a.positions=xeogl.math.vecToArray(this.positions)),a}})}(),function(){"use strict";xeogl.AABBGeometry=xeogl.Geometry.extend({type:"xeogl.AABBGeometry",_init:function(a){this._super(a),this.primitive=a.primitive||"lines", -this.indices=[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7],a.boundary?this.boundary=a.boundary:a.aabb?this.aabb=a.aabb:a.positions?this.positions=a.positions:this.positions=[1,1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1]},_props:{boundary:{set:function(a){var b=!1,c=this;this._attach({name:"boundary",type:"xeogl.Boundary3D",component:a,sceneDefault:!1,on:{updated:function(){b||(b=!0,xeogl.scheduleTask(function(){c._setPositionsFromAABB(c._attached.boundary.aabb),b=!1}))}},onAttached:function(){c._setPositionsFromAABB(c._attached.boundary.aabb)}})},get:function(){return this._attached.boundary}},aabb:{set:function(a){a&&(this._attached.boundary&&(this.boundary=null),this._setPositionsFromAABB(a))}}},_setPositionsFromAABB:function(a){this.positions=[a[3],a[4],a[5],a[3],a[1],a[5],a[0],a[1],a[5],a[0],a[4],a[5],a[3],a[4],a[2],a[3],a[1],a[2],a[0],a[1],a[2],a[0],a[4],a[2]]},_getJSON:function(){var a={};return this._attached.boundary?a.boundary=this._attached.boundary.id:this.positions&&(a.positions=xeogl.math.vecToArray(this.positions)),a}})}(),xeogl.PathGeometry=xeogl.Geometry.extend({type:"xeogl.PathGeometry",_init:function(a){this._super(a),this.path=a.path,this.divisions=a.divisions},_update:function(){var a=this._attached.path;if(a){var b,c,d,e=a.getPoints(this._divisions),f=[];for(b=0,c=e.length;b0){for(r=A.length/3,B.push(0),B.push(1),B.push(0),C.push(.5),C.push(.5),A.push(0+a),A.push(v+b),A.push(0+c),j=0;j<=g;j++)k=Math.sin(j*x),l=Math.cos(j*x),s=.5*Math.sin(j*x)+.5,t=.5*Math.cos(j*x)+.5,B.push(d*k),B.push(1),B.push(d*l),C.push(s),C.push(t),A.push(d*k+a),A.push(v+b),A.push(d*l+c);for(j=0;j0){for(r=A.length/3,B.push(0),B.push(-1),B.push(0),C.push(.5),C.push(.5),A.push(0+a),A.push(0-v+b),A.push(0+c),j=0;j<=g;j++)k=Math.sin(j*x),l=Math.cos(j*x),s=.5*Math.sin(j*x)+.5,t=.5*Math.cos(j*x)+.5,B.push(e*k),B.push(-1),B.push(e*l),C.push(s),C.push(t),A.push(e*k+a),A.push(0-v+b),A.push(e*l+c);for(j=0;j1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},radiusTop:{set:function(a){a=void 0!==a?a:1,this._radiusTop!==a&&(a<0&&(this.warn("negative radiusTop not allowed - will invert"),a*=-1),this._radiusTop=a,this._needUpdate(),this.fire("radiusTop",this._radiusTop))},get:function(){return this._radiusTop}},radiusBottom:{set:function(a){a=void 0!==a?a:1,this._radiusBottom!==a&&(a<0&&(this.warn("negative radiusBottom not allowed - will invert"),a*=-1),this._radiusBottom=a,this._needUpdate(),this.fire("radiusBottom",this._radiusBottom))},get:function(){return this._radiusBottom}},height:{set:function(a){a=a||1,this._height!==a&&(a<0&&(this.warn("negative height not allowed - will invert"),a*=-1),this._height=a,this._needUpdate(),this.fire("height",this._height))},get:function(){return this._height}},radialSegments:{set:function(a){a=a||60,this._radialSegments!==a&&(a<0&&(this.warn("negative radialSegments not allowed - will invert"),a*=-1),this._radialSegments=a,this._needUpdate(),this.fire("radialSegments",this._radialSegments))},get:function(){return this._radialSegments}},heightSegments:{set:function(a){a=a||1,this._heightSegments!==a&&(a<0&&(this.warn("negative heightSegments not allowed - will invert"),a*=-1),this._heightSegments=a,this._needUpdate(),this.fire("heightSegments",this._heightSegments))},get:function(){return this._heightSegments}},openEnded:{set:function(a){a=void 0!==a&&a,this._openEnded!==a&&(this._openEnded=a,this._needUpdate(),this.fire("openEnded",this._openEnded))},get:function(){return this._openEnded}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),radiusTop:this._radiusTop,radiusBottom:this._radiusBottom,height:this._height,radialSegments:this._radialSegments,heightSegments:this._heightSegments,openEnded:this._openEnded}}})}(),function(){"use strict";xeogl.PlaneGeometry=xeogl.Geometry.extend({type:"xeogl.PlaneGeometry",_init:function(a){this._super(a),this.center=a.center,this.xSize=a.xSize,this.zSize=a.zSize,this.xSegments=a.xSegments,this.zSegments=a.zSegments,this.lod=a.lod,this.autoNormals=!1!==a.autoNormals},_update:function(){var a=this._center[0],b=this._center[1],c=this._center[2],d=this._xSize,e=this._zSize,f=Math.floor(this._lod*this._xSegments),g=Math.floor(this._lod*this._zSegments);g<1&&(g=1),g<1&&(g=1);var h,i,j,k,l,m,n,o=d/2,p=e/2,q=Math.floor(f)||1,r=Math.floor(g)||1,s=q+1,t=r+1,u=d/q,v=e/r,w=new Float32Array(s*t*3),x=new Float32Array(s*t*3),y=new Float32Array(s*t*2),z=0,A=0;for(h=0;h65535?Uint32Arraz:Uint16Array)(q*r*6);for(h=0;h1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},xSize:{set:function(a){a=a||1,this._xSize!==a&&(a<0&&(this.warn("negative xSize not allowed - will invert"),a*=-1),this._xSize=a,this._needUpdate(),this.fire("xSize",this._xSize))},get:function(){return this._xSize}},zSize:{set:function(a){a=a||1,this._zSize!==a&&(a<0&&(this.warn("negative zSize not allowed - will invert"),a*=-1),this._zSize=a,this._needUpdate(),this.fire("zSize",this._zSize))},get:function(){return this._zSize}},xSegments:{set:function(a){a=a||1,this._xSegments!==a&&(a<0&&(this.warn("negative xSegments not allowed - will invert"),a*=-1),this._xSegments=a,this._needUpdate(),this.fire("xSegments",this._xSegments))},get:function(){return this._xSegments}},zSegments:{set:function(a){a=a||1,this._zSegments!==a&&(a<0&&(this.warn("negative zSegments not allowed - will invert"),a*=-1),this._zSegments=a,this._needUpdate(),this.fire("zSegments",this._zSegments))},get:function(){return this._zSegments}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),xSize:this._xSize,zSize:this._zSize,xSegments:this._xSegments,zSegments:this._zSegments}}})}(),function(){"use strict";xeogl.LatheGeometry=xeogl.Geometry.extend({type:"xeogl.LatheGeometry",_init:function(a){this._super(a),this.points=a.points,this.segments=a.segments,this.phiStart=a.phiStart,this.phiLength=a.phiLength,this.lod=a.lod,this.autoNormals=!1!==a.autoNormals},_update:function(){var a=[],b=[],c=Math.floor(this._lod*this._segments);c<4&&(c=4);for(var d=this._phiStart*xeogl.math.DEGTORAD,e=this._phiLength*xeogl.math.DEGTORAD,f=this._points,g=(f.length,1/c),h=0,i=c;h<=i;h++)for(var j=d+h*g*e,k=Math.cos(j),l=Math.sin(j),m=0,n=f.length;m1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},phiStart:{set:function(a){a=a||0,this._phiStart!==a&&(a<0&&(this.warn("negative phiStart not allowed - will invert"),a*=-1),this._phiStart=a,this._needUpdate(),this.fire("phiStart",this._phiStart))},get:function(){return this._phiStart}},phiLength:{set:function(a){a=a||1,this._phiLength!==a&&(a<0&&(this.warn("negative phiLength not allowed - will invert"),a*=-1),this._phiLength=a,this._needUpdate(),this.fire("phiLength",this._phiLength))},get:function(){return this._phiLength}},segments:{set:function(a){a=Math.floor(a||4),this._segments!==a&&(a<0&&(this.warn("negative segments not allowed - will invert"),a*=-1),this._segments=a,this._needUpdate(),this.fire("segments",this._segments))},get:function(){return this._segments}}},_getJSON:function(){return{points:this._points,phiStart:this._phiStart,phiLength:this._phiLength,segments:this._segments}}})}(),function(){"use strict";xeogl.Input=xeogl.Component.extend({type:"xeogl.Input",serializable:!1,_init:function(a){var b=this;this.altDown=!1,this.ctrlDown=!1,this.mouseDownLeft=!1,this.mouseDownMiddle=!1,this.mouseDownRight=!1,this.keyDown=[],this.enabled=!0,this.mouseover=!1,document.addEventListener("keydown",this._keyDownListener=function(a){b.enabled&&("INPUT"!==a.target.tagName&&"TEXTAREA"!==a.target.tagName&&(a.ctrlKey?b.ctrlDown=!0:a.altKey?b.altDown=!0:(b.keyDown[a.keyCode]=!0,b.fire("keydown",a.keyCode,!0))),b.mouseover&&a.preventDefault())},!0),document.addEventListener("keyup",this._keyUpListener=function(a){b.enabled&&"INPUT"!==a.target.tagName&&"TEXTAREA"!==a.target.tagName&&(a.ctrlKey?b.ctrlDown=!1:a.altKey?b.altDown=!1:(b.keyDown[a.keyCode]=!1,b.fire("keyup",a.keyCode,!0)))}),a.element.addEventListener("mouseenter",this._mouseEnterListener=function(a){if(b.enabled){b.mouseover=!0;var c=b._getClickCoordsWithinElement(a);b.fire("mouseenter",c,!0)}}),a.element.addEventListener("mouseleave",this._mouseLeaveListener=function(a){if(b.enabled){b.mouseover=!1;var c=b._getClickCoordsWithinElement(a);b.fire("mouseleave",c,!0)}}),a.element.addEventListener("mousedown",this._mouseDownListener=function(c){if(b.enabled){switch(c.which){case 1:b.mouseDownLeft=!0;break;case 2:b.mouseDownMiddle=!0;break;case 3:b.mouseDownRight=!0}var d=b._getClickCoordsWithinElement(c);a.element.focus(),b.fire("mousedown",d,!0),b.mouseover&&c.preventDefault()}}),document.addEventListener("mouseup",this._mouseUpListener=function(a){if(b.enabled){switch(a.which){case 1:b.mouseDownLeft=!1;break;case 2:b.mouseDownMiddle=!1;break;case 3:b.mouseDownRight=!1}var c=b._getClickCoordsWithinElement(a);b.fire("mouseup",c,!0),b.mouseover&&a.preventDefault()}},!0),document.addEventListener("dblclick",this._dblClickListener=function(a){if(b.enabled){switch(a.which){case 1:b.mouseDownLeft=!1,b.mouseDownRight=!1;break;case 2:b.mouseDownMiddle=!1;break;case 3:b.mouseDownLeft=!1,b.mouseDownRight=!1}var c=b._getClickCoordsWithinElement(a);b.fire("dblclick",c,!0),b.mouseover&&a.preventDefault()}}),a.element.addEventListener("mousemove",this._mouseMoveListener=function(a){if(b.enabled){var c=b._getClickCoordsWithinElement(a);b.fire("mousemove",c,!0),b.mouseover&&a.preventDefault()}}),a.element.addEventListener("wheel",this._mouseWheelListener=function(a,c){if(b.enabled){var d=Math.max(-1,Math.min(1,40*-a.deltaY));b.fire("mousewheel",d,!0),b.mouseover&&a.preventDefault()}}),function(){var a,c,d=2;b.on("mousedown",function(b){a=b[0],c=b[1]}),b.on("mouseup",function(e){a>=e[0]-d&&a<=e[0]+d&&c>=e[1]-d&&c<=e[1]+d&&b.fire("mouseclicked",e,!0)})}(),function(){var a,c,d={"landscape-primary":90,"landscape-secondary":-90,"portrait-secondary":180,"portrait-primary":0},e=xeogl.math.vec3(),f=xeogl.math.vec3(),g={orientation:null,orientationAngle:0},h={orientationAngle:0,acceleration:null,accelerationIncludingGravity:f,rotationRate:xeogl.math.vec3(),interval:0},i={alpha:0,beta:0,gamma:0,absolute:!1};window.OrientationChangeEvent&&window.addEventListener("orientationchange",b._orientationchangedListener=function(){a=window.screen.orientation||window.screen.mozOrientation||window.msOrientation||null,c=a?d[a]||0:0,g.orientation=a,g.orientationAngle=c,b.fire("orientationchange",g)},!1),window.DeviceMotionEvent&&window.addEventListener("devicemotion",b._deviceMotionListener=function(a){h.interval=a.interval,h.orientationAngle=c;var d=a.acceleration;d?(e[0]=d.x,e[1]=d.y,e[2]=d.z,h.acceleration=e):h.acceleration=null;var g=a.accelerationIncludingGravity;g?(f[0]=g.x,f[1]=g.y,f[2]=g.z,h.accelerationIncludingGravity=f):h.accelerationIncludingGravity=null,h.rotationRate=a.rotationRate,b.fire("devicemotion",h)},!1),window.DeviceOrientationEvent&&window.addEventListener("deviceorientation",b._deviceOrientListener=function(a){i.gamma=a.gamma,i.beta=a.beta,i.alpha=a.alpha,i.absolute=a.absolute,b.fire("deviceorientation",i)},!1)}()},_getClickCoordsWithinElement:function(a){var b=[0,0];if(a){for(var c=a.target,d=0,e=0;c.offsetParent;)d+=c.offsetLeft,e+=c.offsetTop,c=c.offsetParent;b[0]=a.pageX-d,b[1]=a.pageY-e}else a=window.event,b.x=a.x,b.y=a.y;return b},setEnabled:function(a){this.enabled!==a&&this.fire("enabled",this.enabled=a)},KEY_BACKSPACE:8,KEY_TAB:9,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE_BREAK:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_NUM_0:48,KEY_NUM_1:49,KEY_NUM_2:50,KEY_NUM_3:51,KEY_NUM_4:52,KEY_NUM_5:53,KEY_NUM_6:54,KEY_NUM_7:55,KEY_NUM_8:56,KEY_NUM_9:57,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74,KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT_KEY:93,KEY_NUMPAD_0:96,KEY_NUMPAD_1:97,KEY_NUMPAD_2:98,KEY_NUMPAD_3:99,KEY_NUMPAD_4:100,KEY_NUMPAD_5:101,KEY_NUMPAD_6:102,KEY_NUMPAD_7:103,KEY_NUMPAD_8:104,KEY_NUMPAD_9:105,KEY_MULTIPLY:106,KEY_ADD:107,KEY_SUBTRACT:109,KEY_DECIMAL_POINT:110,KEY_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145,KEY_SEMI_COLON:186,KEY_EQUAL_SIGN:187,KEY_COMMA:188,KEY_DASH:189,KEY_PERIOD:190,KEY_FORWARD_SLASH:191,KEY_GRAVE_ACCENT:192,KEY_OPEN_BRACKET:219,KEY_BACK_SLASH:220,KEY_CLOSE_BRACKET:221,KEY_SINGLE_QUOTE:222,KEY_SPACE:32,_destroy:function(){document.removeEventListener("keydown",this._keyDownListener),document.removeEventListener("keyup",this._keyUpListener)}})}(),function(){"use strict";xeogl.Lights=xeogl.Component.extend({type:"xeogl.Lights",_init:function(a){this._state=new xeogl.renderer.Lights({lights:[],hash:""}),this._lights=[],this._dirtySubs=[],this._destroyedSubs=[],a.lights&&(this.lights=a.lights),a.lightMap&&(this.lightMap=a.lightMap),a.reflectionMap&&(this.reflectionMap=a.reflectionMap)},_props:{lights:{set:function(a){function b(){g.fire("dirty",!0)}function c(){for(var a=this.id,b=0,c=g._lights.length;b0;)e.pop().destroy()},removeAll:function(){this.iterate(function(a){a.destroy()})},_remove:function(a){var b=a.id;if(a.scene!==this.scene)return void this.warn("Attempted to remove component that's not in same xeogl.Scene: '"+b+"'");delete this.components[b],delete this.entities[b],a.off(this._onDestroyed[b]),delete this._onDestroyed[b];var c=this.types[a.type];c&&delete c[a.id],this.numComponents--,a.worldBoundary&&(a.worldBoundary.off(this._onWorldBoundaryUpdated[a.id]),delete this._onWorldBoundaryUpdated[a.id]),this._aabbDirty||this._setAABBDirty(),this.fire("removed",a),this._dirty||this._needUpdate()},iterate:function(a,b){b=b||this;var c=this.components;for(var d in c)c.hasOwnProperty(d)&&a.call(b,c[d])},_props:{transform:{set:function(a){this._attach({name:"transform",type:"xeogl.Transform",component:a,sceneDefault:!1,onAttached:{callback:this._transformUpdated,scope:this}})},get:function(){return this._attached.transform}},worldBoundary:{get:function(){if(!this._worldBoundary){var a=this;this._worldBoundary=this.create({type:"xeogl.Boundary3D",getDirty:function(){return!(!a._aabbDirty&&a._aabb)&&(a._buildAABB(),a._aabbDirty=!1,!0)},getAABB:function(){return a._aabb}}),this._worldBoundary.on("destroyed",function(){a._worldBoundary=null})}return this._worldBoundary}}},_transformUpdated:function(a){this._dummyRootTransform.parent=a},_updated:function(){this._aabbDirty||this._setAABBDirty()},_setAABBDirty:function(){this._aabbDirty=!0,this._worldBoundary&&this._worldBoundary.fire("updated",!0)},_buildAABB:function(){this._aabb||(this._aabb=xeogl.math.AABB3());var a,b,c,d=1e5,e=1e5,f=1e5,g=-1e5,h=-1e5,i=-1e5,j=this.components;for(var k in j)j.hasOwnProperty(k)&&(a=j[k],(b=a.worldBoundary)&&(c=b.aabb,c[0]g&&(g=c[3]),c[4]>h&&(h=c[4]),c[5]>i&&(i=c[5])));this._aabb[0]=d,this._aabb[1]=e,this._aabb[2]=f,this._aabb[3]=g,this._aabb[4]=h,this._aabb[5]=i},_destroy:function(){this.removeAll()}})}(),function(){"use strict";var a=["extensions","buffers","bufferViews","images","videos","samplers","textures","shaders","programs","techniques","materials","accessors","meshes","cameras","lights","skins","nodes","scenes","animations"];xeogl.glTFParser=Object.create(Object.prototype,{_rootDescription:{value:null,writable:!0},rootDescription:{set:function(a){this._rootDescription=a},get:function(){return this._rootDescription}},baseURL:{value:null,writable:!0},_isAbsolutePath:{value:function(a){var b=new RegExp("^"+window.location.protocol,"i");return!!a.match(b)}},resolvePathIfNeeded:{value:function(a){return this._isAbsolutePath(a)?a:/^data:/.test(a)?a:this.baseURL+a}},_resolvePathsForCategories:{value:function(a){a.forEach(function(a){var b=this.json[a];if(b){Object.keys(b).forEach(function(a){var c=b[a];c.uri=this.resolvePathIfNeeded(c.uri)},this)}},this)}},_json:{value:null,writable:!0},json:{enumerable:!0,get:function(){return this._json},set:function(a){this._json=a,this._resolvePathsForCategories(["buffers","shaders","images","videos"])}},_path:{value:null,writable:!0},getEntryDescription:{value:function(a,b){var c=null,d=b;return c=this.rootDescription[d],c?c?c[a]:null:(console.log("ERROR:CANNOT find expected category named:"+d),null)}},_stepToNextCategory:{value:function(){return this._state.categoryIndex=this.getNextCategoryIndex(this._state.categoryIndex+1),-1!==this._state.categoryIndex&&(this._state.categoryState.index=0,!0)}},_stepToNextDescription:{enumerable:!1,value:function(){var a=this._state.categoryState,b=a.keys;return b?(a.index++,a.keys=null,a.index>=b.length&&this._stepToNextCategory()):(console.log("INCONSISTENCY ERROR"),!1)}},hasCategory:{value:function(a){return!!this.rootDescription[a]}},_handleState:{value:function(){for(var b={buffers:this.handleBuffer,bufferViews:this.handleBufferView,shaders:this.handleShader,programs:this.handleProgram,techniques:this.handleTechnique,materials:this.handleMaterial,meshes:this.handleMesh,cameras:this.handleCamera,lights:this.handleLight,nodes:this.handleNode,scenes:this.handleScene,images:this.handleImage,animations:this.handleAnimation,accessors:this.handleAccessor,skins:this.handleSkin,samplers:this.handleSampler,textures:this.handleTexture,videos:this.handleVideo,extensions:this.handleExtension},c=!0;-1!==this._state.categoryIndex;){var d=a[this._state.categoryIndex],e=this._state.categoryState,f=e.keys;if(f||(e.keys=f=Object.keys(this.rootDescription[d]),!f||0!==f.length)){var g=d,h=f[e.index],i=this.getEntryDescription(h,g);if(i){if(b[g]&&!1===b[g].call(this,h,i,this._state.userInfo)){c=!1;break}this._stepToNextDescription()}else if(this.handleError){this.handleError("INCONSISTENCY ERROR: no description found for entry "+h),c=!1;break}}else this._stepToNextDescription()}this.handleLoadCompleted&&this.handleLoadCompleted(c)}},_loadJSON:{enumerable:!0,value:function(a){var b=this,c=this._path,d=c.lastIndexOf("/");this.baseURL=0!==d?c.substring(0,d+1):"";var e=new XMLHttpRequest;e.open("GET",c,!0),e.onreadystatechange=function(){4===e.readyState&&200===e.status&&(b.json=JSON.parse(e.responseText),a&&a(b.json))},e.send(null)}},_buildLoader:{value:function(a){var b=this;this._loadJSON(function(c){b.rootDescription=c,a&&a(this)})}},_state:{value:null,writable:!0},_getEntryType:{value:function(b){for(var c=a,d=0;di?(a=-j,b=j,c=j/k,d=-j/k):(a=-j*k,b=j*k,c=j,d=-j),this.matrix=xeogl.math.orthoMat4c(a,b,d,c,this._near,this._far,this.__tempMat||(this.__tempMat=xeogl.math.mat4()))},_props:{scale:{set:function(a){this._scale=void 0!==a&&null!==a?a:1,this._needUpdate(0),this.fire("scale",this._scale)},get:function(){return this._scale}},near:{set:function(a){this._near=void 0!==a&&null!==a?a:.1,this._needUpdate(),this.fire("near",this._near)},get:function(){return this._near}},far:{set:function(a){this._far=void 0!==a&&null!==a?a:1e4,this._needUpdate(),this.fire("far",this._far)},get:function(){return this._far}}},_getJSON:function(){var a={scale:this._scale,near:this._near,far:this._far};return this._parent&&(a.parent=this._parent.id),a},_destroy:function(){this._super(),this.scene.canvas.off(this._onCanvasBoundary)}})}(),function(){"use strict";xeogl.Perspective=xeogl.Transform.extend({type:"xeogl.Perspective",_init:function(a){this._super(a),this._dirty=!1,this._fovy=60,this._near=.1,this._far=1e4,this._canvasResized=this.scene.canvas.on("boundary",this._needUpdate,this),this.fovy=a.fovy,this.near=a.near,this.far=a.far},_update:function(){var a=this.scene.canvas.canvas,b=a.clientWidth/a.clientHeight;this.matrix=xeogl.math.perspectiveMat4(this._fovy*(Math.PI/180),b,this._near,this._far,this._matrix)},_props:{fovy:{set:function(a){this._fovy=void 0!==a&&null!==a?a:60,this._renderer.imageDirty=!0,this._needUpdate(0),this.fire("fovy",this._fovy)},get:function(){return this._fovy}},near:{set:function(a){this._near=void 0!==a&&null!==a?a:.1,this._renderer.imageDirty=!0,this._needUpdate(0),this.fire("near",this._near)},get:function(){return this._near}},far:{set:function(a){this._far=void 0!==a&&null!==a?a:1e4,this._renderer.imageDirty=!0,this._needUpdate(0),this.fire("far",this._far)},get:function(){return this._far}}},_getJSON:function(){var a={fovy:this._fovy,near:this._near,far:this._far};return this._parent&&(a.parent=this._parent.id),a},_destroy:function(){this._super(),this.scene.canvas.off(this._canvasResized)}})}(),xeogl.version="1.0.0"; \ No newline at end of file +h+=d[f+1],i+=d[f+2];e[0]=g/k,e[1]=h/k,e[2]=i/k;var l,m=0;for(f=0;fm&&(m=l);return e[3]=m,e}}(),a.getSphere3Center=function(b,c){return c=c||a.vec3(),c[0]=b[0],c[1]=b[1],c[2]=b[2],c},a.expandAABB3=function(a,b){return a[0]>b[0]&&(a[0]=b[0]),a[1]>b[1]&&(a[1]=b[1]),a[2]>b[2]&&(a[2]=b[2]),a[3]b[0]&&(a[3]=b[0]),a[4]>b[1]&&(a[4]=b[1]),a[5]>b[2]&&(a[5]=b[2]),a},a.collapseAABB2=function(b){return b=b||a.AABB2(),b[0]=1e7,b[1]=1e7,b[2]=-1e7,b[3]=-1e7,b},a.OBB3ToAABB2=function(b,c){c=c||a.AABB2();for(var d,e,f,g,h=1e7,i=1e7,j=-1e7,k=-1e7,l=0,m=b.length;lj&&(j=d),e>k&&(k=e);return c[0]=h,c[1]=i,c[2]=j,c[3]=k,c},a.expandAABB2=function(a,b){return a[0]>b[0]&&(a[0]=b[0]),a[1]>b[1]&&(a[1]=b[1]),a[2]b[0]&&(a[0]=b[0]),a[1]>b[1]&&(a[1]=b[1]),a[2]p)return null;var s=a.cross3Vec3(q,m,f),t=a.dotVec3(h,s);if(t<0||r+t>p)return null;var u=a.dotVec3(n,s)/p;return l[0]=g[0]+u*h[0],l[1]=g[1]+u*h[1],l[2]=g[2]+u*h[2],l}}(),a.rayPlaneIntersect=function(){var b=new Float32Array(3),c=new Float32Array(3),d=new Float32Array(3),e=new Float32Array(3);return function(f,g,h,i,j,k){k=k||a.vec3(),g=a.normalizeVec3(g,b);var l=a.subVec3(i,h,c),m=a.subVec3(j,h,d),n=a.cross3Vec3(l,m,e);a.normalizeVec3(n,n);var o=-a.dotVec3(h,n),p=-(a.dotVec3(f,n)+o)/a.dotVec3(g,n);return k[0]=f[0]+p*g[0],k[1]=f[1]+p*g[1],k[2]=f[2]+p*g[2],k}}(),a.cartesianToBarycentric=function(){var b=new Float32Array(3),c=new Float32Array(3),d=new Float32Array(3);return function(e,f,g,h,i){var j=a.subVec3(h,f,b),k=a.subVec3(g,f,c),l=a.subVec3(e,f,d),m=a.dotVec3(j,j),n=a.dotVec3(j,k),o=a.dotVec3(j,l),p=a.dotVec3(k,k),q=a.dotVec3(k,l),r=m*p-n*n;if(0===r)return null;var s=1/r,t=(p*o-n*q)*s,u=(m*q-n*o)*s;return i[0]=1-t-u,i[1]=u,i[2]=t,i}}(),a.barycentricInsideTriangle=function(a){var b=a[1],c=a[2];return c>=0&&b>=0&&c+b<1},a.barycentricToCartesian=function(b,c,d,e,f){f=f||a.vec3();var g=b[0],h=b[1],i=b[2];return f[0]=c[0]*g+d[0]*h+e[0]*i,f[1]=c[1]*g+d[1]*h+e[1]*i,f[2]=c[2]*g+d[2]*h+e[2]*i,f}}(),function(){"use strict";var a=xeogl.math;a.buildNormals=function(){var b=a.vec3(),c=a.vec3(),d=a.vec3(),e=a.vec3(),f=a.vec3(),g=a.vec3();return function(h,i,j){var k,l,m,n,o,p=new Array(h.length/3);for(k=0,l=i.length;k>24&255)/255,i=(n>>16&255)/255,h=(n>>8&255)/255,g=(255&n)/255,f=b[o],c=3*f,l[d]=a[c],l[d+1]=a[c+1],l[d+2]=a[c+2],m[e]=g,m[e+1]=h,m[e+2]=i,m[e+3]=j,f=b[o+1],c=3*f,l[d+3]=a[c],l[d+4]=a[c+1],l[d+5]=a[c+2],m[e+4]=g,m[e+5]=h,m[e+6]=i,m[e+7]=j,f=b[o+2],c=3*f,l[d+6]=a[c],l[d+7]=a[c+1],l[d+8]=a[c+2],m[e+8]=g,m[e+9]=h,m[e+10]=i,m[e+11]=j,n++;return{positions:l,colors:m}}}(),function(){"use strict";var a=xeogl.math;a.tangentQuadraticBezier=function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},a.tangentQuadraticBezier=function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},a.tangentSpline=function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},a.catmullRomInterpolate=function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e;return(2*b-2*c+f+g)*(e*h)+(-3*b+3*c-2*f-g)*h+f*e+b},a.b2p0=function(a,b){var c=1-a;return c*c*b},a.b2p1=function(a,b){return 2*(1-a)*a*b},a.b2p2=function(a,b){return a*a*b},a.b2=function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},a.b3p0=function(a,b){var c=1-a;return c*c*c*b},a.b3p1=function(a,b){var c=1-a;return 3*c*c*a*b},a.b3p2=function(a,b){return 3*(1-a)*a*a*b},a.b3p3=function(a,b){return a*a*a*b},a.b3=function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}}(),function(){"use strict";var a=xeogl.math;a.canvasPosToWorldRay=function(){var b=a.mat4(),c=a.mat4(),d=a.vec4(),e=a.vec4(),f=a.vec4(),g=a.vec4();return function(h,i,j,k){var l=h.scene.canvas.canvas,m=h.view.matrix,n=h.project.matrix,o=a.mulMat4(n,m,b),p=a.inverseMat4(o,c),q=l.width,r=l.height,s=(i[0]-q/2)/(q/2),t=-(i[1]-r/2)/(r/2);d[0]=s,d[1]=t,d[2]=-1,d[3]=1,a.transformVec4(p,d,e),a.mulVec4Scalar(e,1/e[3]),f[0]=s,f[1]=t,f[2]=1,f[3]=1,a.transformVec4(p,f,g),a.mulVec4Scalar(g,1/g[3]),j[0]=g[0],j[1]=g[1],j[2]=g[2],a.subVec3(g,e,k),a.normalizeVec3(k)}}(),a.canvasPosToLocalRay=function(){var b=a.vec3(),c=a.vec3();return function(d,e,f,g,h){a.canvasPosToWorldRay(d,f,b,c),a.worldRayToLocalRay(e,b,c,g,h)}}(),a.worldRayToLocalRay=function(){var b=a.mat4(),c=a.vec4(),d=a.vec4();return function(e,f,g,h,i){var j=e.transform.leafMatrix,k=a.inverseMat4(j,b);c[0]=f[0],c[1]=f[1],c[2]=f[2],c[3]=1,a.transformVec4(k,c,d),h[0]=d[0],h[1]=d[1],h[2]=d[2],a.transformVec3(k,g,i)}}()}(),function(){"use strict";xeogl.renderer=xeogl.renderer||{},xeogl.renderer.Renderer=function(a,b,c,d){d=d||{},this.stats=a||{},this.gl=c,this.canvas=b,this._programFactory=new xeogl.renderer.ProgramFactory(this.stats,c),this._objectFactory=new xeogl.renderer.ObjectFactory,this._chunkFactory=new xeogl.renderer.ChunkFactory,this._shadowLightObjects={},this.transparent=!0===d.transparent,this.bindOutputFramebuffer=null,this.unbindOutputFramebuffer=null,this.objects={},this._ambient=null,this.ambientColor=xeogl.math.vec4([0,0,0,1]),this._objectList=[],this._objectListLen=0,this._objectPickList=[],this._objectPickListLen=0,this._shadowObjectLists={},this._frameCtx={canvas:this.canvas,renderTarget:null,renderBuf:null,depthbufEnabled:null,clearDepth:null,depthFunc:null,blendEnabled:!1,backfaces:!0,frontface:!0,textureUnit:0,transparent:!1,ambientColor:null,drawElements:0,useProgram:0,bindTexture:0,bindArray:null,pass:null,bindOutputFramebuffer:null,pickIndex:0,shadowViewMatrix:null,shadowProjmatrix:null,pickViewMatrix:null,pickProjmatrix:null},this.visibility=null,this.cull=null,this.modes=null,this.layer=null,this.stage=null,this.depthBuf=null,this.colorBuf=null,this.lights=null,this.material=null,this.modelTransform=null,this.viewTransform=null,this.projTransform=null,this.billboard=null,this.stationary=null,this.colorTarget=null,this.depthTarget=null,this.clips=null,this.shader=null,this.shaderParams=null,this.geometry=null,this.viewport=null,this.outline=null,this.objectListDirty=!0,this.stateOrderDirty=!0,this.stateSortDirty=!0,this.imageDirty=!0},xeogl.renderer.Renderer.prototype.webglRestored=function(a){this.gl=a,this._programFactory.webglRestored(a),this._chunkFactory.webglRestored(),this.pickBuf&&this.pickBuf.webglRestored(a),this.imageDirty=!0},xeogl.renderer.Renderer.prototype.buildObject=function(a){var b=this.objects[a];b||(b=this._objectFactory.get(a),b.hash=""),b.stage=this.stage,b.layer=this.layer,b.colorTarget=this.colorTarget,b.depthTarget=this.depthTarget,b.material=this.material,b.geometry=this.geometry,b.visibility=this.visibility,b.cull=this.cull,b.modes=this.modes,b.billboard=this.billboard,b.stationary=this.stationary,b.viewport=this.viewport,b.lights=this.lights,b.outline=this.outline;var c=[this.geometry.hash,this.shader.hash,this.clips.hash,this.material.hash,this.lights.hash,this.modes.hash,this.billboard.hash,this.stationary.hash].join(";");if(c!==b.hash){b.program&&this._programFactory.put(b.program),b.program=this._programFactory.get(c,this),b.hash=c,!0;var d=b.program;if(d){var e=d.program;if(!(e.allocated&&e.compiled&&e.validated&&e.linked))return this.objects[a]&&this.removeObject(a),{error:!0,errorLog:e.errorLog}}}return this._setChunk(b,0,"program",b.program),this._setChunk(b,1,"modelTransform",this.modelTransform),this._setChunk(b,2,"viewTransform",this.viewTransform),this._setChunk(b,3,"projTransform",this.projTransform),this._setChunk(b,4,"modes",this.modes),this._setChunk(b,5,"shader",this.shader),this._setChunk(b,6,"shaderParams",this.shaderParams),this._setChunk(b,7,"depthBuf",this.depthBuf),this._setChunk(b,8,"colorBuf",this.colorBuf),this._setChunk(b,9,"lights",this.lights),this._setChunk(b,10,this.material.type,this.material),this._setChunk(b,11,"clips",this.clips),this._setChunk(b,12,"viewport",this.viewport),this._setChunk(b,13,"outline",this.outline),this._setChunk(b,14,"geometry",this.geometry),this._setChunk(b,15,"draw",this.geometry,!0),this._setAmbientAndSpotLights(this.lights),this.objects[a]?this.stateOrderDirty=!0:(this.objects[a]=b,this.objectListDirty=!0),b.compiled=!0,b},xeogl.renderer.Renderer.prototype._mapShadowLightObject=function(a,b){for(var c,d,e=0,f=a.length;e0){for(h.enable(h.STENCIL_TEST),h.stencilFunc(h.ALWAYS,1,1),h.stencilOp(h.KEEP,h.KEEP,h.REPLACE),h.stencilMask(1),h.clearStencil(0),h.clear(h.STENCIL_BUFFER_BIT),a(),m=0;m0){for(h.enable(h.CULL_FACE),h.enable(h.BLEND),h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA),q=0,a(),m=0;m=1?q-1:-1;var r=this._objectPickList[q];if(r&&(g={entity:r.id},f.pickSurface)){h.clear(),this._pickPrimitive(r,n,o),this.gl.finish(),p=h.read(i,j);var s=p[0]+256*p[1]+256*p[2]*256+256*p[3]*256*256;s*=3,g.primIndex=s,n&&(g.origin=k,g.direction=l)}return h.unbind(),g}}(),xeogl.renderer.Renderer.prototype._pickObject=function(a,b){var c=this.gl,d=this._frameCtx;d.depthbufEnabled=null,d.clearDepth=null,d.depthFunc=c.LESS,d.blendEnabled=!1,d.backfaces=!0,d.frontface=!0,d.textureUnit=0,d.drawElements=0,d.useProgram=0,d.bindTexture=0,d.bindArray=0,d.pickViewMatrix=a,d.pickProjMatrix=b,d.pickIndex=0,c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),c.clearColor(0,0,0,0),c.enable(c.DEPTH_TEST),c.frontFace(c.CCW),c.disable(c.CULL_FACE),c.disable(c.BLEND),c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT);var e,f,g,h,i,j,k=this._lastChunkId=this._lastChunkId||new Int32Array(30);for(e=0;e<20;e++)k[e]=-9999999999999;this._objectPickListLen=0;var l;for(e=0,f=this._objectListLen;ethis.length?(this.destroy(),this._allocate(a,a.length)):(this.gl.bindBuffer(this.type,this._handle),b||0===b?this.gl.bufferSubData(this.type,b*this.itemByteSize,a):this.gl.bufferData(this.type,a,this.usage),this.gl.bindBuffer(this.type,null)))},xeogl.renderer.webgl.ArrayBuffer.prototype.bind=function(){this.allocated&&this.gl.bindBuffer(this.type,this._handle)},xeogl.renderer.webgl.ArrayBuffer.prototype.unbind=function(){this.allocated&&this.gl.bindBuffer(this.type,null)},xeogl.renderer.webgl.ArrayBuffer.prototype.destroy=function(){this.allocated&&(this.gl.deleteBuffer(this._handle),this._handle=null,this.allocated=!1)}}(),function(){"use strict";xeogl.renderer.webgl.Attribute=function(a,b){this.gl=a,this.location=b},xeogl.renderer.webgl.Attribute.prototype.bindFloatArrayBuffer=function(a){a&&(a.bind(),this.gl.enableVertexAttribArray(this.location),this.gl.vertexAttribPointer(this.location,a.itemSize,this.gl.FLOAT,!1,0,0))},xeogl.renderer.webgl.Attribute.prototype.bindInterleavedFloatArrayBuffer=function(a,b,c){this.gl.enableVertexAttribArray(this.location),this.gl.vertexAttribPointer(this.location,a,this.gl.FLOAT,!1,b,c)}}(),function(){"use strict";function a(a){for(var b,c,d=[],e=0,f=a.length;e0&&"/"===b.charAt(c+1)&&(b=b.substring(0,c)),d.push(b);return d.join("\n")}xeogl.renderer.webgl.Program=function(b,c,d,e){if(this.stats=b,this.gl=c,this.allocated=!1,this.compiled=!1,this.linked=!1,this.validated=!1,this.errorLog=null,this.uniforms={},this.samplers={},this.attributes={},this._vertexShader=new xeogl.renderer.webgl.Shader(c,c.VERTEX_SHADER,a(d)),this._fragmentShader=new xeogl.renderer.webgl.Shader(c,c.FRAGMENT_SHADER,a(e)),!this._vertexShader.allocated)return void(this.errorLog=["Vertex shader failed to allocate"].concat(this._vertexShader.errorLog));if(!this._fragmentShader.allocated)return void(this.errorLog=["Fragment shader failed to allocate"].concat(this._fragmentShader.errorLog));if(this.allocated=!0,!this._vertexShader.compiled)return void(this.errorLog=["Vertex shader failed to compile"].concat(this._vertexShader.errorLog));if(!this._fragmentShader.compiled)return void(this.errorLog=["Fragment shader failed to compile"].concat(this._fragmentShader.errorLog));this.compiled=!0;var f,g,h,i,j;if(this.handle=c.createProgram(),!this.handle)return void(this.errorLog=["Failed to allocate program"]);if(c.attachShader(this.handle,this._vertexShader.handle),c.attachShader(this.handle,this._fragmentShader.handle),c.linkProgram(this.handle),this.linked=c.getProgramParameter(this.handle,c.LINK_STATUS),this.validated=!0,!this.linked||!this.validated)return this.errorLog=[],this.errorLog.push(""),this.errorLog.push(c.getProgramInfoLog(this.handle)),this.errorLog.push("\nVertex shader:\n"),this.errorLog=this.errorLog.concat(d),this.errorLog.push("\nFragment shader:\n"),void(this.errorLog=this.errorLog.concat(e));var k=c.getProgramParameter(this.handle,c.ACTIVE_UNIFORMS);for(g=0;gb){var d=b/c,e=a.width*d,f=a.height*d,g=document.createElement("canvas");g.width=xeogl.renderer.webgl.nextHighestPowerOfTwo(e),g.height=xeogl.renderer.webgl.nextHighestPowerOfTwo(f);g.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,g.width,g.height),a=g}return a},xeogl.renderer.webgl.ensureImageSizePowerOfTwo=function(a){if(!xeogl.renderer.webgl.isPowerOfTwo(a.width)||!xeogl.renderer.webgl.isPowerOfTwo(a.height)){var b=document.createElement("canvas");b.width=xeogl.renderer.webgl.nextHighestPowerOfTwo(a.width),b.height=xeogl.renderer.webgl.nextHighestPowerOfTwo(a.height);b.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,b.width,b.height),a=b}return a},xeogl.renderer.webgl.isPowerOfTwo=function(a){return 0==(a&a-1)},xeogl.renderer.webgl.nextHighestPowerOfTwo=function(a){--a;for(var b=1;b<32;b<<=1)a|=a>>b;return a+1}}(),function(){"use strict";xeogl.renderer.webgl.Uniform=function(a,b,c,d){var e=null,f=null;if(c===b.BOOL)e=function(a){f!==a&&(f=a,b.uniform1i(d,a))};else if(c===b.BOOL_VEC2)f=new Array(2),e=function(a){f[0]===a[0]&&f[1]===a[1]||(f[0]=a[0],f[1]=a[1],b.uniform2iv(d,a))};else if(c===b.BOOL_VEC3)f=new Array(3),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]||(f[0]=a[0],f[1]=a[1],f[2]=a[2],b.uniform3iv(d,a))};else if(c===b.BOOL_VEC4)f=new Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3],b.uniform4iv(d,a))};else if(c===b.INT)e=function(a){f!==a&&(f=a,b.uniform1iv(d,a))};else if(c===b.INT_VEC2)f=new Uint32Array(2),e=function(a){f[0]===a[0]&&f[1]===a[1]||(f.set(a),b.uniform2iv(d,a))};else if(c===b.INT_VEC3)f=new Uint32Array(3),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]||(f.set(a),b.uniform3iv(d,a))};else if(c===b.INT_VEC4)f=new Uint32Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f.set(a),b.uniform4iv(d,a))};else if(c===b.FLOAT)e=function(a){f!==a&&(f=a,b.uniform1f(d,a))};else if(c===b.FLOAT_VEC2)f=new Float32Array(2),e=function(a){f[0]===a[0]&&f[1]===a[1]||(f.set(a),b.uniform2fv(d,a))};else if(c===b.FLOAT_VEC3)f=new Float32Array(3),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]||(f.set(a),b.uniform3fv(d,a))};else if(c===b.FLOAT_VEC4)f=new Float32Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f.set(a),b.uniform4fv(d,a))};else if(c===b.FLOAT_MAT2)f=new Float32Array(4),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]||(f.set(a),b.uniformMatrix2fv(d,b.FALSE,a))};else if(c===b.FLOAT_MAT3)f=new Float32Array(9),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]&&f[4]===a[4]&&f[5]===a[5]&&f[6]===a[6]&&f[7]===a[7]&&f[8]===a[8]||(f.set(a),b.uniformMatrix3fv(d,b.FALSE,a))};else{if(c!==b.FLOAT_MAT4)throw"Unsupported shader uniform type: "+c;f=new Float32Array(16),e=function(a){f[0]===a[0]&&f[1]===a[1]&&f[2]===a[2]&&f[3]===a[3]&&f[4]===a[4]&&f[5]===a[5]&&f[6]===a[6]&&f[7]===a[7]&&f[8]===a[8]&&f[9]===a[9]&&f[10]===a[10]&&f[11]===a[11]&&f[12]===a[12]&&f[13]===a[13]&&f[14]===a[14]&&f[15]===a[15]||(f.set(a),b.uniformMatrix4fv(d,b.FALSE,a))}}this.setValue=e,this.getLocation=function(){return d}}}(),function(){"use strict";xeogl.renderer=xeogl.renderer||{},xeogl.renderer.State=Class.extend({__init:function(a){this.id=this._ids.addItem({}),this.hash=a.hash||""+this.id;for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b])},destroy:function(){this._ids.removeItem(this.id)}}),xeogl.renderer.Visibility=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Cull=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Modes=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Layer=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Stage=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.DepthBuf=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.ColorBuf=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Lights=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.PhongMaterial=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.SpecularMaterial=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.MetallicMaterial=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Transform=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Billboard=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Stationary=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.RenderTarget=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.RenderTarget.DEPTH=0,xeogl.renderer.RenderTarget.COLOR=1,xeogl.renderer.Clips=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.MorphTargets=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Shader=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.ShaderParams=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Texture=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.CubeTexture=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Fresnel=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Geometry=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.ProgramState=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Viewport=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})}),xeogl.renderer.Outline=xeogl.renderer.State.extend({_ids:new xeogl.utils.Map({})})}(),function(){"use strict";xeogl.renderer.Object=function(a){this.id=a,this.hash=null,this.sortKey=null,this.chunks=[],this.program=null,this.stage=null,this.modes=null,this.layer=null,this.material=null,this.compiled=!1}}(),function(){"use strict";xeogl.renderer.ObjectFactory=function(){var a=[],b=0;this.get=function(c){var d;return b>0?(d=a[--b],d.id=c,d.compiled=!1,d):new xeogl.renderer.Object(c)},this.put=function(c){a[b++]=c}}}(),function(){"use strict";xeogl.renderer=xeogl.renderer||{},xeogl.renderer.Program=function(a,b,c,d){this.stats=a,this.hash=c.hash,this.source=c,this.gl=d,this.draw=null,this.pickObject=null,this.pickPrimitive=null,this.outline=null,this.useCount=0,this.allocated=!1,this.compiled=!1,this.linked=!1,this.validated=!1,this.errorLog=null,this.build(d)},xeogl.renderer.Program.prototype.build=function(a){return this.gl=a,this.allocated=!1,this.compiled=!1,this.linked=!1,this.validated=!1,this.errorLog=null,this.draw=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexDraw,this.source.fragmentDraw),this.shadow=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexShadow,this.source.fragmentShadow),this.pickObject=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexPickObject,this.source.fragmentPickObject),this.pickPrimitive=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexPickPrimitive,this.source.fragmentPickPrimitive),this.outline=new xeogl.renderer.webgl.Program(this.stats,a,this.source.vertexOutline,this.source.fragmentOutline),this.draw.allocated?this.shadow.allocated?this.pickObject.allocated?this.pickPrimitive.allocated?this.outline.allocated?(this.allocated=!0,this.draw.compiled?this.shadow.compiled?this.pickObject.compiled?this.pickPrimitive.compiled?this.outline.compiled?(this.compiled=!0,this.draw.linked?this.shadow.linked?this.pickObject.linked?this.pickPrimitive.linked?this.outline.linked?(this.linked=!0,this.draw.validated?this.shadow.validated?this.pickObject.validated?this.pickPrimitive.validated?this.outline.validated?void(this.validated=!0):void(this.errorLog=["Outline effect program failed to validate"].concat(this.outline.errorLog)):void(this.errorLog=["Primitive-picking program failed to validate"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to validate"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to validate"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to validate"].concat(this.draw.errorLog))):void(this.errorLog=["Outline effect program failed to link"].concat(this.outline.errorLog)):void(this.errorLog=["Primitive-picking program failed to link"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to link"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to link"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to link"].concat(this.draw.errorLog))):void(this.errorLog=["Outline effect program failed to compile"].concat(this.outline.errorLog)):void(this.errorLog=["Primitive-picking program failed to compile"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to compile"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to compile"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to compile"].concat(this.draw.errorLog))):void(this.errorLog=["Outline effect program failed to allocate"].concat(this.outline.errorLog)):void(this.errorLog=["Primitive-picking program failed to allocate"].concat(this.pickPrimitive.errorLog)):void(this.errorLog=["Object-picking program failed to allocate"].concat(this.pickObject.errorLog)):void(this.errorLog=["Shadow program failed to allocate"].concat(this.shadow.errorLog)):void(this.errorLog=["Draw program failed to allocate"].concat(this.draw.errorLog))},xeogl.renderer.Program.prototype.destroy=function(){this.draw&&this.draw.destroy(),this.shadow&&this.shadow.destroy(),this.pickObject&&this.pickObject.destroy(),this.pickPrimitive&&this.pickPrimitive.destroy(),this.outline&&this.outline.destroy()}}(),function(){"use strict";xeogl.renderer.ProgramFactory=function(a,b){this.stats=a,this._gl=b,this._programStates={}},xeogl.renderer.ProgramFactory.prototype.get=function(a,b){var c=this._programStates[a];if(!c){var d=xeogl.renderer.ProgramSourceFactory.getSource(a,b),e=new xeogl.renderer.Program(this.stats,a,d,this._gl);c=new xeogl.renderer.ProgramState({program:e,useCount:0}),this._programStates[a]=c,this.stats.memory.programs++}return c.useCount++,c},xeogl.renderer.ProgramFactory.prototype.put=function(a){if(--a.useCount<=0){var b=a.program;xeogl.renderer.ProgramSourceFactory.putSource(b.hash),delete this._programStates[b.hash],b.destroy(),this.stats.memory.programs--}},xeogl.renderer.ProgramFactory.prototype.webglRestored=function(a){this._gl=a;for(var b in this._programStates)this._programStates.hasOwnProperty(b)&&this._programStates[b].build(a)},xeogl.renderer.ProgramFactory.prototype.destroy=function(){}}(),function(){"use strict";xeogl.renderer.ProgramSource=function(a,b,c,d,e,f,g,h,i,j,k){this.hash=a,this.vertexPickObject=b,this.fragmentPickObject=c,this.vertexPickPrimitive=d,this.fragmentPickPrimitive=e,this.vertexDraw=f,this.fragmentDraw=g,this.vertexShadow=h,this.fragmentShadow=i,this.vertexOutline=j,this.fragmentOutline=k,this.useCount=0}}(),function(){"use strict";xeogl.renderer.ProgramSourceFactory=new function(){function a(){if(!t.modes.receiveShadow)return!1;var a=t.lights.lights;if(!a)return!1;for(var b=0,c=a.length;b 1.0) {"),q(" discard;"),q("}")),q("float occlusion = 1.0;"),q(e.ambient?"vec3 ambientColor = materialAmbient;":"vec3 ambientColor = vec3(1.0, 1.0, 1.0);"),q(e.diffuse?"vec3 diffuseColor = materialDiffuse;":e.baseColor?"vec3 diffuseColor = materialBaseColor;":"vec3 diffuseColor = vec3(1.0, 1.0, 1.0);"),f.colors&&q("diffuseColor *= vColor.rgb;"),q(e.emissive?"vec3 emissiveColor = materialEmissive;":"vec3 emissiveColor = vec3(0.0, 0.0, 0.0);"),q(e.specular?"vec3 specular = materialSpecular;":"vec3 specular = vec3(1.0, 1.0, 1.0);"),q(void 0!==e.opacity?"float opacity = materialOpacity;":"float opacity = 1.0;"),f.colors&&q("opacity *= vColor.a;"),q(void 0!==e.glossiness?"float glossiness = materialGlossiness;":"float glossiness = 1.0;"),q(void 0!==e.metallic?"float metallic = materialMetallic;":"float metallic = 1.0;"),q(void 0!==e.roughness?"float roughness = materialRoughness;":"float roughness = 1.0;"),q(void 0!==e.specularF0?"float specularF0 = materialSpecularF0;":"float specularF0 = 1.0;"),f.uv&&(f.normals&&e.normalMap||e.ambientMap||e.baseColorMap||e.diffuseMap||e.occlusionMap||e.emissiveMap||e.metallicMap||e.roughnessMap||e.metallicRoughnessMap||e.specularMap||e.glossinessMap||e.specularGlossinessMap||e.opacityMap)&&(q("vec4 texturePos = vec4(vUV.s, vUV.t, 1.0, 1.0);"),q("vec2 textureCoord;")),f.uv&&e.ambientMap&&(q(e.ambientMap.matrix?"textureCoord = (ambientMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("ambientColor *= texture2D(ambientMap, textureCoord).rgb;")),f.uv&&e.diffuseMap&&(q(e.diffuseMap.matrix?"textureCoord = (diffuseMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("diffuseColor *= texture2D(diffuseMap, textureCoord).rgb;")),f.uv&&e.baseColorMap&&(q(e.baseColorMap.matrix?"textureCoord = (baseColorMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("diffuseColor *= texture2D(baseColorMap, textureCoord).rgb;")),f.uv&&e.emissiveMap&&(q(e.emissiveMap.matrix?"textureCoord = (emissiveMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("emissiveColor *= texture2D(emissiveMap, textureCoord).rgb;")),f.uv&&e.opacityMap&&(q(e.opacityMap.matrix?"textureCoord = (opacityMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("opacity *= texture2D(opacityMap, textureCoord).r;")),f.uv&&e.occlusionMap&&(q(e.occlusionMap.matrix?"textureCoord = (occlusionMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("occlusion *= texture2D(occlusionMap, textureCoord).r;")),f.normals&&(j.length>0||t.lights.lightMap||t.lights.reflectionMap)){f.uv&&e.normalMap?(q(e.normalMap.matrix?"textureCoord = (normalMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("vec3 viewNormal = vTBN * normalize( texture2D(normalMap, vec2(textureCoord.x, textureCoord.y) ).rgb * 2.0 - 1.0);")):q("vec3 viewNormal = normalize(vViewNormal);"),f.uv&&e.specularMap&&(q(e.specularMap.matrix?"textureCoord = (specularMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("specular *= texture2D(specularMap, textureCoord).rgb;")),f.uv&&e.glossinessMap&&(q(e.glossinessMap.matrix?"textureCoord = (glossinessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("glossiness *= texture2D(glossinessMap, textureCoord).r;")),f.uv&&e.specularGlossinessMap&&(q(e.specularGlossinessMap.matrix?"textureCoord = (materialSpecularGlossinessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("vec4 specGlossRGB = texture2D(materialSpecularGlossinessMap, textureCoord).rgba;"),q("specular *= specGlossRGB.rgb;"),q("glossiness *= specGlossRGB.a;")),f.uv&&e.metallicMap&&(q(e.metallicMap.matrix?"textureCoord = (metallicMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("metallic *= texture2D(metallicMap, textureCoord).r;")),f.uv&&e.roughnessMap&&(q(e.roughnessMap.matrix?"textureCoord = (roughnessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("roughness *= texture2D(roughnessMap, textureCoord).r;")),f.uv&&e.metallicRoughnessMap&&(q(e.metallicRoughnessMap.matrix?"textureCoord = (metallicRoughnessMapMatrix * texturePos).xy;":"textureCoord = texturePos.xy;"),q("vec3 metalRoughRGB = texture2D(metallicRoughnessMap, textureCoord).rgb;"),q("metallic *= metalRoughRGB.r;"),q("roughness *= metalRoughRGB.g;")),q("vec3 viewEyeDir = normalize(-vViewPosition);"),(e.diffuseFresnel||e.specularFresnel||e.opacityFresnel||e.emissiveFresnel||e.reflectivityFresnel)&&(e.diffuseFresnel&&(q("float diffuseFresnel = fresnel(viewEyeDir, viewNormal, diffuseFresnelEdgeBias, diffuseFresnelCenterBias, diffuseFresnelPower);"),q("diffuseColor *= mix(diffuseFresnelEdgeColor, diffuseFresnelCenterColor, diffuseFresnel);")),e.specularFresnel&&(q("float specularFresnel = fresnel(viewEyeDir, viewNormal, specularFresnelEdgeBias, specularFresnelCenterBias, specularFresnelPower);"),q("specular *= mix(specularFresnelEdgeColor, specularFresnelCenterColor, specularFresnel);")),e.opacityFresnel&&(q("float opacityFresnel = fresnel(viewEyeDir, viewNormal, opacityFresnelEdgeBias, opacityFresnelCenterBias, opacityFresnelPower);"),q("opacity *= mix(opacityFresnelEdgeColor.r, opacityFresnelCenterColor.r, opacityFresnel);")),e.emissiveFresnel&&(q("float emissiveFresnel = fresnel(viewEyeDir, viewNormal, emissiveFresnelEdgeBias, emissiveFresnelCenterBias, emissiveFresnelPower);"),q("emissiveColor *= mix(emissiveFresnelEdgeColor, emissiveFresnelCenterColor, emissiveFresnel);"))),q("IncidentLight light;"),q("Material material;"),q("Geometry geometry;"),q("ReflectedLight reflectedLight = ReflectedLight(vec3(0.0,0.0,0.0), vec3(0.0,0.0,0.0));"),q("vec3 viewLightDir;"),g&&(q("material.diffuseColor = diffuseColor;"),q("material.specularColor = specular;"),q("material.shine = materialShininess;")),i&&(q("float oneMinusSpecularStrength = 1.0 - max(max(specular.r, specular.g ),specular.b);"),q("material.diffuseColor = diffuseColor * oneMinusSpecularStrength;"),q("material.specularRoughness = clamp( 1.0 - glossiness, 0.04, 1.0 );"),q("material.specularColor = specular;")),h&&(q("float dielectricSpecular = 0.16 * specularF0 * specularF0;"),q("material.diffuseColor = diffuseColor * (1.0 - dielectricSpecular) * (1.0 - metallic);"),q("material.specularRoughness = clamp(roughness, 0.04, 1.0);"),q("material.specularColor = mix(vec3(dielectricSpecular), diffuseColor, metallic);")),q("geometry.position = vViewPosition;"),t.lights.lightMap&&q("geometry.worldNormal = normalize(vWorldNormal);"),q("geometry.viewNormal = viewNormal;"),q("geometry.viewEyeDir = viewEyeDir;"),g&&(t.lights.lightMap||t.lights.reflectionMap)&&q("computePhongLightMapping(geometry, material, reflectedLight);"),(i||h)&&(t.lights.lightMap||t.lights.reflectionMap)&&q("computePBRLightMapping(geometry, material, reflectedLight);");var d;for(b=0,c=j.length;b depth + 0.005) ? 0.7 : 1.0;"));g?(q("ambientColor *= lightAmbient;"),q("vec3 outgoingLight = (shadow * occlusion * (ambientColor + reflectedLight.diffuse + reflectedLight.specular)) + emissiveColor;")):q("vec3 outgoingLight = (shadow * occlusion * reflectedLight.diffuse) + (shadow * occlusion * reflectedLight.specular) + emissiveColor;")}else q("ambientColor *= lightAmbient;"),q("vec3 outgoingLight = emissiveColor + ambientColor;");return q("gl_FragColor = vec4(outgoingLight, opacity);"),q("}"),r()}function p(){Q=[]}function q(a){Q.push(a||"")}function r(){return Q}function s(a){return a.getShaderPrecisionFormat?a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision>0?"highp":a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision>0?"mediump":"lowp":"mediump"}var t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P={},Q="";this.getSource=function(p,q){var r=P[p];return r?(r.useCount++,r):(t=q,x=b(),y=d(),z=e(),u="phongMaterial"===t.material.type,v="MetallicMaterial"===t.material.type,w="SpecularMaterial"===t.material.type,A=c(),B=t.material.diffuseFresnel,C=t.material.specularFresnel,D=t.material.opacityFresnel,E=t.material.reflectivityFresnel,F=t.material.emissiveFresnel,G=a(),r=new xeogl.renderer.ProgramSource(p,f(),g(),h(),i(),n(),o(),j(),k(),l(),m()),P[p]=r,r)},this.putSource=function(a){var b=P[a];b&&0==--b.useCount&&(P[b.hash]=null)}}}(),function(){"use strict";xeogl.renderer.Chunk=function(){},xeogl.renderer.Chunk.prototype.init=function(a,b,c){this.id=a,this.program=b,this.state=c,this.useCount=0,this.build&&this.build()}}(),function(){"use strict";xeogl.renderer.ChunkFactory=function(){this.types=xeogl.renderer.ChunkFactory.types},xeogl.renderer.ChunkFactory.types={},xeogl.renderer.ChunkFactory.createChunkType=function(a){if(!a.type)throw"'type' expected in params";var b=xeogl.renderer.Chunk,c=function(){this.init.apply(this,arguments)};return c.prototype=new b,c.prototype.constructor=c,xeogl._apply(a,c.prototype),xeogl.renderer.ChunkFactory.types[a.type]={constructor:c,chunks:{},freeChunks:[],freeChunksLen:0},c},xeogl.renderer.ChunkFactory.prototype.getChunk=function(a,b,c,d){var e=this.types[b];if(!e)throw"chunk type not supported: '"+b+"'";var f=e.chunks[a];return f?(f.useCount++,f):(e.freeChunksLen>0&&(f=e.freeChunks[--e.freeChunksLen]),f?f.init(a,c,d):f=new e.constructor(a,c,d),f.useCount=1,e.chunks[a]=f,f)},xeogl.renderer.ChunkFactory.prototype.putChunk=function(a){if(0===a.useCount)return void console.error("xeogl.renderer.Chunkfactory.putChunk: chunk put too many times!");if(0===--a.useCount){var b=this.types[a.type];delete b.chunks[a.id],b.freeChunks[b.freeChunksLen++]=a}},xeogl.renderer.ChunkFactory.prototype.webglRestored=function(a){var b,c,d,e=this.types;for(var f in e)if(e.hasOwnProperty(f)){b=e[f],c=b.chunks;for(var g in c)c.hasOwnProperty(g)&&(d=c[g],d.build&&d.build())}}}(),function(){"use strict";xeogl.renderer.ChunkFactory.createChunkType({type:"clips",build:function(){var a,b;this._uClipModeDraw=this._uClipModeDraw||[],this._uClipPlaneDraw=this._uClipPlaneDraw||[];var c=this.program.draw;for(a=0,b=this.state.clips.length;a>16&255,e=a.pickIndex>>8&255,f=255&a.pickIndex;this._uPickColorObject.setValue([f/255,e/255,d/255,1])}b.indices&&(c.drawElements(b.primitive,b.indices.numItems,b.indices.itemType,0),a.drawElements++)},pickPrimitive:function(){var a=this.state,b=this.program.gl,c=a.getPickPositions();c&&b.drawArrays(a.primitive,0,c.numItems/3)},outline:function(a){this.draw(a)}})}(),function(){"use strict";xeogl.renderer.ChunkFactory.createChunkType({type:"geometry",build:function(){var a=this.program.draw;this._aPositionDraw=a.getAttribute("position"),this._aNormalDraw=a.getAttribute("normal"),this._aUVDraw=a.getAttribute("uv"),this._aTangentDraw=a.getAttribute("tangent"),this._aColorDraw=a.getAttribute("color"),this._aPositionShadow=this.program.shadow.getAttribute("position");var b=this.program.pickObject;this._aPositionPickObject=b.getAttribute("position");var c=this.program.pickPrimitive;this._aPositionPickPrimitive=c.getAttribute("position"),this._aColorPickPrimitive=c.getAttribute("color");var d=this.program.outline;this._aPositionOutline=d.getAttribute("position"),this._aNormalOutline=d.getAttribute("normal")},draw:function(a){var b=this.state;this._aPositionDraw&&(this._aPositionDraw.bindFloatArrayBuffer(b.positions),a.bindArray++),this._aNormalDraw&&(this._aNormalDraw.bindFloatArrayBuffer(b.normals),a.bindArray++),this._aUVDraw&&(this._aUVDraw.bindFloatArrayBuffer(b.uv),a.bindArray++),this._aColorDraw&&(this._aColorDraw.bindFloatArrayBuffer(b.colors),a.bindArray++),this._aTangentDraw&&(this._aTangentDraw.bindFloatArrayBuffer(b.getTangents()),a.bindArray++),b.indices&&(b.indices.bind(),a.bindArray++)},shadow:function(a){var b=this.state;this._aPositionShadow&&(this._aPositionShadow.bindFloatArrayBuffer(b.positions),a.bindArray++),b.indices&&(b.indices.bind(),a.bindArray++)},pickObject:function(){var a=this.state;this._aPositionPickObject&&this._aPositionPickObject.bindFloatArrayBuffer(a.positions),a.indices&&a.indices.bind()},pickPrimitive:function(){var a=this.state;this._aPositionPickPrimitive&&this._aPositionPickPrimitive.bindFloatArrayBuffer(a.getPickPositions()),this._aColorPickPrimitive&&this._aColorPickPrimitive.bindFloatArrayBuffer(a.getPickColors())},outline:function(a){var b=this.state;this._aPositionOutline&&(this._aPositionOutline.bindFloatArrayBuffer(b.positions),a.bindArray++),this._aNormalOutline&&(this._aNormalOutline.bindFloatArrayBuffer(b.normals),a.bindArray++),b.indices&&(b.indices.bind(),a.bindArray++)}})}(),function(){"use strict";xeogl.renderer.ChunkFactory.createChunkType({type:"lights",build:function(){this._uLightAmbientColor=this._uLightAmbientColor||[],this._uLightAmbientIntensity=this._uLightAmbientIntensity||[],this._uLightColor=this._uLightColor||[],this._uLightIntensity=this._uLightIntensity||[],this._uLightDir=this._uLightDir||[],this._uLightPos=this._uLightPos||[],this._uLightAttenuation=this._uLightAttenuation||[],this._uShadowViewMatrix=this._uShadowViewMatrix||[],this._uShadowProjMatrix=this._uShadowProjMatrix||[];for(var a,b=this.state.lights,c=this.program,d=0,e=b.length;d0)return[k[0],e+m.join(",\n"+l),k[1]].join("\n"+d)}return h}(a,"",0)}function b(a){return a.replace(d,function(a,b){return b?a:a+" "})}function c(a,b,c){return b in a?a[b]:c}var d=/("(?:[^"]|\\.)*")|[:,]/g;return function(){return a(this.json,null,"\t")}}()},js:{get:function(){return"new "+this.type+"("+this.string+");"}}},destroy:function(){if(!this.destroyed){var a,b,c,d,e,f;if(this._attachments)for(a in this._attachments)if(this._attachments.hasOwnProperty(a)){for(b=this._attachments[a],c=b.component,d=b.subs,e=0,f=d.length;e-1){var I=H.geometry;if("triangles"===I.primitive){G.primitive="triangle";var J=G.primIndex,K=I.indices,L=I.positions,M=K[J],N=K[J+1],O=K[J+2],P=3*M,Q=3*N,R=3*O;g[0]=M,g[1]=N,g[2]=O,G.indices=g,d[0]=L[P],d[1]=L[P+1],d[2]=L[P+2],e[0]=L[Q],e[1]=L[Q+1],e[2]=L[Q+2],f[0]=L[R],f[1]=L[R+1],f[2]=L[R+2];var S;F.canvasPos?(S=F.canvasPos,G.canvasPos=F.canvasPos,a.canvasPosToLocalRay(H.camera,H,S,b,c)):F.origin&&F.direction&&a.worldRayToLocalRay(H,F.origin,F.direction,b,c),a.normalizeVec3(c),a.rayPlaneIntersect(b,c,d,e,f,h),G.localPos=h,G.position=h,r[0]=h[0],r[1]=h[1],r[2]=h[2],r[3]=1,a.transformVec4(H.transform.leafMatrix,r,s),i[0]=s[0],i[1]=s[1],i[2]=s[2],G.worldPos=i,a.transformVec4(H.camera.view.matrix,s,t),j[0]=t[0],j[1]=t[1],j[2]=t[2],G.viewPos=j,a.cartesianToBarycentric(h,d,e,f,k),G.bary=k;var T=I.normals;if(T){l[0]=T[P],l[1]=T[P+1],l[2]=T[P+2],m[0]=T[Q],m[1]=T[Q+1],m[2]=T[Q+2],n[0]=T[R],n[1]=T[R+1],n[2]=T[R+2];var U=a.addVec3(a.addVec3(a.mulVec3Scalar(l,k[0],u),a.mulVec3Scalar(m,k[1],v),w),a.mulVec3Scalar(n,k[2],x),y);G.normal=a.transformVec3(H.transform.leafMatrix,U,z)}var V=I.uv;V&&(o[0]=V[2*M],o[1]=V[2*M+1],p[0]=V[2*N],p[1]=V[2*N+1],q[0]=V[2*O],q[1]=V[2*O+1],G.uv=a.addVec3(a.addVec3(a.mulVec2Scalar(o,k[0],A),a.mulVec2Scalar(p,k[1],B),C),a.mulVec2Scalar(q,k[2],D),E))}}return G}}}(),clear:function(){for(var a in this.components)this.components.hasOwnProperty(a)&&this.components[a].destroy();this._initDefaults(),this._dirtyEntities={}},_getSharedComponent:function(a,b){var c,d;if(xeogl._isObject(a)?(c=a.type||"xeogl.Component", +d=xeogl[c.substring(6)]):xeogl._isString(a)?(c=a,d=xeogl[c.substring(6)]):(d=a,c=a.prototype.type),!d)return void this.error("Component type not found: "+c);if(!xeogl._isComponentType(c,"xeogl.Component"))return void this.error("Expected a xeogl.Component type or subtype");var e,f;return void 0!==b&&(f="__shared."+c+"."+b,e=this._sharedComponents[f])?(this._sharedCounts[f]++,e):a&&a.id&&this.components[a.id]?(this.error("Component "+xeogl._inQuotes(a.id)+" already exists in Scene - ignoring ID, will randomly-generate instead"),null):(e=new d(this,a),void 0!==b&&(this._sharedComponents[f]=e,this._sharedComponentIDs[e.id]=f,this._sharedCounts[f]=1,e.on("destroyed",function(){void 0!==this._sharedComponentIDs[e.id]&&this._putSharedComponent(e)},this)),e)},_putSharedComponent:function(a){var b=this._sharedComponentIDs[a.id];if(void 0!==b){if(--this._sharedCounts[b]>0)return;delete this._sharedComponents[b],delete this._sharedComponentIDs[a.id],delete this._sharedCounts[b]}a.destroy()},_compile:function(a,b,c){var d,e=0;for(var f in this._dirtyEntities)this._dirtyEntities.hasOwnProperty(f)&&(d=this._dirtyEntities[f],d._valid()&&(d._compileAsynch(),delete this._dirtyEntities[f],e++));this._renderer.render({pass:a,clear:b,force:c});var g=this.canvas;if(g.transparent||g.backgroundImage||g.backgroundColor)this._lastAmbientColor=null;else{var h=this._renderer.ambientColor;this._lastAmbientColor&&this._lastAmbientColor[0]===h[0]&&this._lastAmbientColor[1]===h[1]&&this._lastAmbientColor[2]===h[2]&&this._lastAmbientColor[3]===h[3]||(g.backgroundColor=h,this._lastAmbientColor||(this._lastAmbientColor=xeogl.math.vec4()),this._lastAmbientColor.set(h))}},_getJSON:function(){var a,b=[];for(var c in this.components)if(this.components.hasOwnProperty(c)){if(a=this.components[c],!a._getJSON)continue;b.push(a.json)}return{passes:this._passes,clearEachPass:this._clearEachPass,components:b}},_destroy:function(){this.clear()}})}(),function(){"use strict";xeogl.MorphTargets=xeogl.Component.extend({type:"xeogl.MorphTargets",_init:function(a){this.scene.on("webglContextRestored",function(){}),this.targets=a.targets,this.factor=a.factor},_props:{targets:{set:function(a){},get:function(){}},factor:{set:function(a){},get:function(){return 0}},_compile:function(){this._renderer.MorphTargets=this._state}},_getJSON:function(){return{targets:this.targets,factor:this.factor}}})}(),function(){"use strict";var a=xeogl.math;xeogl.CameraFlightAnimation=xeogl.Component.extend({type:"xeogl.CameraFlightAnimation",_init:function(b){this._aabbHelper=this.create({type:"xeogl.Entity",camera:b.camera,geometry:this.create({type:"xeogl.AABBGeometry"}),material:this.create({type:"xeogl.PhongMaterial",diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],emissive:[.5,1,.5],lineWidth:2}),visibility:this.create({type:"xeogl.Visibility",visible:!1}),modes:this.create({type:"xeogl.Modes",collidable:!1})}),this._obbHelper=this.create({type:"xeogl.Entity",camera:b.camera,geometry:this.create({type:"xeogl.OBBGeometry",material:this.create({type:"xeogl.PhongMaterial",diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],emissive:[.5,1,.5],lineWidth:2})}),visibility:this.create({type:"xeogl.Visibility",visible:!1}),modes:this.create({type:"xeogl.Modes",collidable:!1})}),this._look1=a.vec3(),this._eye1=a.vec3(),this._up1=a.vec3(),this._look2=a.vec3(),this._eye2=a.vec3(),this._up2=a.vec3(),this._flying=!1,this._flyEyeLookUp=!1,this._callback=null,this._callbackScope=null,this._onTick=null,this._time1=null,this._time2=null,this.easing=!1!==b.easing,this.duration=b.duration,this.fit=b.fit,this.fitFOV=b.fitFOV,this.trail=b.trail,this.camera=b.camera},flyTo:function(){var b=a.vec3();return function(c,d,e){c=c||this.scene,this._flying&&this.stop();var f=this._attached.camera;if(!f)return void(d&&(e?d.call(e):d()));this._flying=!1,this._callback=d,this._callbackScope=e;var g=f.view;this._eye1[0]=g.eye[0],this._eye1[1]=g.eye[1],this._eye1[2]=g.eye[2],this._look1[0]=g.look[0],this._look1[1]=g.look[1],this._look1[2]=g.look[2],this._up1[0]=g.up[0],this._up1[1]=g.up[1],this._up1[2]=g.up[2];var h,i,j,k,l;if(c.worldBoundary)h=c.worldBoundary.aabb;else if(c.aabb)h=c.aabb;else if(6===c.length)h=c;else if(c.eye||c.look||c.up)i=c.eye,j=c.look,k=c.up;else{var m=c;if((xeogl._isNumeric(m)||xeogl._isString(m))&&(l=m,!(m=this.scene.components[l])))return this.error("Component not found: "+xeogl._inQuotes(l)),void(d&&(e?d.call(e):d()));var n=m.worldBoundary;if(!n)return this.error("Can't fly to component "+xeogl._inQuotes(l)+" - does not have a worldBoundary"),void(d&&(e?d.call(e):d()));h=n.aabb}var o=c.offset;if(h){if(h[3]<=h[0]||h[4]<=h[1]||h[5]<=h[2])return;!1!==c.showAABB&&(this._aabbHelper.geometry.aabb=h,this._aabbHelper.visibility.visible=!0);var p=a.getAABB3Center(h);this._look2=c.look||p,o&&(this._look2[0]+=o[0],this._look2[1]+=o[1],this._look2[2]+=o[2]);var q=a.normalizeVec3(a.subVec3(this._eye1,this._look1,b)),r=(c.look,a.getAABB3Diag(h)),s=Math.abs(r/Math.tan((c.fitFOV||this._fitFOV)*xeogl.math.DEGTORAD));this._eye2[0]=this._look2[0]+q[0]*s,this._eye2[1]=this._look2[1]+q[1]*s,this._eye2[2]=this._look2[2]+q[2]*s,this._up2[0]=this._up1[0],this._up2[1]=this._up1[1],this._up2[2]=this._up1[2],this._flyEyeLookUp=!1}else(i||j||k)&&(j=j||this._look1,i=i||this._eye1,k=k||this._up1,this._look2[0]=j[0],this._look2[1]=j[1],this._look2[2]=j[2],this._eye2[0]=i[0],this._eye2[1]=i[1],this._eye2[2]=i[2],this._up2[0]=k[0],this._up2[1]=k[1],this._up2[2]=k[2],this._flyEyeLookUp=!0);this.fire("started",c,!0),this._time1=Date.now(),this._time2=this._time1+(c.duration?1e3*c.duration:this._duration),this._flying=!0,xeogl.scheduleTask(this._update,this)}}(),jumpTo:function(a){var b=this;xeogl.scheduleTask(function(){b._jumpTo(a)})},_jumpTo:function(){var b=(a.vec3(),a.vec3()),c=a.vec3(),d=a.vec3(),e=a.vec3(),f=a.vec3();return function(g){this._flying&&this.stop();var h=this._attached.camera;if(h){var i,j,k,l=h.view;if(g.worldBoundary)j=g.worldBoundary.sphere;else if(g.sphere)j=g.sphere;else if(g.aabb)i=g.aabb;else if(6===g.length)i=g;else if(4===g.length)j=g;else if(g.eye||g.look||g.up)b=g.eye,c=g.look,d=g.up;else{var m=g;if((xeogl._isNumeric(m)||xeogl._isString(m))&&(k=m,!(m=this.scene.components[k])))return void this.error("Component not found: "+xeogl._inQuotes(k));var n=m.worldBoundary;if(!n)return void this.error("Can't jump to component "+xeogl._inQuotes(k)+" - does not have a worldBoundary");j=n.sphere}g.offset;if(i||j){var o;if(i){if(i[3]<=i[0]||i[4]<=i[1]||i[5]<=i[2])return;o=a.getAABB3Diag(i),a.getAABB3Center(i,c)}else{if(j[3]<=0)return;o=2*j[3],c[0]=j[0],c[1]=j[1],c[2]=j[2]}this._trail?a.subVec3(l.look,c,e):a.subVec3(l.eye,l.look,e),a.normalizeVec3(e);var p;p=(void 0!==g.fit?g.fit:this._fit)?Math.abs(o/Math.tan((g.fitFOV||this._fitFOV)*xeogl.math.DEGTORAD)):a.lenVec3(a.subVec3(l.eye,l.look,f)),a.mulVec3Scalar(e,p),l.eye=a.addVec3(c,e,b),l.look=c}else(b||c||d)&&(b&&(l.eye=b),c&&(l.look=c),d&&(l.up=d))}}}(),_update:function(){var b=a.vec3(),c=a.vec3(),d=a.vec3(),e=a.vec3(),f=a.vec3();return function(){if(this._flying){var g=Date.now(),h=(g-this._time1)/(this._time2-this._time1),i=h>=1;h>1&&(h=1),h=this.easing?this._ease(h,0,1,1):h;var j=this._attached.camera.view;if(this._flyEyeLookUp)j.eye=a.lerpVec3(h,0,1,this._eye1,this._eye2,c),j.look=a.lerpVec3(h,0,1,this._look1,this._look2,d),j.up=a.lerpVec3(h,0,1,this._up1,this._up2,e);else{a.lerpVec3(h,0,1,this._look1,this._look2,d);var k;this._trail?a.subVec3(d,j.look,b):a.subVec3(j.eye,j.look,b),a.normalizeVec3(b),a.lerpVec3(h,0,1,this._eye1,this._eye2,c),a.subVec3(c,d,f),k=a.lenVec3(f),a.mulVec3Scalar(b,k),j.eye=a.addVec3(d,b,c),j.look=d}if(i)return void this.stop();xeogl.scheduleTask(this._update,this)}}}(),_ease:function(a,b,c,d){return a/=d,-c*a*(a-2)+b},stop:function(){if(this._flying){this._aabbHelper.visibility.visible=!1,this._flying=!1,this._time1=null,this._time2=null;var a=this._callback;a&&(this._callback=null,this._callbackScope?a.call(this._callbackScope):a()),this.fire("stopped",!0,!0)}},cancel:function(){this._flying&&(this._aabbHelper.visibility.visible=!1,this._flying=!1,this._time1=null,this._time2=null,this._callback&&(this._callback=null),this.fire("canceled",!0,!0))},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0}),this._aabbHelper.camera=this._attached.camera,this.stop()},get:function(){return this._attached.camera}},duration:{set:function(a){a=a||.5,this._duration=1e3*a,this.stop()},get:function(){return this._duration/1e3}},fit:{set:function(a){this._fit=!1!==a,this.fire("fit",this._fit)},get:function(){return this._fit}},fitFOV:{set:function(a){a=a||45,this._fitFOV=a},get:function(){return this._fitFOV}},trail:{set:function(a){this._trail=!!a,this.fire("trail",this._trail)},get:function(){return this._trail}}},_getJSON:function(){var a={duration:this._duration,fitFOV:this._fitFOV,fit:this._fit,trail:this._trail};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.stop()}})}(),function(){"use strict";xeogl.Camera=xeogl.Component.extend({type:"xeogl.Camera",_init:function(a){this.project=a.project,this.view=a.view},_props:{project:{set:function(a){this._attach({name:"project",type:"xeogl.Transform",component:a,sceneDefault:!0,on:{matrix:{callback:function(){this.fire("projectMatrix")},scope:this}}})},get:function(){return this._attached.project}},view:{set:function(a){this._attach({name:"view",type:"xeogl.Transform",component:a,sceneDefault:!0,on:{matrix:{callback:function(){this.fire("viewMatrix")},scope:this}}})},get:function(){return this._attached.view}}},_compile:function(){this._renderer.projTransform=this._attached.project._state,this._renderer.viewTransform=this._attached.view._state},_getJSON:function(){return{project:this._attached.project.id,view:this._attached.view.id}}})}(),function(){"use strict";xeogl.Canvas=xeogl.Component.extend({type:"xeogl.Canvas",serializable:!1,_WEBGL_CONTEXT_NAMES:["webgl","experimental-webgl","webkit-3d","moz-webgl","moz-glweb20"],_init:function(a){if(this.canvas=null,this.overlay=null,this.gl=null,this.webgl2=!1,this.transparent=!!a.transparent,this.contextAttr=a.contextAttr||{},this.contextAttr.alpha=this.transparent,void 0!==this.contextAttr.alpha&&null!==this.contextAttr.alpha||(this.contextAttr.alpha=this.transparent),void 0!==this.contextAttr.preserveDrawingBuffer&&null!==this.contextAttr.preserveDrawingBuffer||(this.contextAttr.preserveDrawingBuffer=!1),this.contextAttr.stencil=!0,a.canvas?xeogl._isString(a.canvas)?(this.canvas=document.getElementById(a.canvas),this.canvas||(this.error("Canvas element not found: "+xeogl._inQuotes(a.canvas)+" - creating default canvas instead."),this._createCanvas())):this.canvas=a.canvas:this._createCanvas(),!this.canvas)return void this.error("Faied to create canvas");this.canvas.width=this.canvas.clientWidth,this.canvas.height=this.canvas.clientHeight,this.boundary=[this.canvas.offsetLeft,this.canvas.offsetTop,this.canvas.clientWidth,this.canvas.clientHeight],this._createBackground(),this._createOverlay(),this._initWebGL(a);var b=this;this.canvas.addEventListener("webglcontextlost",function(){b.fire("webglContextLost")},!1),this.canvas.addEventListener("webglcontextrestored",function(){b._initWebGL(),b.gl&&b.fire("webglContextRestored",b.gl)},!1);var c=null,d=null,e=null,f=null,g=null,h=null;this._tick=this.scene.on("tick",function(){var a=b.canvas,i=window.innerWidth!==c||window.innerHeight!==d,j=a.clientWidth!==e||a.clientHeight!==f,k=a.offsetLeft!==g||a.offsetTop!==h;if(i||j||k){if(b._spinner._adjustPosition(),j){var l,m=a.clientWidth,n=a.clientHeight,o=0;for(var p in xeogl.scenes)xeogl.scenes.hasOwnProperty(p)&&(l=xeogl.scenes[p],o+=l.canvas.canvas.clientWidth*l.canvas.canvas.clientHeight);xeogl.stats.memory.pixels=o,a.width=a.clientWidth,a.height=a.clientHeight;var q=b.boundary;q[0]=a.offsetLeft,q[1]=a.offsetTop,q[2]=m,q[3]=n,b.fire("boundary",q),e=m,f=n}i&&(c=window.innerWidth,d=window.innerHeight),k&&(g=a.offsetLeft,h=a.offsetTop)}}),this.canvas.oncontextmenu=function(a){a.preventDefault()},this._spinner=new xeogl.Spinner(this.scene,{canvas:this.canvas}),this.backgroundColor=a.backgroundColor,this.backgroundImage=a.backgroundImage},_createCanvas:function(){var a="xeogl-canvas-"+xeogl.math.createUUID(),b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d=c.style;d.height="100%",d.width="100%",d.padding="0",d.margin="0",d.background="rgba(0,0,0,0);",d.float="left",d.left="0",d.top="0",d.position="absolute",d.opacity="1.0",d["z-index"]="-10000",c.innerHTML+='',b.appendChild(c),this.canvas=document.getElementById(a)},_createBackground:function(){var a=document.createElement("div"),b=a.style;b.padding="0",b.margin="0",b.background=null,b.backgroundImage=null,b.float="left",b.left="0",b.top="0",b.width="100%",b.height="100%",b.position="absolute",b.opacity=1,b["z-index"]="-20000",this.canvas.parentElement.appendChild(a),this._backgroundElement=a},_createOverlay:function(){var a=document.createElement("div"),b=a.style;b.padding="0",b.margin="0",b.background="black",b.float="left",b.left="0",b.top="0",b.width="100%",b.height="100%",b.position="absolute",b.opacity=0,b["z-index"]="100000",this.canvas.parentElement.appendChild(a),this.overlay=a},_getElementXY:function(a){for(var b=0,c=0;a;)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.offsetParent;return{x:b,y:c}},_initWebGL:function(a){if(a.webgl2){try{this.gl=this.canvas.getContext("webgl2",this.contextAttr)}catch(c){}this.gl?this.webgl2=!0:this.warn("Failed to get a WebGL 2 context - defaulting to WebGL 1.")}if(!this.gl)for(var b=0;!this.gl&&b
',this._canvas.parentElement.appendChild(b),this._element=b,this._adjustPosition(),this.processes=0,this.textures=a.textures},_props:{textures:{set:function(a){a=!1!==a,this._textures=a,this.fire("textures",this._textures)},get:function(){return this._textures}},processes:{set:function(a){a=a||0,this._processes!==a&&(a<0||(this._processes=a,this._element.style.visibility=this._processes>0?"visible":"hidden",this.fire("processes",this._processes)))},get:function(){return this._processes}}},_adjustPosition:function(){if(this._canvas&&this._element){var a=this._canvas,b=this._element,c=b.style;c.left=a.offsetLeft+.5*a.clientWidth-.5*b.clientWidth+"px",c.top=a.offsetTop+.5*a.clientHeight-.5*b.clientHeight+"px"}},_injectSpinnerCSS:function(){if(!a){var b=document.createElement("style");b.innerHTML=this._spinnerCSS,document.body.appendChild(b),a=!0}},_spinnerCSS:".sk-fading-circle { margin: 100px auto; width: 100px; height:100px; position: relative; } .sk-fading-circle .sk-circle { width: 120%; height: 120%; position: absolute; left: 0; top: 0; } .sk-fading-circle .sk-circle:before { content: ''; display: block; margin: 0 auto; width: 15%; height: 15%; background-color: #ff8800; border-radius: 100%; -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; } .sk-fading-circle .sk-circle2 { -webkit-transform: rotate(30deg); -ms-transform: rotate(30deg); transform: rotate(30deg); } .sk-fading-circle .sk-circle3 { -webkit-transform: rotate(60deg); -ms-transform: rotate(60deg); transform: rotate(60deg); } .sk-fading-circle .sk-circle4 { -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .sk-fading-circle .sk-circle5 { -webkit-transform: rotate(120deg); -ms-transform: rotate(120deg); transform: rotate(120deg); } .sk-fading-circle .sk-circle6 { -webkit-transform: rotate(150deg); -ms-transform: rotate(150deg); transform: rotate(150deg); } .sk-fading-circle .sk-circle7 { -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .sk-fading-circle .sk-circle8 { -webkit-transform: rotate(210deg); -ms-transform: rotate(210deg); transform: rotate(210deg); } .sk-fading-circle .sk-circle9 { -webkit-transform: rotate(240deg); -ms-transform: rotate(240deg); transform: rotate(240deg); } .sk-fading-circle .sk-circle10 { -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .sk-fading-circle .sk-circle11 { -webkit-transform: rotate(300deg); -ms-transform: rotate(300deg); transform: rotate(300deg); } .sk-fading-circle .sk-circle12 { -webkit-transform: rotate(330deg); -ms-transform: rotate(330deg); transform: rotate(330deg); } .sk-fading-circle .sk-circle2:before { -webkit-animation-delay: -1.1s; animation-delay: -1.1s; } .sk-fading-circle .sk-circle3:before { -webkit-animation-delay: -1s; animation-delay: -1s; } .sk-fading-circle .sk-circle4:before { -webkit-animation-delay: -0.9s; animation-delay: -0.9s; } .sk-fading-circle .sk-circle5:before { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } .sk-fading-circle .sk-circle6:before { -webkit-animation-delay: -0.7s; animation-delay: -0.7s; } .sk-fading-circle .sk-circle7:before { -webkit-animation-delay: -0.6s; animation-delay: -0.6s; } .sk-fading-circle .sk-circle8:before { -webkit-animation-delay: -0.5s; animation-delay: -0.5s; } .sk-fading-circle .sk-circle9:before { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; } .sk-fading-circle .sk-circle10:before { -webkit-animation-delay: -0.3s; animation-delay: -0.3s; } .sk-fading-circle .sk-circle11:before { -webkit-animation-delay: -0.2s; animation-delay: -0.2s; } .sk-fading-circle .sk-circle12:before { -webkit-animation-delay: -0.1s; animation-delay: -0.1s; } @-webkit-keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } } @keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } }"})}(),function(){"use strict";xeogl.Clip=xeogl.Component.extend({type:"xeogl.Clip",_init:function(a){this._state={mode:"disabled",dir:[1,0,0],dist:1},this.mode=a.mode,this.dir=a.dir,this.dist=a.dist},_props:{mode:{set:function(a){this._state.mode=a||"disabled",this._renderer.imageDirty=!0,this.fire("mode",this._state.mode)},get:function(){return this._state.mode}},dir:{set:function(a){this._state.dir=a||xeogl.math.vec3([1,0,0]),this._renderer.imageDirty=!0,this.fire("dir",this._state.dir)},get:function(){return this._state.dir}},dist:{set:function(a){this._state.dist=void 0!==a?a:1,this._renderer.imageDirty=!0,this.fire("dist",this._state.dist)},get:function(){return this._state.dist}}},_getJSON:function(){return{mode:this._state.mode,dir:xeogl.math.vecToArray(this._state.dir),dist:this._state.dist}}})}(),function(){"use strict";xeogl.Clips=xeogl.Component.extend({type:"xeogl.Clips",_init:function(a){this._state=new xeogl.renderer.Clips({clips:[],hash:""}),this._dirty=!0,this._clips=[],this._dirtySubs=[],this._destroyedSubs=[],this.clips=a.clips},_props:{clips:{set:function(a){function b(){h.fire("dirty",!0)}function c(){for(var a=this.id,b=0,c=h._clips.length;bMath.abs(m)?m=0:l=0,0!==l&&d.view.rotateEyeY(l),0!==m&&d.view.rotateEyeX(m)}}}})}else this.scene.off(this._onTick);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active} +;return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.KeyboardPanCamera=xeogl.Component.extend({type:"xeogl.KeyboardPanCamera",_init:function(a){this._onTick=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c=this;this._onTick=this.scene.on("tick",function(a){var d=c._attached.camera;if(d&&b.mouseover){var e=a.deltaTime;if(!b.ctrlDown&&!b.altDown){var f=b.keyDown[b.KEY_W],g=b.keyDown[b.KEY_S],h=b.keyDown[b.KEY_A],i=b.keyDown[b.KEY_D],j=b.keyDown[b.KEY_Z],k=b.keyDown[b.KEY_X];if(f||g||h||i||k||j){var l=0,m=0,n=0,o=.01*c._sensitivity;g?m=e*o:f&&(m=-e*o),i?l=e*o:h&&(l=-e*o),k?n=e*o:j&&(n=-e*o),d.view.pan([l,m,n])}}}})}else this._onTick&&this.scene.off(this._onTick);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.KeyboardZoomCamera=xeogl.Component.extend({type:"xeogl.KeyboardZoomCamera",_init:function(a){this._onTick=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c=this;this._onTick=this.scene.on("tick",function(a){var d=c._attached.camera;if(d&&b.mouseover){var e=a.deltaTime;if(!b.ctrlDown&&!b.altDown){var f=b.keyDown[b.KEY_ADD],g=b.keyDown[b.KEY_SUBTRACT];if(f||g){var h=0,i=.01*c.sensitivity;g?h=e*i:f&&(h=-e*i),d.view.zoom(h)}}}})}else null!==this._onTick&&this.scene.off(this._onTick);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MouseRotateCamera=xeogl.Component.extend({type:"xeogl.MouseRotateCamera",_init:function(a){this._onTick=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},firstPerson:{set:function(a){a=!!a,this._firstPerson=a,this.fire("firstPerson",this._firstPerson)},get:function(){return this._firstPerson}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c,d,e,f=0,g=0,h=!1,i=!1;this._onMouseDown=b.on("mousedown",function(a){b.mouseover&&(f=0,g=0,i&&(!b.mouseDownLeft||b.mouseDownRight||b.keyDown[b.KEY_SHIFT]||b.mouseDownMiddle?h=!1:(h=!0,c=a[0],d=a[1])))},this),this._onMouseUp=b.on("mouseup",function(){h=!1,f=0,g=0}),this._onMouseEnter=b.on("mouseenter",function(){i=!0,f=0,g=0}),this._onMouseLeave=b.on("mouseleave",function(){i=!1,f=0,g=0}),this._onMouseMove=b.on("mousemove",function(a){if(i&&h){var b=(a[0]-c)*this._sensitivity,f=(a[1]-d)*this._sensitivity;c=a[0],d=a[1];var g=this._attached.camera;g&&i&&h&&(0!==b&&(e=-b*this._sensitivity,this._firstPerson?g.view.rotateLookY(e):g.view.rotateEyeY(e)),0!==f&&(e=f*this._sensitivity,this._firstPerson?g.view.rotateLookX(-e):g.view.rotateEyeX(e)))}},this)}else b.off(this._onTick),b.off(this._onMouseDown),b.off(this._onMouseUp),b.off(this._onMouseMove),b.off(this._onMouseEnter),b.off(this._onMouseLeave);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MousePanCamera=xeogl.Component.extend({type:"xeogl.MousePanCamera",_init:function(a){this._onTick=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a?.03*a:.03,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c,d,e=0,f=0,g=!1,h=this;this._onTick=this.scene.on("tick",function(){var a=h._attached.camera;a&&(0===e&&0===f||(a.view.pan([e,f,0]),e=0,f=0))}),this._onMouseDown=b.on("mousedown",function(a){b.mouseDownLeft&&b.mouseDownRight||b.mouseDownLeft&&b.keyDown[b.KEY_SHIFT]||b.mouseDownMiddle?(c=a[0],d=a[1],g=!0):g=!1}),this._onMouseUp=b.on("mouseup",function(){g=!1}),this._onMouseUp=b.on("mouseout",function(){g=!1}),this._onMouseMove=b.on("mousemove",function(a){g&&(e+=(a[0]-c)*h._sensitivity,f+=(a[1]-d)*h._sensitivity,c=a[0],d=a[1])})}else b.off(this._onTick),b.off(this._onMouseDown),b.off(this._onMouseUp),b.off(this._onMouseMove);this.fire("active",this._active=a)}},get:function(){return this._active}}},_getJSON:function(){var a={sensitivity:this._sensitivity,active:this._active};return this._attached.camera&&(a.camera=this._attached.camera.id),a},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MousePickEntity=xeogl.Component.extend({type:"xeogl.MousePickEntity",_init:function(a){this.pickSurface=a.pickSurface,this.active=!1!==a.active},_props:{active:{set:function(a){if(this._active!==a){var b=this.scene.input;if(a){var c,d,e=this,f=2,g=!1,h=!1;this._onMouseEnter=b.on("mouseenter",function(){g=!0}),this._onMouseLeave=b.on("mouseleave",function(){g=!1}),this._onMouseDown=b.on("mousedown",function(a){g&&(h=!0,c=a[0],d=a[1])}),this._onMouseUp=b.on("mouseup",function(a){if(h&&g){if(c>=a[0]-f&&c<=a[0]+f&&d>=a[1]-f&&d<=a[1]+f){var b=e.scene.pick({canvasPos:a,pickSurface:e._pickSurface});b?e.fire("pick",b):e.fire("nopick",{canvasPos:a})}h=!1}})}else b.off(this._onMouseDown),b.off(this._onMouseUp);this.fire("active",this._active=a)}},get:function(){return this._active}},pickSurface:{set:function(a){a=!!a,this._pickSurface!==a&&(this._dirty=!1,this.fire("pickSurface",this._pickSurface=a))},get:function(){return this._pickSurface}}},_getJSON:function(){return{pickSurface:this._pickSurface,active:this._active}},_destroy:function(){this.active=!1}})}(),function(){"use strict";xeogl.MouseZoomCamera=xeogl.Component.extend({type:"xeogl.MouseZoomCamera",_init:function(a){this._onTick=null,this._onMouseWheel=null,this.camera=a.camera,this.sensitivity=a.sensitivity,this.active=!1!==a.active},_props:{camera:{set:function(a){this._attach({name:"camera",type:"xeogl.Camera",component:a,sceneDefault:!0})},get:function(){return this._attached.camera}},sensitivity:{set:function(a){this._sensitivity=a||.5,this.fire("sensitivity",this._sensitivity)},get:function(){return this._sensitivity}},active:{set:function(a){if(this._active!==a){if(a){var b=0,c=0,d=!1,e=!1,f=0,g=xeogl.math.vec3(),h=xeogl.math.vec3(),i=xeogl.math.vec3(),j=this;this._onMouseWheel=this.scene.input.on("mousewheel",function(a){b=a,0===b?(e=!1,d=!1):d=!0}),this._onTick=this.scene.on("tick",function(){var a=j._attached.camera;if(a){var k=a.view.eye,l=a.view.look;g[0]=k[0],g[1]=k[1],g[2]=k[2],h[0]=l[0],h[1]=l[1],h[2]=l[2],xeogl.math.subVec3(g,h,i);var m=Math.abs(xeogl.math.lenVec3(i)),n=1e3,o=j._sensitivity*(2+m/n);d&&(c=b*o,f=0,d=!1,e=!0),e&&(b>0?(f+=.2*o)>c&&(e=!1):b<0&&(f-=.2*o)1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},radius:{set:function(a){a=a||1,this._radius!==a&&(a<0&&(this.warn("negative radius not allowed - will invert"),a*=-1),this._radius=a,this._needUpdate(),this.fire("radius",this._radius))},get:function(){return this._radius}},tube:{set:function(a){a=a||.3,this._tube!==a&&(a<0&&(this.warn("negative tube not allowed - will invert"),a*=-1),this._tube=a,this._needUpdate(),this.fire("tube",this._tube))},get:function(){return this._tube}},radialSegments:{set:function(a){a=a||32,this._radialSegments!==a&&(a<0&&(this.warn("negative radialSegments not allowed - will invert"),a*=-1),this._radialSegments=a,this._needUpdate(),this.fire("radialSegments",this._radialSegments))},get:function(){return this._radialSegments}},tubeSegments:{set:function(a){a=a||24,this._tubeSegments!==a&&(a<0&&(this.warn("negative tubeSegments not allowed - will invert"),a*=-1),this._tubeSegments=a,this._needUpdate(),this.fire("tubeSegments",this._tubeSegments))},get:function(){return this._tubeSegments}},arc:{set:function(a){a=a||2*Math.PI,this._arc!==a&&(a<0&&(this.warn("negative arc not allowed - will invert"),a*=-1),this._arc=a,this._needUpdate(),this.fire("arc",this._arc))},get:function(){return this._arc}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),radius:this._radius,tube:this._tube,radialSegments:this._radialSegments,tubeSegments:this._tubeSegments,arc:this._arc}}})}(),function(){"use strict";xeogl.SphereGeometry=xeogl.Geometry.extend({type:"xeogl.SphereGeometry",_init:function(a){this._super(a),this.lod=a.lod, +this.center=a.center,this.radius=a.radius,this.heightSegments=a.heightSegments,this.widthSegments=a.widthSegments},_update:function(){var a=this._radius,b=Math.floor(this._lod*this._heightSegments),c=Math.floor(this._lod*this._widthSegments);b<18&&(b=18),c<18&&(c=18);var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s=[],t=[],u=[],v=[],w=this._center[0],x=this._center[1],y=this._center[2];for(d=0;d<=b;d++)for(f=d*Math.PI/b,g=Math.sin(f),h=Math.cos(f),e=0;e<=c;e++)i=2*e*Math.PI/c,j=Math.sin(i),k=Math.cos(i),l=k*g,m=h,n=j*g,o=1-e/c,p=d/b,t.push(l),t.push(m),t.push(n),u.push(o),u.push(p),s.push(w+a*l),s.push(x+a*m),s.push(y+a*n);for(d=0;d1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},radius:{set:function(a){a=a||1,this._radius!==a&&(a<0&&(this.warn("negative radius not allowed - will invert"),a*=-1),this._radius=a,this._needUpdate(),this.fire("radius",this._radius))},get:function(){return this._radius}},heightSegments:{set:function(a){a=a||18,this._heightSegments!==a&&(a<0&&(this.warn("negative heightSegments not allowed - will invert"),a*=-1),this._heightSegments=a,this._needUpdate(),this.fire("heightSegments",this._heightSegments))},get:function(){return this._heightSegments}},widthSegments:{set:function(a){a=a||24,this._widthSegments!==a&&(a<0&&(this.warn("negative widthSegments not allowed - will invert"),a*=-1),this._widthSegments=a,this._needUpdate(),this.fire("widthSegments",this._widthSegments))},get:function(){return this._widthSegments}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),radius:this._radius,heightSegments:this._heightSegments,widthSegments:this._widthSegments}}})}(),function(){"use strict";xeogl.BoundingSphereGeometry=xeogl.SphereGeometry.extend({type:"xeogl.BoundingSphereGeometry",_init:function(a){this._super(a),a.boundary?this.boundary=a.boundary:a.sphere&&(this.sphere=a.sphere)},_props:{boundary:{set:function(a){var b=!1,c=this;this._attach({name:"boundary",type:"xeogl.Boundary3D",component:a,sceneDefault:!1,on:{updated:function(){b||(b=!0,xeogl.scheduleTask(function(){c._setFromSphere(c._attached.boundary.sphere),b=!1}))}},onAttached:function(){c._setFromSphere(c._attached.boundary.sphere)}})},get:function(){return this._attached.boundary}},sphere:{set:function(a){a&&(this._attached.boundary&&(this.boundary=null),this._setFromSphere(a))}}},_setFromSphere:function(){var a=xeogl.math.vec3();return function(b){a[0]=b[0],a[1]=b[1],a[2]=b[2],this.center=a,this.radius=b[4]}}()})}(),function(){"use strict";xeogl.OBBGeometry=xeogl.Geometry.extend({type:"xeogl.OBBGeometry",_init:function(a){this._super(a),this.primitive=a.primitive||"lines",this.indices=[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7],a.boundary?this.boundary=a.boundary:a.obb?this.obb=a.obb:a.positions?this.positions=a.positions:this.positions=[1,1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1]},_props:{boundary:{set:function(a){var b=!1,c=this;this._attach({name:"boundary",type:"xeogl.Boundary3D",component:a,sceneDefault:!1,on:{updated:function(){b||(b=!0,xeogl.scheduleTask(function(){c._setPositionsFromOBB(c._attached.boundary.obb),b=!1}))}},onAttached:function(){c._setPositionsFromOBB(c._attached.boundary.obb)}})},get:function(){return this._attached.boundary}},obb:{set:function(a){a&&(this._attached.boundary&&(this.boundary=null),this._setPositionsFromOBB(a))}}},_setPositionsFromOBB:function(a){this.positions=[a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10],a[12],a[13],a[14],a[16],a[17],a[18],a[20],a[21],a[22],a[24],a[25],a[26],a[28],a[29],a[30]]},_getJSON:function(){var a={};return this._attached.boundary?a.boundary=this._attached.boundary.id:this.positions&&(a.positions=xeogl.math.vecToArray(this.positions)),a}})}(),function(){"use strict";xeogl.AABBGeometry=xeogl.Geometry.extend({type:"xeogl.AABBGeometry",_init:function(a){this._super(a),this.primitive=a.primitive||"lines",this.indices=[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7],a.boundary?this.boundary=a.boundary:a.aabb?this.aabb=a.aabb:a.positions?this.positions=a.positions:this.positions=[1,1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1]},_props:{boundary:{set:function(a){var b=!1,c=this;this._attach({name:"boundary",type:"xeogl.Boundary3D",component:a,sceneDefault:!1,on:{updated:function(){b||(b=!0,xeogl.scheduleTask(function(){c._setPositionsFromAABB(c._attached.boundary.aabb),b=!1}))}},onAttached:function(){c._setPositionsFromAABB(c._attached.boundary.aabb)}})},get:function(){return this._attached.boundary}},aabb:{set:function(a){a&&(this._attached.boundary&&(this.boundary=null),this._setPositionsFromAABB(a))}}},_setPositionsFromAABB:function(a){this.positions=[a[3],a[4],a[5],a[3],a[1],a[5],a[0],a[1],a[5],a[0],a[4],a[5],a[3],a[4],a[2],a[3],a[1],a[2],a[0],a[1],a[2],a[0],a[4],a[2]]},_getJSON:function(){var a={};return this._attached.boundary?a.boundary=this._attached.boundary.id:this.positions&&(a.positions=xeogl.math.vecToArray(this.positions)),a}})}(),xeogl.PathGeometry=xeogl.Geometry.extend({type:"xeogl.PathGeometry",_init:function(a){this._super(a),this.path=a.path,this.divisions=a.divisions},_update:function(){var a=this._attached.path;if(a){var b,c,d,e=a.getPoints(this._divisions),f=[];for(b=0,c=e.length;b0){for(r=A.length/3,B.push(0),B.push(1),B.push(0),C.push(.5),C.push(.5),A.push(0+a),A.push(v+b),A.push(0+c),j=0;j<=g;j++)k=Math.sin(j*x),l=Math.cos(j*x),s=.5*Math.sin(j*x)+.5,t=.5*Math.cos(j*x)+.5,B.push(d*k),B.push(1),B.push(d*l),C.push(s),C.push(t),A.push(d*k+a),A.push(v+b),A.push(d*l+c);for(j=0;j0){for(r=A.length/3,B.push(0),B.push(-1),B.push(0),C.push(.5),C.push(.5),A.push(0+a),A.push(0-v+b),A.push(0+c),j=0;j<=g;j++)k=Math.sin(j*x),l=Math.cos(j*x),s=.5*Math.sin(j*x)+.5,t=.5*Math.cos(j*x)+.5,B.push(e*k),B.push(-1),B.push(e*l),C.push(s),C.push(t),A.push(e*k+a),A.push(0-v+b),A.push(e*l+c);for(j=0;j1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},radiusTop:{set:function(a){a=void 0!==a?a:1,this._radiusTop!==a&&(a<0&&(this.warn("negative radiusTop not allowed - will invert"),a*=-1),this._radiusTop=a,this._needUpdate(),this.fire("radiusTop",this._radiusTop))},get:function(){return this._radiusTop}},radiusBottom:{set:function(a){a=void 0!==a?a:1,this._radiusBottom!==a&&(a<0&&(this.warn("negative radiusBottom not allowed - will invert"),a*=-1),this._radiusBottom=a,this._needUpdate(),this.fire("radiusBottom",this._radiusBottom))},get:function(){return this._radiusBottom}},height:{set:function(a){a=a||1,this._height!==a&&(a<0&&(this.warn("negative height not allowed - will invert"),a*=-1),this._height=a,this._needUpdate(),this.fire("height",this._height))},get:function(){return this._height}},radialSegments:{set:function(a){a=a||60,this._radialSegments!==a&&(a<0&&(this.warn("negative radialSegments not allowed - will invert"),a*=-1),this._radialSegments=a,this._needUpdate(),this.fire("radialSegments",this._radialSegments))},get:function(){return this._radialSegments}},heightSegments:{set:function(a){a=a||1,this._heightSegments!==a&&(a<0&&(this.warn("negative heightSegments not allowed - will invert"),a*=-1),this._heightSegments=a,this._needUpdate(),this.fire("heightSegments",this._heightSegments))},get:function(){return this._heightSegments}},openEnded:{set:function(a){a=void 0!==a&&a,this._openEnded!==a&&(this._openEnded=a,this._needUpdate(),this.fire("openEnded",this._openEnded))},get:function(){return this._openEnded}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),radiusTop:this._radiusTop,radiusBottom:this._radiusBottom,height:this._height,radialSegments:this._radialSegments,heightSegments:this._heightSegments,openEnded:this._openEnded}}})}(),function(){"use strict";xeogl.PlaneGeometry=xeogl.Geometry.extend({type:"xeogl.PlaneGeometry",_init:function(a){this._super(a),this.center=a.center,this.xSize=a.xSize,this.zSize=a.zSize,this.xSegments=a.xSegments,this.zSegments=a.zSegments,this.lod=a.lod,this.autoNormals=!1!==a.autoNormals},_update:function(){var a=this._center[0],b=this._center[1],c=this._center[2],d=this._xSize,e=this._zSize,f=Math.floor(this._lod*this._xSegments),g=Math.floor(this._lod*this._zSegments);g<1&&(g=1),g<1&&(g=1);var h,i,j,k,l,m,n,o=d/2,p=e/2,q=Math.floor(f)||1,r=Math.floor(g)||1,s=q+1,t=r+1,u=d/q,v=e/r,w=new Float32Array(s*t*3),x=new Float32Array(s*t*3),y=new Float32Array(s*t*2),z=0,A=0;for(h=0;h65535?Uint32Arraz:Uint16Array)(q*r*6);for(h=0;h1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},center:{set:function(a){(this._center=this._center||new xeogl.math.vec3).set(a||[0,0,0]),this._needUpdate(),this.fire("center",this._center)},get:function(){return this._center}},xSize:{set:function(a){a=a||1,this._xSize!==a&&(a<0&&(this.warn("negative xSize not allowed - will invert"),a*=-1),this._xSize=a,this._needUpdate(),this.fire("xSize",this._xSize))},get:function(){return this._xSize}},zSize:{set:function(a){a=a||1,this._zSize!==a&&(a<0&&(this.warn("negative zSize not allowed - will invert"),a*=-1),this._zSize=a,this._needUpdate(),this.fire("zSize",this._zSize))},get:function(){return this._zSize}},xSegments:{set:function(a){a=a||1,this._xSegments!==a&&(a<0&&(this.warn("negative xSegments not allowed - will invert"),a*=-1),this._xSegments=a,this._needUpdate(),this.fire("xSegments",this._xSegments))},get:function(){return this._xSegments}},zSegments:{set:function(a){a=a||1,this._zSegments!==a&&(a<0&&(this.warn("negative zSegments not allowed - will invert"),a*=-1),this._zSegments=a,this._needUpdate(),this.fire("zSegments",this._zSegments))},get:function(){return this._zSegments}}},_getJSON:function(){return{center:xeogl.math.vecToArray(this._center),xSize:this._xSize,zSize:this._zSize,xSegments:this._xSegments,zSegments:this._zSegments}}})}(),function(){"use strict";xeogl.LatheGeometry=xeogl.Geometry.extend({type:"xeogl.LatheGeometry",_init:function(a){this._super(a),this.points=a.points,this.segments=a.segments,this.phiStart=a.phiStart,this.phiLength=a.phiLength,this.lod=a.lod,this.autoNormals=!1!==a.autoNormals},_update:function(){var a=[],b=[],c=Math.floor(this._lod*this._segments);c<4&&(c=4);for(var d=this._phiStart*xeogl.math.DEGTORAD,e=this._phiLength*xeogl.math.DEGTORAD,f=this._points,g=(f.length,1/c),h=0,i=c;h<=i;h++)for(var j=d+h*g*e,k=Math.cos(j),l=Math.sin(j),m=0,n=f.length;m1)&&(this.warn("clamping lod to [0..1]"),a=a<0?0:1),this._lod=a,this._needUpdate(),this.fire("lod",this._lod))},get:function(){return this._lod}},phiStart:{set:function(a){a=a||0,this._phiStart!==a&&(a<0&&(this.warn("negative phiStart not allowed - will invert"),a*=-1),this._phiStart=a,this._needUpdate(),this.fire("phiStart",this._phiStart))},get:function(){return this._phiStart}},phiLength:{set:function(a){a=a||1,this._phiLength!==a&&(a<0&&(this.warn("negative phiLength not allowed - will invert"),a*=-1),this._phiLength=a,this._needUpdate(),this.fire("phiLength",this._phiLength))},get:function(){return this._phiLength}},segments:{set:function(a){a=Math.floor(a||4),this._segments!==a&&(a<0&&(this.warn("negative segments not allowed - will invert"),a*=-1),this._segments=a,this._needUpdate(),this.fire("segments",this._segments))},get:function(){return this._segments}}},_getJSON:function(){return{points:this._points,phiStart:this._phiStart,phiLength:this._phiLength,segments:this._segments}}})}(),function(){"use strict";xeogl.Input=xeogl.Component.extend({type:"xeogl.Input",serializable:!1,_init:function(a){var b=this;this.altDown=!1,this.ctrlDown=!1,this.mouseDownLeft=!1,this.mouseDownMiddle=!1,this.mouseDownRight=!1,this.keyDown=[],this.enabled=!0,this.mouseover=!1,document.addEventListener("keydown",this._keyDownListener=function(a){b.enabled&&("INPUT"!==a.target.tagName&&"TEXTAREA"!==a.target.tagName&&(a.ctrlKey?b.ctrlDown=!0:a.altKey?b.altDown=!0:(b.keyDown[a.keyCode]=!0,b.fire("keydown",a.keyCode,!0))),b.mouseover&&a.preventDefault())},!0),document.addEventListener("keyup",this._keyUpListener=function(a){b.enabled&&"INPUT"!==a.target.tagName&&"TEXTAREA"!==a.target.tagName&&(a.ctrlKey?b.ctrlDown=!1:a.altKey?b.altDown=!1:(b.keyDown[a.keyCode]=!1,b.fire("keyup",a.keyCode,!0)))}),a.element.addEventListener("mouseenter",this._mouseEnterListener=function(a){if(b.enabled){b.mouseover=!0;var c=b._getClickCoordsWithinElement(a);b.fire("mouseenter",c,!0)}}),a.element.addEventListener("mouseleave",this._mouseLeaveListener=function(a){if(b.enabled){b.mouseover=!1;var c=b._getClickCoordsWithinElement(a);b.fire("mouseleave",c,!0)}}),a.element.addEventListener("mousedown",this._mouseDownListener=function(c){if(b.enabled){switch(c.which){case 1:b.mouseDownLeft=!0;break;case 2:b.mouseDownMiddle=!0;break;case 3:b.mouseDownRight=!0}var d=b._getClickCoordsWithinElement(c);a.element.focus(),b.fire("mousedown",d,!0),b.mouseover&&c.preventDefault()}}),document.addEventListener("mouseup",this._mouseUpListener=function(a){if(b.enabled){switch(a.which){case 1:b.mouseDownLeft=!1;break;case 2:b.mouseDownMiddle=!1;break;case 3:b.mouseDownRight=!1}var c=b._getClickCoordsWithinElement(a);b.fire("mouseup",c,!0),b.mouseover&&a.preventDefault()}},!0),document.addEventListener("dblclick",this._dblClickListener=function(a){if(b.enabled){switch(a.which){case 1:b.mouseDownLeft=!1,b.mouseDownRight=!1;break;case 2:b.mouseDownMiddle=!1;break;case 3:b.mouseDownLeft=!1,b.mouseDownRight=!1}var c=b._getClickCoordsWithinElement(a);b.fire("dblclick",c,!0),b.mouseover&&a.preventDefault()}}),a.element.addEventListener("mousemove",this._mouseMoveListener=function(a){if(b.enabled){var c=b._getClickCoordsWithinElement(a);b.fire("mousemove",c,!0),b.mouseover&&a.preventDefault()}}),a.element.addEventListener("wheel",this._mouseWheelListener=function(a,c){if(b.enabled){var d=Math.max(-1,Math.min(1,40*-a.deltaY));b.fire("mousewheel",d,!0),b.mouseover&&a.preventDefault()}}),function(){var a,c,d=2;b.on("mousedown",function(b){a=b[0],c=b[1]}),b.on("mouseup",function(e){a>=e[0]-d&&a<=e[0]+d&&c>=e[1]-d&&c<=e[1]+d&&b.fire("mouseclicked",e,!0)})}(),function(){var a,c,d={"landscape-primary":90,"landscape-secondary":-90,"portrait-secondary":180,"portrait-primary":0},e=xeogl.math.vec3(),f=xeogl.math.vec3(),g={orientation:null,orientationAngle:0},h={orientationAngle:0,acceleration:null,accelerationIncludingGravity:f,rotationRate:xeogl.math.vec3(),interval:0},i={alpha:0,beta:0,gamma:0,absolute:!1};window.OrientationChangeEvent&&window.addEventListener("orientationchange",b._orientationchangedListener=function(){a=window.screen.orientation||window.screen.mozOrientation||window.msOrientation||null,c=a?d[a]||0:0,g.orientation=a,g.orientationAngle=c,b.fire("orientationchange",g)},!1),window.DeviceMotionEvent&&window.addEventListener("devicemotion",b._deviceMotionListener=function(a){h.interval=a.interval,h.orientationAngle=c;var d=a.acceleration;d?(e[0]=d.x,e[1]=d.y,e[2]=d.z,h.acceleration=e):h.acceleration=null;var g=a.accelerationIncludingGravity;g?(f[0]=g.x,f[1]=g.y,f[2]=g.z,h.accelerationIncludingGravity=f):h.accelerationIncludingGravity=null,h.rotationRate=a.rotationRate,b.fire("devicemotion",h)},!1),window.DeviceOrientationEvent&&window.addEventListener("deviceorientation",b._deviceOrientListener=function(a){i.gamma=a.gamma,i.beta=a.beta,i.alpha=a.alpha,i.absolute=a.absolute,b.fire("deviceorientation",i)},!1)}()},_getClickCoordsWithinElement:function(a){var b=[0,0];if(a){for(var c=a.target,d=0,e=0;c.offsetParent;)d+=c.offsetLeft,e+=c.offsetTop,c=c.offsetParent;b[0]=a.pageX-d,b[1]=a.pageY-e}else a=window.event,b.x=a.x,b.y=a.y;return b},setEnabled:function(a){this.enabled!==a&&this.fire("enabled",this.enabled=a)},KEY_BACKSPACE:8,KEY_TAB:9,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE_BREAK:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_NUM_0:48,KEY_NUM_1:49,KEY_NUM_2:50,KEY_NUM_3:51,KEY_NUM_4:52,KEY_NUM_5:53,KEY_NUM_6:54,KEY_NUM_7:55,KEY_NUM_8:56,KEY_NUM_9:57,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74,KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT_KEY:93,KEY_NUMPAD_0:96,KEY_NUMPAD_1:97,KEY_NUMPAD_2:98,KEY_NUMPAD_3:99,KEY_NUMPAD_4:100,KEY_NUMPAD_5:101,KEY_NUMPAD_6:102,KEY_NUMPAD_7:103,KEY_NUMPAD_8:104,KEY_NUMPAD_9:105,KEY_MULTIPLY:106,KEY_ADD:107,KEY_SUBTRACT:109,KEY_DECIMAL_POINT:110,KEY_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145,KEY_SEMI_COLON:186,KEY_EQUAL_SIGN:187,KEY_COMMA:188,KEY_DASH:189,KEY_PERIOD:190,KEY_FORWARD_SLASH:191,KEY_GRAVE_ACCENT:192,KEY_OPEN_BRACKET:219,KEY_BACK_SLASH:220,KEY_CLOSE_BRACKET:221,KEY_SINGLE_QUOTE:222,KEY_SPACE:32,_destroy:function(){document.removeEventListener("keydown",this._keyDownListener),document.removeEventListener("keyup",this._keyUpListener)}})}(),function(){"use strict";xeogl.Lights=xeogl.Component.extend({type:"xeogl.Lights",_init:function(a){this._state=new xeogl.renderer.Lights({lights:[],hash:""}),this._lights=[],this._dirtySubs=[],this._destroyedSubs=[],a.lights&&(this.lights=a.lights),a.lightMap&&(this.lightMap=a.lightMap),a.reflectionMap&&(this.reflectionMap=a.reflectionMap)},_props:{lights:{set:function(a){function b(){g.fire("dirty",!0)}function c(){for(var a=this.id,b=0,c=g._lights.length;b0;)e.pop().destroy()},removeAll:function(){this.iterate(function(a){a.destroy()})},_remove:function(a){var b=a.id;if(a.scene!==this.scene)return void this.warn("Attempted to remove component that's not in same xeogl.Scene: '"+b+"'");delete this.components[b],delete this.entities[b],a.off(this._onDestroyed[b]),delete this._onDestroyed[b];var c=this.types[a.type];c&&delete c[a.id],this.numComponents--,a.worldBoundary&&(a.worldBoundary.off(this._onWorldBoundaryUpdated[a.id]),delete this._onWorldBoundaryUpdated[a.id]),this._aabbDirty||this._setAABBDirty(),this.fire("removed",a),this._dirty||this._needUpdate()},iterate:function(a,b){b=b||this;var c=this.components;for(var d in c)c.hasOwnProperty(d)&&a.call(b,c[d])},_props:{transform:{set:function(a){this._attach({name:"transform",type:"xeogl.Transform",component:a,sceneDefault:!1,onAttached:{callback:this._transformUpdated,scope:this}})},get:function(){return this._attached.transform}},worldBoundary:{get:function(){if(!this._worldBoundary){var a=this;this._worldBoundary=this.create({type:"xeogl.Boundary3D",getDirty:function(){return!(!a._aabbDirty&&a._aabb)&&(a._buildAABB(),a._aabbDirty=!1,!0)},getAABB:function(){return a._aabb}}),this._worldBoundary.on("destroyed",function(){a._worldBoundary=null})}return this._worldBoundary}}},_transformUpdated:function(a){this._dummyRootTransform.parent=a},_updated:function(){this._aabbDirty||this._setAABBDirty()},_setAABBDirty:function(){this._aabbDirty=!0,this._worldBoundary&&this._worldBoundary.fire("updated",!0)},_buildAABB:function(){this._aabb||(this._aabb=xeogl.math.AABB3());var a,b,c,d=1e5,e=1e5,f=1e5,g=-1e5,h=-1e5,i=-1e5,j=this.components;for(var k in j)j.hasOwnProperty(k)&&(a=j[k],(b=a.worldBoundary)&&(c=b.aabb,c[0]g&&(g=c[3]),c[4]>h&&(h=c[4]),c[5]>i&&(i=c[5])));this._aabb[0]=d,this._aabb[1]=e,this._aabb[2]=f,this._aabb[3]=g,this._aabb[4]=h,this._aabb[5]=i},_destroy:function(){this.removeAll()}})}(),function(){"use strict";var a=["extensions","buffers","bufferViews","images","videos","samplers","textures","shaders","programs","techniques","materials","accessors","meshes","cameras","lights","skins","nodes","scenes","animations"];xeogl.glTFParser=Object.create(Object.prototype,{_rootDescription:{value:null,writable:!0},rootDescription:{set:function(a){this._rootDescription=a},get:function(){return this._rootDescription}},baseURL:{value:null,writable:!0},_isAbsolutePath:{value:function(a){var b=new RegExp("^"+window.location.protocol,"i");return!!a.match(b)}},resolvePathIfNeeded:{value:function(a){return this._isAbsolutePath(a)?a:/^data:/.test(a)?a:this.baseURL+a}},_resolvePathsForCategories:{value:function(a){a.forEach(function(a){var b=this.json[a];if(b){Object.keys(b).forEach(function(a){var c=b[a];c.uri=this.resolvePathIfNeeded(c.uri)},this)}},this)}},_json:{value:null,writable:!0},json:{enumerable:!0,get:function(){return this._json},set:function(a){this._json=a,this._resolvePathsForCategories(["buffers","shaders","images","videos"])}},_path:{value:null,writable:!0},getEntryDescription:{value:function(a,b){var c=null,d=b;return c=this.rootDescription[d],c?c?c[a]:null:(console.log("ERROR:CANNOT find expected category named:"+d),null)}},_stepToNextCategory:{value:function(){return this._state.categoryIndex=this.getNextCategoryIndex(this._state.categoryIndex+1),-1!==this._state.categoryIndex&&(this._state.categoryState.index=0,!0)}},_stepToNextDescription:{enumerable:!1,value:function(){var a=this._state.categoryState,b=a.keys;return b?(a.index++,a.keys=null,a.index>=b.length&&this._stepToNextCategory()):(console.log("INCONSISTENCY ERROR"),!1)}},hasCategory:{value:function(a){return!!this.rootDescription[a]}},_handleState:{value:function(){for(var b={buffers:this.handleBuffer,bufferViews:this.handleBufferView,shaders:this.handleShader,programs:this.handleProgram,techniques:this.handleTechnique,materials:this.handleMaterial,meshes:this.handleMesh,cameras:this.handleCamera,lights:this.handleLight,nodes:this.handleNode,scenes:this.handleScene,images:this.handleImage,animations:this.handleAnimation,accessors:this.handleAccessor,skins:this.handleSkin,samplers:this.handleSampler,textures:this.handleTexture,videos:this.handleVideo,extensions:this.handleExtension},c=!0;-1!==this._state.categoryIndex;){var d=a[this._state.categoryIndex],e=this._state.categoryState,f=e.keys;if(f||(e.keys=f=Object.keys(this.rootDescription[d]),!f||0!==f.length)){var g=d,h=f[e.index],i=this.getEntryDescription(h,g);if(i){if(b[g]&&!1===b[g].call(this,h,i,this._state.userInfo)){c=!1;break}this._stepToNextDescription()}else if(this.handleError){this.handleError("INCONSISTENCY ERROR: no description found for entry "+h),c=!1;break}}else this._stepToNextDescription()}this.handleLoadCompleted&&this.handleLoadCompleted(c)}},_loadJSON:{enumerable:!0,value:function(a){var b=this,c=this._path,d=c.lastIndexOf("/");this.baseURL=0!==d?c.substring(0,d+1):"";var e=new XMLHttpRequest;e.open("GET",c,!0),e.onreadystatechange=function(){4===e.readyState&&200===e.status&&(b.json=JSON.parse(e.responseText),a&&a(b.json))},e.send(null)}},_buildLoader:{value:function(a){var b=this;this._loadJSON(function(c){b.rootDescription=c,a&&a(this)})}},_state:{value:null,writable:!0},_getEntryType:{value:function(b){for(var c=a,d=0;di?(a=-j,b=j,c=j/k,d=-j/k):(a=-j*k,b=j*k,c=j,d=-j),this.matrix=xeogl.math.orthoMat4c(a,b,d,c,this._near,this._far,this.__tempMat||(this.__tempMat=xeogl.math.mat4()))},_props:{scale:{set:function(a){this._scale=void 0!==a&&null!==a?a:1,this._needUpdate(0),this.fire("scale",this._scale)},get:function(){return this._scale}},near:{set:function(a){this._near=void 0!==a&&null!==a?a:.1,this._needUpdate(),this.fire("near",this._near)},get:function(){return this._near}},far:{set:function(a){this._far=void 0!==a&&null!==a?a:1e4,this._needUpdate(),this.fire("far",this._far)},get:function(){return this._far}}},_getJSON:function(){var a={scale:this._scale,near:this._near,far:this._far};return this._parent&&(a.parent=this._parent.id),a},_destroy:function(){this._super(),this.scene.canvas.off(this._onCanvasBoundary)}})}(),function(){"use strict";xeogl.Perspective=xeogl.Transform.extend({type:"xeogl.Perspective",_init:function(a){this._super(a),this._dirty=!1,this._fovy=60,this._near=.1,this._far=1e4,this._canvasResized=this.scene.canvas.on("boundary",this._needUpdate,this),this.fovy=a.fovy,this.near=a.near,this.far=a.far},_update:function(){var a=this.scene.canvas.canvas,b=a.clientWidth/a.clientHeight;this.matrix=xeogl.math.perspectiveMat4(this._fovy*(Math.PI/180),b,this._near,this._far,this._matrix)},_props:{fovy:{set:function(a){this._fovy=void 0!==a&&null!==a?a:60,this._renderer.imageDirty=!0,this._needUpdate(0),this.fire("fovy",this._fovy)},get:function(){return this._fovy}},near:{set:function(a){this._near=void 0!==a&&null!==a?a:.1,this._renderer.imageDirty=!0,this._needUpdate(0),this.fire("near",this._near)},get:function(){return this._near}},far:{set:function(a){this._far=void 0!==a&&null!==a?a:1e4,this._renderer.imageDirty=!0,this._needUpdate(0),this.fire("far",this._far)},get:function(){return this._far}}},_getJSON:function(){var a={fovy:this._fovy,near:this._near,far:this._far};return this._parent&&(a.parent=this._parent.id),a},_destroy:function(){this._super(),this.scene.canvas.off(this._canvasResized)}})}(),xeogl.version="1.0.0"; \ No newline at end of file diff --git a/dev-scripts.json b/dev-scripts.json index e995b4465..89c8a1e98 100644 --- a/dev-scripts.json +++ b/dev-scripts.json @@ -45,6 +45,7 @@ "src/_renderer/chunks/lightsChunk.js", "src/_renderer/chunks/modelTransformChunk.js", "src/_renderer/chunks/modesChunk.js", + "src/_renderer/chunks/outlineChunk.js", "src/_renderer/chunks/phongMaterialChunk.js", "src/_renderer/chunks/metallicMaterialChunk.js", "src/_renderer/chunks/specularMaterialChunk.js", @@ -123,6 +124,9 @@ "src/models/gltf/glTFLoader.js", "src/models/gltfModel.js", + "src/outline/_module.js", + "src/outline/outline.js", + "src/materials/_module.js", "src/materials/material.js", "src/materials/phongMaterial.js", diff --git a/docs/api.js b/docs/api.js index 112aae45a..778591c28 100644 --- a/docs/api.js +++ b/docs/api.js @@ -55,6 +55,7 @@ YUI.add("yuidoc-meta", function(Y) { "OBBGeometry", "OBJGeometry", "Ortho", + "Outline", "Path", "PathGeometry", "Perspective", @@ -120,6 +121,7 @@ YUI.add("yuidoc-meta", function(Y) { "materials", "math", "models", + "outline", "rendering", "shaders", "skyboxes", @@ -239,6 +241,11 @@ YUI.add("yuidoc-meta", function(Y) { "name": "models", "description": "Models are units of xeogl content." }, + { + "displayName": "outline", + "name": "outline", + "description": "An outline rendering effect for emphasis." + }, { "displayName": "rendering", "name": "rendering", diff --git a/docs/classes/AABBGeometry.html b/docs/classes/AABBGeometry.html index 88ae8af0c..4014a5950 100644 --- a/docs/classes/AABBGeometry.html +++ b/docs/classes/AABBGeometry.html @@ -95,6 +95,7 @@

xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/AmbientLight.html b/docs/classes/AmbientLight.html index 2f4c59997..46905fe61 100644 --- a/docs/classes/AmbientLight.html +++ b/docs/classes/AmbientLight.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Annotation.html b/docs/classes/Annotation.html index bab7eadec..4ddce6d27 100644 --- a/docs/classes/Annotation.html +++ b/docs/classes/Annotation.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/AnnotationStory.html b/docs/classes/AnnotationStory.html index 50afa2575..cc1b46242 100644 --- a/docs/classes/AnnotationStory.html +++ b/docs/classes/AnnotationStory.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/AxisHelper.html b/docs/classes/AxisHelper.html index 38fd77805..fc66cc2a3 100644 --- a/docs/classes/AxisHelper.html +++ b/docs/classes/AxisHelper.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Billboard.html b/docs/classes/Billboard.html index 73b3781a2..fe9bfc13e 100644 --- a/docs/classes/Billboard.html +++ b/docs/classes/Billboard.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Boundary2D.html b/docs/classes/Boundary2D.html index 23e6521ad..b1521b28c 100644 --- a/docs/classes/Boundary2D.html +++ b/docs/classes/Boundary2D.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Boundary3D.html b/docs/classes/Boundary3D.html index ef918a99f..787b1ab52 100644 --- a/docs/classes/Boundary3D.html +++ b/docs/classes/Boundary3D.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/BoundingSphereGeometry.html b/docs/classes/BoundingSphereGeometry.html index 46e00b2dd..2895c8c4d 100644 --- a/docs/classes/BoundingSphereGeometry.html +++ b/docs/classes/BoundingSphereGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/BoxGeometry.html b/docs/classes/BoxGeometry.html index b954427bd..26677e6f5 100644 --- a/docs/classes/BoxGeometry.html +++ b/docs/classes/BoxGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/BuildableModel.html b/docs/classes/BuildableModel.html index 9579b0c1b..67b8cad9a 100644 --- a/docs/classes/BuildableModel.html +++ b/docs/classes/BuildableModel.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Camera.html b/docs/classes/Camera.html index 7869f1a0a..52a892728 100644 --- a/docs/classes/Camera.html +++ b/docs/classes/Camera.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CameraControl.html b/docs/classes/CameraControl.html index 3fc03bdb1..afa23a419 100644 --- a/docs/classes/CameraControl.html +++ b/docs/classes/CameraControl.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -1324,7 +1326,7 @@

    active

    Defined in - src/controls/cameraControl.js:335 + src/controls/cameraControl.js:337

    @@ -1350,7 +1352,7 @@

    camera

    Defined in - src/controls/cameraControl.js:285 + src/controls/cameraControl.js:287

    @@ -1457,7 +1459,7 @@

    firstPerson

    Defined in - src/controls/cameraControl.js:249 + src/controls/cameraControl.js:251

    @@ -1710,7 +1712,7 @@

    active

    Defined in - src/controls/cameraControl.js:365 + src/controls/cameraControl.js:367

    @@ -1752,7 +1754,7 @@

    camera

    Defined in - src/controls/cameraControl.js:299 + src/controls/cameraControl.js:301

    @@ -1820,7 +1822,7 @@

    firstPerson

    Defined in - src/controls/cameraControl.js:272 + src/controls/cameraControl.js:274

    diff --git a/docs/classes/CameraController.html b/docs/classes/CameraController.html index 0c3812408..63dde7d41 100644 --- a/docs/classes/CameraController.html +++ b/docs/classes/CameraController.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CameraFlightAnimation.html b/docs/classes/CameraFlightAnimation.html index 57b4d2d6f..d355d0bfb 100644 --- a/docs/classes/CameraFlightAnimation.html +++ b/docs/classes/CameraFlightAnimation.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -556,6 +558,10 @@

    Properties

  • billboard +
  • +
  • + billboard +
  • camera @@ -572,6 +578,10 @@

    Properties

  • clips +
  • +
  • + clips +
  • colorBuf @@ -584,6 +594,14 @@

    Properties

  • colorBuf +
  • +
  • + colorBuf + +
  • +
  • + colorTarget +
  • colorTarget @@ -608,6 +626,14 @@

    Properties

  • cull +
  • +
  • + cull + +
  • +
  • + depthBuf +
  • depthBuf @@ -632,6 +658,10 @@

    Properties

  • depthTarget +
  • +
  • + depthTarget +
  • destroyed @@ -660,6 +690,10 @@

    Properties

  • geometry +
  • +
  • + geometry +
  • id @@ -684,6 +718,14 @@

    Properties

  • layer +
  • +
  • + layer + +
  • +
  • + lights +
  • lights @@ -708,6 +750,10 @@

    Properties

  • material +
  • +
  • + material +
  • metadata @@ -724,6 +770,10 @@

    Properties

  • modelTransform +
  • +
  • + modelTransform +
  • modes @@ -736,6 +786,22 @@

    Properties

  • modes +
  • +
  • + modes + +
  • +
  • + outline + +
  • +
  • + outline + +
  • +
  • + projTransform +
  • projTransform @@ -764,6 +830,14 @@

    Properties

  • shader +
  • +
  • + shader + +
  • +
  • + shaderParams +
  • shaderParams @@ -788,6 +862,14 @@

    Properties

  • stage +
  • +
  • + stage + +
  • +
  • + stationary +
  • stationary @@ -828,6 +910,14 @@

    Properties

  • viewport +
  • +
  • + viewport + +
  • +
  • + viewTransform +
  • viewTransform @@ -853,6 +943,10 @@

    Properties

    visibility
  • +
  • + visibility + +
  • @@ -2084,7 +2178,7 @@

    billboard

    Defined in - src/_renderer/renderer.old.js:197 + src/_renderer/renderer.js:197

    @@ -2134,7 +2228,32 @@

    billboard

    + +
    +

    Billboard render state.

    + +
    + + + +
    +
    +

    billboard

    + renderer.Billboard + + + + + +
    +

    + Defined in + src/_renderer/renderer.old.js:197

    @@ -2213,7 +2332,7 @@

    clips

    Defined in - src/_renderer/renderer.js:225 + src/_renderer/renderer.opt.js:225

    @@ -2238,7 +2357,32 @@

    clips

    + +
    +

    Cross-section planes render state.

    + +
    + + + +
    +
    +

    clips

    + renderer.Clips + + + + + +
    +

    + Defined in + src/_renderer/renderer.js:225

    @@ -2263,7 +2407,7 @@

    colorBuf

    Defined in - src/_renderer/renderer.opt.js:155 + src/_renderer/renderer.new.js:155

    @@ -2288,7 +2432,7 @@

    colorBuf

    Defined in - src/_renderer/renderer.old.js:155 + src/_renderer/renderer.js:155

    @@ -2313,7 +2457,32 @@

    colorBuf

    + +
    +

    Color buffer render state.

    + +
    + + + +
    +
    +

    colorBuf

    + renderer.ColorBuf + + + + + +
    +

    + Defined in + src/_renderer/renderer.old.js:155

    @@ -2338,7 +2507,7 @@

    colorTarget

    Defined in - src/_renderer/renderer.opt.js:211 + src/_renderer/renderer.js:211

    @@ -2363,7 +2532,32 @@

    colorTarget

    + +
    +

    Color target render state.

    + +
    + + + +
    +
    +

    colorTarget

    + renderer.RenderTarget + + + + + +
    +

    + Defined in + src/_renderer/renderer.opt.js:211

    @@ -2413,7 +2607,7 @@

    cull

    Defined in - src/_renderer/renderer.js:120 + src/_renderer/renderer.new.js:120

    @@ -2460,6 +2654,31 @@

    cull

    +
    +

    + Defined in + src/_renderer/renderer.js:120 +

    + + +
    + +
    +

    Culling render state.

    + +
    + + + +
    +
    +

    cull

    + renderer.Cull + + + + +

    Defined in @@ -2513,7 +2732,7 @@

    depthBuf

    Defined in - src/_renderer/renderer.old.js:148 + src/_renderer/renderer.new.js:148

    @@ -2552,9 +2771,9 @@

    depthBuf

    -
    -

    depthTarget

    - renderer.RenderTarget +
    +

    depthBuf

    + renderer.DepthBuf @@ -2563,14 +2782,14 @@

    depthTarget

    -

    Depth target render state.

    +

    Depth buffer render state.

    @@ -2588,7 +2807,7 @@

    depthTarget

    Defined in - src/_renderer/renderer.old.js:218 + src/_renderer/renderer.new.js:218

    @@ -2613,7 +2832,7 @@

    depthTarget

    Defined in - src/_renderer/renderer.js:218 + src/_renderer/renderer.opt.js:218

    @@ -2627,18 +2846,68 @@

    depthTarget

    -
    -

    destroyed

    - Boolean +
    +

    depthTarget

    + renderer.RenderTarget
    -

    Inherited from - Component: - src/component.js:281 +

    + Defined in + src/_renderer/renderer.js:218 +

    + + +
    + +
    +

    Depth target render state.

    + +
    + + + +
    +
    +

    depthTarget

    + renderer.RenderTarget + + + + + +
    +

    + Defined in + src/_renderer/renderer.old.js:218 +

    + + +
    + +
    +

    Depth target render state.

    + +
    + + + +
    +
    +

    destroyed

    + Boolean + + + + + +
    +

    Inherited from + Component: + src/component.js:281

    @@ -2772,6 +3041,31 @@

    geometry

    +
    +

    + Defined in + src/_renderer/renderer.js:246 +

    + + +
    + +
    +

    Geometry render state.

    + +
    + + + +
    +
    +

    geometry

    + renderer.Geometry + + + + +

    Defined in @@ -2800,7 +3094,7 @@

    geometry

    Defined in - src/_renderer/renderer.js:246 + src/_renderer/renderer.new.js:246

    @@ -2902,7 +3196,7 @@

    layer

    Defined in - src/_renderer/renderer.opt.js:134 + src/_renderer/renderer.old.js:134

    @@ -2927,7 +3221,7 @@

    layer

    Defined in - src/_renderer/renderer.old.js:134 + src/_renderer/renderer.js:134

    @@ -2952,7 +3246,7 @@

    layer

    Defined in - src/_renderer/renderer.js:134 + src/_renderer/renderer.opt.js:134

    @@ -2965,6 +3259,56 @@

    layer

    +
    +
    +

    layer

    + renderer.Layer + + + + + +
    +

    + Defined in + src/_renderer/renderer.new.js:134 +

    + + +
    + +
    +

    Render state for an effects layer.

    + +
    + + + +
    +
    +

    lights

    + renderer.Lights + + + + + +
    +

    + Defined in + src/_renderer/renderer.opt.js:162 +

    + + +
    + +
    +

    Lights render state.

    + +
    + + +

    lights

    @@ -3002,7 +3346,7 @@

    lights

    Defined in - src/_renderer/renderer.js:162 + src/_renderer/renderer.new.js:162

    @@ -3027,7 +3371,7 @@

    lights

    Defined in - src/_renderer/renderer.opt.js:162 + src/_renderer/renderer.js:162

    @@ -3052,7 +3396,7 @@

    material

    Defined in - src/_renderer/renderer.old.js:169 + src/_renderer/renderer.opt.js:169

    @@ -3102,7 +3446,32 @@

    material

    + +
    +

    Material render state.

    + +
    + + + +
    +
    +

    material

    + renderer.Material + + + + + +
    +

    + Defined in + src/_renderer/renderer.new.js:169

    @@ -3152,7 +3521,32 @@

    modelTransform

    + +
    +

    Modelling transform render state.

    + +
    + + + +
    +
    +

    modelTransform

    + renderer.Transform + + + + + +
    +

    + Defined in + src/_renderer/renderer.js:176

    @@ -3202,7 +3596,7 @@

    modelTransform

    Defined in - src/_renderer/renderer.js:176 + src/_renderer/renderer.opt.js:176

    @@ -3227,7 +3621,32 @@

    modes

    + +
    +

    Modes render state.

    + +
    + + + +
    +
    +

    modes

    + renderer.Modes + + + + + +
    +

    + Defined in + src/_renderer/renderer.old.js:127

    @@ -3277,7 +3696,7 @@

    modes

    Defined in - src/_renderer/renderer.old.js:127 + src/_renderer/renderer.opt.js:127

    @@ -3290,6 +3709,56 @@

    modes

    +
    +
    +

    outline

    + renderer.Outline + + + + + +
    +

    + Defined in + src/_renderer/renderer.js:260 +

    + + +
    + +
    +

    Outline state.

    + +
    + + + +
    +
    +

    outline

    + renderer.Outline + + + + + +
    +

    + Defined in + src/_renderer/renderer.new.js:260 +

    + + +
    + +
    +

    Outline state.

    + +
    + + +

    projTransform

    @@ -3324,6 +3793,31 @@

    projTransform

    +
    +

    + Defined in + src/_renderer/renderer.new.js:190 +

    + + +
    + +
    +

    Projection transform render state.

    + +
    + + + +
    +
    +

    projTransform

    + renderer.Transform + + + + +

    Defined in @@ -3403,7 +3897,7 @@

    shader

    Defined in - src/_renderer/renderer.opt.js:232 + src/_renderer/renderer.js:232

    @@ -3453,7 +3947,32 @@

    shader

    + +
    +

    Custom shader render state.

    + +
    + + + +
    +
    +

    shader

    + renderer.Shader + + + + + +
    +

    + Defined in + src/_renderer/renderer.new.js:232

    @@ -3475,6 +3994,31 @@

    shaderParams

    +
    +

    + Defined in + src/_renderer/renderer.js:239 +

    + + +
    + +
    +

    Render state providing custom shader params.

    + +
    + + + +
    +
    +

    shaderParams

    + renderer.Shader + + + + +

    Defined in @@ -3528,7 +4072,7 @@

    shaderParams

    Defined in - src/_renderer/renderer.js:239 + src/_renderer/renderer.new.js:239

    @@ -3553,7 +4097,32 @@

    stage

    + +
    +

    Render state for an effects pipeline stage.

    + +
    + + + +
    +
    +

    stage

    + renderer.Layer + + + + + +
    +

    + Defined in + src/_renderer/renderer.opt.js:141

    @@ -3603,7 +4172,7 @@

    stage

    Defined in - src/_renderer/renderer.opt.js:141 + src/_renderer/renderer.js:141

    @@ -3650,6 +4219,31 @@

    stationary

    +
    +

    + Defined in + src/_renderer/renderer.opt.js:204 +

    + + +
    + +
    +

    Stationary render state.

    + +
    + + + +
    +
    +

    stationary

    + renderer.Stationary + + + + +

    Defined in @@ -3678,7 +4272,7 @@

    stationary

    Defined in - src/_renderer/renderer.opt.js:204 + src/_renderer/renderer.new.js:204

    @@ -3821,7 +4415,7 @@

    viewport

    Defined in - src/_renderer/renderer.old.js:253 + src/_renderer/renderer.opt.js:253

    @@ -3846,7 +4440,7 @@

    viewport

    Defined in - src/_renderer/renderer.opt.js:253 + src/_renderer/renderer.old.js:253

    @@ -3884,6 +4478,31 @@

    viewport

    +
    +
    +

    viewport

    + renderer.Viewport + + + + + +
    +

    + Defined in + src/_renderer/renderer.new.js:253 +

    + + +
    + +
    +

    Viewport render state.

    + +
    + + +

    viewTransform

    @@ -3896,7 +4515,7 @@

    viewTransform

    Defined in - src/_renderer/renderer.old.js:183 + src/_renderer/renderer.new.js:183

    @@ -3921,7 +4540,7 @@

    viewTransform

    Defined in - src/_renderer/renderer.js:183 + src/_renderer/renderer.opt.js:183

    @@ -3946,7 +4565,32 @@

    viewTransform

    + +
    +

    View transform render state.

    + +
    + + + +
    +
    +

    viewTransform

    + renderer.Transform + + + + + +
    +

    + Defined in + src/_renderer/renderer.js:183

    @@ -3971,7 +4615,7 @@

    visibility

    Defined in - src/_renderer/renderer.old.js:113 + src/_renderer/renderer.js:113

    @@ -4021,7 +4665,32 @@

    visibility

    + +
    +

    Visibility render state.

    + +
    + + + +
    +
    +

    visibility

    + renderer.Visibility + + + + + +
    +

    + Defined in + src/_renderer/renderer.old.js:113

    diff --git a/docs/classes/CameraFollowAnimation.html b/docs/classes/CameraFollowAnimation.html index c9402805d..1c0d9725f 100644 --- a/docs/classes/CameraFollowAnimation.html +++ b/docs/classes/CameraFollowAnimation.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CameraPath.html b/docs/classes/CameraPath.html index 8b4ad2030..c26e9c669 100644 --- a/docs/classes/CameraPath.html +++ b/docs/classes/CameraPath.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CameraPathAnimation.html b/docs/classes/CameraPathAnimation.html index 3acf36b34..ac7e6120b 100644 --- a/docs/classes/CameraPathAnimation.html +++ b/docs/classes/CameraPathAnimation.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Canvas.html b/docs/classes/Canvas.html index 4c5448ec9..cef9ee01b 100644 --- a/docs/classes/Canvas.html +++ b/docs/classes/Canvas.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -969,7 +971,7 @@

    getSnapshot

    Defined in - src/canvas/canvas.js:527 + src/canvas/canvas.js:529

    @@ -1534,7 +1536,7 @@

    backgroundColor

    Defined in - src/canvas/canvas.js:613 + src/canvas/canvas.js:615

    @@ -1589,7 +1591,7 @@

    backgroundImage

    Defined in - src/canvas/canvas.js:655 + src/canvas/canvas.js:657

    @@ -1617,7 +1619,7 @@

    boundary

    Defined in - src/canvas/canvas.js:244 + src/canvas/canvas.js:246

    @@ -2038,7 +2040,7 @@

    spinner

    Defined in - src/canvas/canvas.js:703 + src/canvas/canvas.js:705

    @@ -2307,7 +2309,7 @@

    backgroundColor

    Defined in - src/canvas/canvas.js:642 + src/canvas/canvas.js:644

    @@ -2391,7 +2393,7 @@

    backgroundImage

    Defined in - src/canvas/canvas.js:690 + src/canvas/canvas.js:692

    @@ -2475,7 +2477,7 @@

    boundary

    Defined in - src/canvas/canvas.js:354 + src/canvas/canvas.js:356

    @@ -2568,7 +2570,7 @@

    webglContextFailed

    Defined in - src/canvas/canvas.js:518 + src/canvas/canvas.js:520

    @@ -2619,7 +2621,7 @@

    webglContextLost

    Defined in - src/canvas/canvas.js:281 + src/canvas/canvas.js:283

    @@ -2644,7 +2646,7 @@

    webglContextRestored

    Defined in - src/canvas/canvas.js:294 + src/canvas/canvas.js:296

    diff --git a/docs/classes/CardboardEffect.html b/docs/classes/CardboardEffect.html index dc387c790..b9f6e39eb 100644 --- a/docs/classes/CardboardEffect.html +++ b/docs/classes/CardboardEffect.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -583,6 +585,10 @@

    Properties

  • morphTargets +
  • +
  • + outline +
  • scene @@ -711,6 +717,10 @@

    Events

  • morphTargets +
  • +
  • + Outline +
  • picked @@ -735,14 +745,14 @@

    Events

  • transform -
  • -
  • - Viewport -
  • viewport +
  • +
  • + Viewport +
  • visibility @@ -1517,7 +1527,7 @@

    billboard

    Inherited from Entity: - src/entities/entity.js:917 + src/entities/entity.js:920

    @@ -1583,7 +1593,7 @@

    canvasBoundary

    Inherited from Entity: - src/entities/entity.js:1216 + src/entities/entity.js:1254

    @@ -1625,7 +1635,7 @@

    clips

    Inherited from Entity: - src/entities/entity.js:272 + src/entities/entity.js:275

    @@ -1654,7 +1664,7 @@

    colorBuf

    Inherited from Entity: - src/entities/entity.js:341 + src/entities/entity.js:344

    @@ -1684,7 +1694,7 @@

    colorTarget

    Inherited from Entity: - src/entities/entity.js:306 + src/entities/entity.js:309

    @@ -1713,7 +1723,7 @@

    cull

    Inherited from Entity: - src/entities/entity.js:482 + src/entities/entity.js:485

    @@ -1742,7 +1752,7 @@

    depthBuf

    Inherited from Entity: - src/entities/entity.js:412 + src/entities/entity.js:415

    @@ -1772,7 +1782,7 @@

    depthTarget

    Inherited from Entity: - src/entities/entity.js:376 + src/entities/entity.js:379

    @@ -1853,7 +1863,7 @@

    geometry

    Inherited from Entity: - src/entities/entity.js:553 + src/entities/entity.js:556

    @@ -1886,7 +1896,7 @@

    glsl

    Inherited from Entity: - src/entities/entity.js:1285 + src/entities/entity.js:1323

    @@ -1915,7 +1925,7 @@

    glslString

    Inherited from Entity: - src/entities/entity.js:1322 + src/entities/entity.js:1360

    @@ -2020,7 +2030,7 @@

    layer

    Inherited from Entity: - src/entities/entity.js:606 + src/entities/entity.js:609

    @@ -2049,7 +2059,7 @@

    lights

    Inherited from Entity: - src/entities/entity.js:641 + src/entities/entity.js:644

    @@ -2079,7 +2089,7 @@

    localBoundary

    Inherited from Entity: - src/entities/entity.js:1032 + src/entities/entity.js:1070

    @@ -2114,7 +2124,7 @@

    material

    Inherited from Entity: - src/entities/entity.js:676 + src/entities/entity.js:679

    @@ -2168,7 +2178,7 @@

    modes

    Inherited from Entity: - src/entities/entity.js:518 + src/entities/entity.js:521

    @@ -2198,7 +2208,7 @@

    morphTargets

    Inherited from Entity: - src/entities/entity.js:711 + src/entities/entity.js:714

    @@ -2215,6 +2225,35 @@

    morphTargets

    +
    +
    +

    outline

    + Outline + + + + + +
    +

    Inherited from + Entity: + src/entities/entity.js:1035 +

    + + +
    + +
    +

    The Outline attached to this Entity.

    +

    Must be within the same Scene as this Entity. Defaults to the parent + Scene's default Outline when set to + a null or undefined value.

    +

    Fires an Entity/outline:event event on change.

    + +
    + + +

    scene

    @@ -2254,7 +2293,7 @@

    shader

    Inherited from Entity: - src/entities/entity.js:746 + src/entities/entity.js:749

    @@ -2284,7 +2323,7 @@

    shaderParams

    Inherited from Entity: - src/entities/entity.js:781 + src/entities/entity.js:784

    @@ -2313,7 +2352,7 @@

    stage

    Inherited from Entity: - src/entities/entity.js:817 + src/entities/entity.js:820

    @@ -2342,7 +2381,7 @@

    stationary

    Inherited from Entity: - src/entities/entity.js:992 + src/entities/entity.js:995

    @@ -2435,7 +2474,7 @@

    transform

    Inherited from Entity: - src/entities/entity.js:852 + src/entities/entity.js:855

    @@ -2497,7 +2536,7 @@

    viewBoundary

    Inherited from Entity: - src/entities/entity.js:1148 + src/entities/entity.js:1186

    @@ -2538,7 +2577,7 @@

    viewport

    Inherited from Entity: - src/entities/entity.js:956 + src/entities/entity.js:959

    @@ -2595,7 +2634,7 @@

    visibility

    Inherited from Entity: - src/entities/entity.js:447 + src/entities/entity.js:450

    @@ -2625,7 +2664,7 @@

    worldBoundary

    Inherited from Entity: - src/entities/entity.js:1059 + src/entities/entity.js:1097

    @@ -2716,7 +2755,7 @@

    billboard

    Inherited from Entity: - src/entities/entity.js:936 + src/entities/entity.js:939

    @@ -2805,7 +2844,7 @@

    clips

    Inherited from Entity: - src/entities/entity.js:288 + src/entities/entity.js:291

    @@ -2847,7 +2886,7 @@

    colorBuf

    Inherited from Entity: - src/entities/entity.js:357 + src/entities/entity.js:360

    @@ -2889,7 +2928,7 @@

    colorTarget

    Inherited from Entity: - src/entities/entity.js:323 + src/entities/entity.js:326

    @@ -2931,7 +2970,7 @@

    cull

    Inherited from Entity: - src/entities/entity.js:498 + src/entities/entity.js:501

    @@ -2973,7 +3012,7 @@

    depthBuf

    Inherited from Entity: - src/entities/entity.js:428 + src/entities/entity.js:431

    @@ -3015,7 +3054,7 @@

    depthTarget

    Inherited from Entity: - src/entities/entity.js:393 + src/entities/entity.js:396

    @@ -3124,7 +3163,7 @@

    layer

    Inherited from Entity: - src/entities/entity.js:622 + src/entities/entity.js:625

    @@ -3166,7 +3205,7 @@

    lights

    Inherited from Entity: - src/entities/entity.js:657 + src/entities/entity.js:660

    @@ -3208,7 +3247,7 @@

    material

    Inherited from Entity: - src/entities/entity.js:692 + src/entities/entity.js:695

    @@ -3253,7 +3292,7 @@

    modes

    Entity but overwritten in - src/entities/entity.js:534 + src/entities/entity.js:537

    @@ -3295,7 +3334,7 @@

    morphTargets

    Inherited from Entity: - src/entities/entity.js:728 + src/entities/entity.js:731

    @@ -3325,6 +3364,48 @@

    Event Payload:

    +
    +
    +

    Outline

    + + + + + + +
    +

    Inherited from + Entity: + src/entities/entity.js:1051 +

    + + +
    + +
    +

    Fired whenever this Entity's Entity/Outline:property property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Object + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + +

    picked

    @@ -3337,7 +3418,7 @@

    picked

    Inherited from Entity: - src/entities/entity.js:163 + src/entities/entity.js:165

    @@ -3402,7 +3483,7 @@

    shader

    Inherited from Entity: - src/entities/entity.js:763 + src/entities/entity.js:766

    @@ -3444,7 +3525,7 @@

    shaderParams

    Inherited from Entity: - src/entities/entity.js:798 + src/entities/entity.js:801

    @@ -3486,7 +3567,7 @@

    stage

    Inherited from Entity: - src/entities/entity.js:833 + src/entities/entity.js:836

    @@ -3528,7 +3609,7 @@

    stationary

    Inherited from Entity: - src/entities/entity.js:1012 + src/entities/entity.js:1015

    @@ -3571,7 +3652,7 @@

    transform

    Inherited from Entity: - src/entities/entity.js:876 + src/entities/entity.js:879

    @@ -3603,8 +3684,8 @@

    Event Payload:

    -
    -

    Viewport

    +
    +

    viewport

    @@ -3612,16 +3693,16 @@

    Viewport

    -

    Fired whenever this CardboardEffect's Viewport +

    Fired whenever this Entity's viewport property changes.

    @@ -3646,8 +3727,8 @@

    Event Payload:

    -
    -

    viewport

    +
    +

    Viewport

    @@ -3655,16 +3736,16 @@

    viewport

    -

    Fired whenever this Entity's viewport +

    Fired whenever this CardboardEffect's Viewport property changes.

    @@ -3700,7 +3781,7 @@

    visibility

    Inherited from Entity: - src/entities/entity.js:463 + src/entities/entity.js:466

    diff --git a/docs/classes/Clip.html b/docs/classes/Clip.html index 684cc9f21..f6116ef9b 100644 --- a/docs/classes/Clip.html +++ b/docs/classes/Clip.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Clips.html b/docs/classes/Clips.html index 00c813d35..84d6677a1 100644 --- a/docs/classes/Clips.html +++ b/docs/classes/Clips.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/ColorBuf.html b/docs/classes/ColorBuf.html index 1aff53116..413ba3452 100644 --- a/docs/classes/ColorBuf.html +++ b/docs/classes/ColorBuf.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Component.html b/docs/classes/Component.html index a81d24057..a7c2ef9b5 100644 --- a/docs/classes/Component.html +++ b/docs/classes/Component.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Configs.html b/docs/classes/Configs.html index f6b423d1b..a870bb9f2 100644 --- a/docs/classes/Configs.html +++ b/docs/classes/Configs.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CubeTexture.html b/docs/classes/CubeTexture.html index 578ec238f..a1c7afb1e 100644 --- a/docs/classes/CubeTexture.html +++ b/docs/classes/CubeTexture.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CubicBezierCurve.html b/docs/classes/CubicBezierCurve.html index 53fda1e70..bb855c85b 100644 --- a/docs/classes/CubicBezierCurve.html +++ b/docs/classes/CubicBezierCurve.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Cull.html b/docs/classes/Cull.html index 9bb97808a..464169ad5 100644 --- a/docs/classes/Cull.html +++ b/docs/classes/Cull.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Curve.html b/docs/classes/Curve.html index 5def3ddfe..44ae71f0d 100644 --- a/docs/classes/Curve.html +++ b/docs/classes/Curve.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/CylinderGeometry.html b/docs/classes/CylinderGeometry.html index f78f87fcf..c491bd4ab 100644 --- a/docs/classes/CylinderGeometry.html +++ b/docs/classes/CylinderGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/DepthBuf.html b/docs/classes/DepthBuf.html index 4e737786c..dbf392d78 100644 --- a/docs/classes/DepthBuf.html +++ b/docs/classes/DepthBuf.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/DirLight.html b/docs/classes/DirLight.html index b4384a250..3f03c8b12 100644 --- a/docs/classes/DirLight.html +++ b/docs/classes/DirLight.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Entity.html b/docs/classes/Entity.html index a7faf71f4..ff84b3695 100644 --- a/docs/classes/Entity.html +++ b/docs/classes/Entity.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -575,6 +577,18 @@

    Parameters:

    +
  • +
  • + [outline] + String | Outline + optional + +
    +

    ID or instance of a Outline attached to this Entity. Must be within the same Scene as this Entity. Defaults to the parent Scene's default instance, + outline.

    + +
    +
  • [loading] @@ -754,6 +768,10 @@

    Properties

  • morphTargets +
  • +
  • + outline +
  • scene @@ -874,6 +892,10 @@

    Events

  • morphTargets +
  • +
  • + Outline +
  • picked @@ -1649,7 +1671,7 @@

    billboard

    Defined in - src/entities/entity.js:917 + src/entities/entity.js:920

    @@ -1680,7 +1702,7 @@

    camera

    Defined in - src/entities/entity.js:223 + src/entities/entity.js:226

    @@ -1710,7 +1732,7 @@

    canvasBoundary

    Defined in - src/entities/entity.js:1216 + src/entities/entity.js:1254

    @@ -1752,7 +1774,7 @@

    clips

    Defined in - src/entities/entity.js:272 + src/entities/entity.js:275

    @@ -1781,7 +1803,7 @@

    colorBuf

    Defined in - src/entities/entity.js:341 + src/entities/entity.js:344

    @@ -1811,7 +1833,7 @@

    colorTarget

    Defined in - src/entities/entity.js:306 + src/entities/entity.js:309

    @@ -1840,7 +1862,7 @@

    cull

    Defined in - src/entities/entity.js:482 + src/entities/entity.js:485

    @@ -1869,7 +1891,7 @@

    depthBuf

    Defined in - src/entities/entity.js:412 + src/entities/entity.js:415

    @@ -1899,7 +1921,7 @@

    depthTarget

    Defined in - src/entities/entity.js:376 + src/entities/entity.js:379

    @@ -1953,7 +1975,7 @@

    geometry

    Defined in - src/entities/entity.js:553 + src/entities/entity.js:556

    @@ -1986,7 +2008,7 @@

    glsl

    Defined in - src/entities/entity.js:1285 + src/entities/entity.js:1323

    @@ -2015,7 +2037,7 @@

    glslString

    Defined in - src/entities/entity.js:1322 + src/entities/entity.js:1360

    @@ -2120,7 +2142,7 @@

    layer

    Defined in - src/entities/entity.js:606 + src/entities/entity.js:609

    @@ -2149,7 +2171,7 @@

    lights

    Defined in - src/entities/entity.js:641 + src/entities/entity.js:644

    @@ -2179,7 +2201,7 @@

    localBoundary

    Defined in - src/entities/entity.js:1032 + src/entities/entity.js:1070

    @@ -2214,7 +2236,7 @@

    material

    Defined in - src/entities/entity.js:676 + src/entities/entity.js:679

    @@ -2268,7 +2290,7 @@

    modes

    Defined in - src/entities/entity.js:518 + src/entities/entity.js:521

    @@ -2298,7 +2320,7 @@

    morphTargets

    Defined in - src/entities/entity.js:711 + src/entities/entity.js:714

    @@ -2315,6 +2337,35 @@

    morphTargets

    +
    +
    +

    outline

    + Outline + + + + + +
    +

    + Defined in + src/entities/entity.js:1035 +

    + + +
    + +
    +

    The Outline attached to this Entity.

    +

    Must be within the same Scene as this Entity. Defaults to the parent + Scene's default Outline when set to + a null or undefined value.

    +

    Fires an Entity/outline:event event on change.

    + +
    + + +

    scene

    @@ -2354,7 +2405,7 @@

    shader

    Defined in - src/entities/entity.js:746 + src/entities/entity.js:749

    @@ -2384,7 +2435,7 @@

    shaderParams

    Defined in - src/entities/entity.js:781 + src/entities/entity.js:784

    @@ -2413,7 +2464,7 @@

    stage

    Defined in - src/entities/entity.js:817 + src/entities/entity.js:820

    @@ -2442,7 +2493,7 @@

    stationary

    Defined in - src/entities/entity.js:992 + src/entities/entity.js:995

    @@ -2535,7 +2586,7 @@

    transform

    Defined in - src/entities/entity.js:852 + src/entities/entity.js:855

    @@ -2597,7 +2648,7 @@

    viewBoundary

    Defined in - src/entities/entity.js:1148 + src/entities/entity.js:1186

    @@ -2638,7 +2689,7 @@

    viewport

    Defined in - src/entities/entity.js:956 + src/entities/entity.js:959

    @@ -2667,7 +2718,7 @@

    visibility

    Defined in - src/entities/entity.js:447 + src/entities/entity.js:450

    @@ -2697,7 +2748,7 @@

    worldBoundary

    Defined in - src/entities/entity.js:1059 + src/entities/entity.js:1097

    @@ -2746,7 +2797,7 @@

    billboard

    Defined in - src/entities/entity.js:936 + src/entities/entity.js:939

    @@ -2789,7 +2840,7 @@

    camera

    Defined in - src/entities/entity.js:243 + src/entities/entity.js:246

    @@ -2831,7 +2882,7 @@

    clips

    Defined in - src/entities/entity.js:288 + src/entities/entity.js:291

    @@ -2873,7 +2924,7 @@

    colorBuf

    Defined in - src/entities/entity.js:357 + src/entities/entity.js:360

    @@ -2915,7 +2966,7 @@

    colorTarget

    Defined in - src/entities/entity.js:323 + src/entities/entity.js:326

    @@ -2957,7 +3008,7 @@

    cull

    Defined in - src/entities/entity.js:498 + src/entities/entity.js:501

    @@ -2999,7 +3050,7 @@

    depthBuf

    Defined in - src/entities/entity.js:428 + src/entities/entity.js:431

    @@ -3041,7 +3092,7 @@

    depthTarget

    Defined in - src/entities/entity.js:393 + src/entities/entity.js:396

    @@ -3108,7 +3159,7 @@

    layer

    Defined in - src/entities/entity.js:622 + src/entities/entity.js:625

    @@ -3150,7 +3201,7 @@

    lights

    Defined in - src/entities/entity.js:657 + src/entities/entity.js:660

    @@ -3192,7 +3243,7 @@

    material

    Defined in - src/entities/entity.js:692 + src/entities/entity.js:695

    @@ -3234,7 +3285,7 @@

    modes

    Defined in - src/entities/entity.js:577 + src/entities/entity.js:580

    @@ -3276,7 +3327,7 @@

    modes

    Defined in - src/entities/entity.js:534 + src/entities/entity.js:537

    @@ -3318,7 +3369,7 @@

    morphTargets

    Defined in - src/entities/entity.js:728 + src/entities/entity.js:731

    @@ -3348,6 +3399,48 @@

    Event Payload:

    +
    +
    +

    Outline

    + + + + + + +
    +

    + Defined in + src/entities/entity.js:1051 +

    + + +
    + +
    +

    Fired whenever this Entity's Entity/Outline:property property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Object + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + +

    picked

    @@ -3360,7 +3453,7 @@

    picked

    Defined in - src/entities/entity.js:163 + src/entities/entity.js:165

    @@ -3425,7 +3518,7 @@

    shader

    Defined in - src/entities/entity.js:763 + src/entities/entity.js:766

    @@ -3467,7 +3560,7 @@

    shaderParams

    Defined in - src/entities/entity.js:798 + src/entities/entity.js:801

    @@ -3509,7 +3602,7 @@

    stage

    Defined in - src/entities/entity.js:833 + src/entities/entity.js:836

    @@ -3551,7 +3644,7 @@

    stationary

    Defined in - src/entities/entity.js:1012 + src/entities/entity.js:1015

    @@ -3594,7 +3687,7 @@

    transform

    Defined in - src/entities/entity.js:876 + src/entities/entity.js:879

    @@ -3637,7 +3730,7 @@

    viewport

    Defined in - src/entities/entity.js:972 + src/entities/entity.js:975

    @@ -3680,7 +3773,7 @@

    visibility

    Defined in - src/entities/entity.js:463 + src/entities/entity.js:466

    diff --git a/docs/classes/Fog.html b/docs/classes/Fog.html index b966ba0f8..2dd00c40e 100644 --- a/docs/classes/Fog.html +++ b/docs/classes/Fog.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Fresnel.html b/docs/classes/Fresnel.html index f3a4bd2cb..89f718b68 100644 --- a/docs/classes/Fresnel.html +++ b/docs/classes/Fresnel.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Frustum.html b/docs/classes/Frustum.html index 2dbead577..b4a0fc5f5 100644 --- a/docs/classes/Frustum.html +++ b/docs/classes/Frustum.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/GLTFModel.html b/docs/classes/GLTFModel.html index d2927b163..7d28df940 100644 --- a/docs/classes/GLTFModel.html +++ b/docs/classes/GLTFModel.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Geometry.html b/docs/classes/Geometry.html index dda75d9b5..2444ff30d 100644 --- a/docs/classes/Geometry.html +++ b/docs/classes/Geometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/GeometryBuilder.html b/docs/classes/GeometryBuilder.html index 36bc43cfe..c3323fa35 100644 --- a/docs/classes/GeometryBuilder.html +++ b/docs/classes/GeometryBuilder.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/HeightmapGeometry.html b/docs/classes/HeightmapGeometry.html index 06ea4d842..7c93414a7 100644 --- a/docs/classes/HeightmapGeometry.html +++ b/docs/classes/HeightmapGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Input.html b/docs/classes/Input.html index 1172b6125..59ca369de 100644 --- a/docs/classes/Input.html +++ b/docs/classes/Input.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/LabelHelper.html b/docs/classes/LabelHelper.html index 82267326f..a2b62d917 100644 --- a/docs/classes/LabelHelper.html +++ b/docs/classes/LabelHelper.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Layer.html b/docs/classes/Layer.html index 9b1ac01bb..27358af20 100644 --- a/docs/classes/Layer.html +++ b/docs/classes/Layer.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Lights.html b/docs/classes/Lights.html index 2857cbcaa..c2de95528 100644 --- a/docs/classes/Lights.html +++ b/docs/classes/Lights.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Lookat.html b/docs/classes/Lookat.html index f3c5d1b50..0d706b68e 100644 --- a/docs/classes/Lookat.html +++ b/docs/classes/Lookat.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/LookatHelper.html b/docs/classes/LookatHelper.html index 9c74458bd..6e89598dd 100644 --- a/docs/classes/LookatHelper.html +++ b/docs/classes/LookatHelper.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Material.html b/docs/classes/Material.html index 70deab4ea..806585b49 100644 --- a/docs/classes/Material.html +++ b/docs/classes/Material.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/MetallicMaterial.html b/docs/classes/MetallicMaterial.html index a3b4d7fb9..20f151a4f 100644 --- a/docs/classes/MetallicMaterial.html +++ b/docs/classes/MetallicMaterial.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Model.html b/docs/classes/Model.html index cc5ddb452..5b1b4e2a7 100644 --- a/docs/classes/Model.html +++ b/docs/classes/Model.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Modes.html b/docs/classes/Modes.html index d34b648ff..4c502ee58 100644 --- a/docs/classes/Modes.html +++ b/docs/classes/Modes.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -238,7 +240,8 @@

    Usage

    clippable true, // Enable effect of xeogl.Clip components transparent : false, // Disable transparency backfaces : true, // Render backfaces - frontface : "ccw" + frontface : "ccw", // Front faces have counter-clockwise vertex winding + outline: false // Don't outline for emphasis }); var boxGeometry = new xeogl.BoxGeometry(); @@ -445,6 +448,17 @@

    Parameters:

  • +
  • + [outline=false] + Boolean + optional + +
    +

    Whether an outline is drawn around the attached Entities.

    + +
    + +
  • @@ -558,6 +572,10 @@

    Properties

  • metadata +
  • +
  • + outline +
  • pickable @@ -618,6 +636,10 @@

    Events

  • frontface +
  • +
  • + outline +
  • pickable @@ -1373,7 +1395,7 @@

    backfaces

    Defined in - src/rendering/modes.js:229 + src/rendering/modes.js:233

    @@ -1402,7 +1424,7 @@

    castShadow

    Defined in - src/rendering/modes.js:352 + src/rendering/modes.js:356

    @@ -1429,7 +1451,7 @@

    clippable

    Defined in - src/rendering/modes.js:147 + src/rendering/modes.js:151

    @@ -1458,7 +1480,7 @@

    collidable

    Defined in - src/rendering/modes.js:309 + src/rendering/modes.js:313

    @@ -1515,7 +1537,7 @@

    frontface

    Defined in - src/rendering/modes.js:269 + src/rendering/modes.js:273

    @@ -1634,6 +1656,33 @@

    metadata

    +
    +
    +

    outline

    + Boolean + + + + + +
    +

    + Defined in + src/rendering/modes.js:432 +

    + + +
    + +
    +

    Whether an outline is drawn around attached Entities.

    +

    Fires a outline event on change.

    + +
    + +

    Default: false

    + +

    pickable

    @@ -1646,7 +1695,7 @@

    pickable

    Defined in - src/rendering/modes.js:107 + src/rendering/modes.js:111

    @@ -1674,7 +1723,7 @@

    receiveShadow

    Defined in - src/rendering/modes.js:389 + src/rendering/modes.js:393

    @@ -1788,7 +1837,7 @@

    transparent

    Defined in - src/rendering/modes.js:187 + src/rendering/modes.js:191

    @@ -1854,7 +1903,7 @@

    backfaces

    Defined in - src/rendering/modes.js:255 + src/rendering/modes.js:259

    @@ -1896,7 +1945,7 @@

    castShadow

    Defined in - src/rendering/modes.js:375 + src/rendering/modes.js:379

    @@ -1938,7 +1987,7 @@

    clippable

    Defined in - src/rendering/modes.js:173 + src/rendering/modes.js:177

    @@ -1980,7 +2029,7 @@

    collidable

    Defined in - src/rendering/modes.js:337 + src/rendering/modes.js:341

    @@ -2047,7 +2096,7 @@

    frontface

    Defined in - src/rendering/modes.js:295 + src/rendering/modes.js:299

    @@ -2077,6 +2126,48 @@

    Event Payload:

    +
    +
    +

    outline

    + + + + + + +
    +

    + Defined in + src/rendering/modes.js:455 +

    + + +
    + +
    +

    Fired whenever this Modes' outline property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Object + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + +

    pickable

    @@ -2089,7 +2180,7 @@

    pickable

    Defined in - src/rendering/modes.js:133 + src/rendering/modes.js:137

    @@ -2131,7 +2222,7 @@

    receiveShadow

    Defined in - src/rendering/modes.js:414 + src/rendering/modes.js:418

    @@ -2173,7 +2264,7 @@

    transparent

    Defined in - src/rendering/modes.js:215 + src/rendering/modes.js:219

    diff --git a/docs/classes/Nintendo3DSGeometry.html b/docs/classes/Nintendo3DSGeometry.html index 45c39f687..71b72be98 100644 --- a/docs/classes/Nintendo3DSGeometry.html +++ b/docs/classes/Nintendo3DSGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/OBBGeometry.html b/docs/classes/OBBGeometry.html index 53fca0b0b..c6a5e6d2b 100644 --- a/docs/classes/OBBGeometry.html +++ b/docs/classes/OBBGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/OBJGeometry.html b/docs/classes/OBJGeometry.html index e3e9c46cb..09f066838 100644 --- a/docs/classes/OBJGeometry.html +++ b/docs/classes/OBJGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Ortho.html b/docs/classes/Ortho.html index c2f8634af..d22ddc880 100644 --- a/docs/classes/Ortho.html +++ b/docs/classes/Ortho.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Outline.html b/docs/classes/Outline.html new file mode 100644 index 000000000..0a367dfdd --- /dev/null +++ b/docs/classes/Outline.html @@ -0,0 +1,1663 @@ + + + + + Outline - xeogl + + + + + + + + + +
    +
    +
    + +

    xeogl / API Docs

    + +
    +
    + API Docs for: 1.0.0 +
    +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    Outline

    +
    + +
    + Extends Component +
    + +
    + Defined in: src/outline/outline.js:1 +
    + + Module: outline
    + Parent Module: xeogl + +
    + + +
    +

    A Outline renders an outline around attached Entities.

    +

    Overview

    +

    TODO

    +

    Usage

    +
    
    +var outline = new xeogl.Outline({
    +   thickness: 15,      // Default
    +   color: [1,0,0]      // Default
    +});
    +
    +new xeogl.Entity({
    +    geometry: new xeogl.TorusGeometry(),
    +    outline: outline,
    +    modes: new xeogl.Modes({
    +       outline: false  // Hide the outline (default)
    +    });
    +});
    +
    +new xeogl.Entity({
    +    geometry: new xeogl.BoxGeometry(),
    +    outline: outline,
    +    modes: new xeogl.Modes({
    +       outline: true  // Show the outline
    +    });
    +});
    +
    + +
    + +
    +

    Constructor

    +
    +

    Outline

    + +
    + (
      +
    • + [scene] +
    • +
    • + [cfg] +
    • +
    ) +
    + + + + + + + + + +
    +

    + Defined in + src/outline/outline.js:1 +

    + + + +
    + +
    + +
    + +
    +

    Parameters:

    + +
      +
    • + [scene] + Scene + optional + + +
      +

      Parent Scene, creates this Outline within the + default Scene when omitted.

      + +
      + +
    • +
    • + [cfg] + + optional + + +
      +

      Outline configuration

      + +
      + +
        +
      • + [id] + String + optional + +
        +

        Optional ID, unique among all components in the parent Scene, generated automatically when omitted.

        + +
        + +
      • +
      • + [meta] + String:Object + optional + +
        +

        Optional map of user-defined metadata to attach to this Outline.

        + +
        + +
      • +
      • + [thickness=15] + Number + optional + +
        +

        Thickness of the outline in pixels.

        + +
        + +
      • +
      • + [color=[1,1,0]] + Float32Array + optional + +
        +

        The RGB outline color.

        + +
        + +
      • +
      +
    • +
    +
    + + + +
    +
    + +
    + + +
    +
    +

    Index

    + +
    +

    Methods

    + + +
    + +
    +

    Properties

    + + +
    + + +
    +

    Events

    + + +
    +
    + +
    +

    Methods

    + +
    +

    create

    + +
    + (
      +
    • + [cfg] +
    • +
    • + [instanceId] +
    • +
    ) +
    + + + + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:910 +

    + + + +
    + +
    +

    Convenience method for creating a Component within this Component's Scene.

    +

    You would typically use this method to conveniently instantiate components that you'd want to +share (ie. "instance") among your Entities.

    +

    The method is given a component type, configuration and optional instance ID, like so:

    +
    var material = myComponent.create(xeogl.PhongMaterial, {
    +     diffuse: [1,0,0],
    +     specular: [1,1,0]
    +}, "myMaterial");
    +
    +

    The first time you call this method for the given type and instanceId, this method will create the +PhongMaterial, passing the given attributes to the component's constructor.

    +

    If you call this method again, specifying the same type and instanceId, the method will return the same +component instance that it returned the first time, and will ignore the configuration:

    +
    var material2 = component.create(xeogl.PhongMaterial, { specular: [1,1,0] }, "myMaterial");
    +
    +

    So in this example, our PhongMaterial will continue to have the red specular +and diffuse color that we specified the first time.

    +

    Each time you call this method with the same type and instanceId, the Scene will internally increment a +reference count for the component instance. You can release the shared component instance with a call to +Scene/putSharedComponent:method, and once you have released it as many +times as you got it, the Scene will destroy the component.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + [cfg] + + optional + + +
      +

      Configuration for the component instance - only used if this is the first time you are getting +the component, ignored when reusing an existing instance.

      + +
      + +
    • +
    • + [instanceId] + String | Number + optional + + +
      +

      Identifies the shared component instance. Note that this is not used as the ID of the +component - you can specify the component ID in the cfg parameter.

      + +
      + +
    • +
    +
    + +
    +

    Returns:

    + +
    + : +
    +
    + + +
    +
    +

    destroy

    + + () + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:1153 +

    + + + +
    + +
    +

    Destroys this component.

    +

    Fires a destroyed event on this Component.

    +

    Automatically disassociates this component from other components, causing them to fall back on any +defaults that this component overrode on them.

    +

    TODO: describe effect with respect to #create

    + +
    + + + + +
    +
    +

    error

    + +
    + (
      +
    • + message +
    • +
    ) +
    + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:593 +

    + + + +
    + +
    +

    Logs an error for this component to the JavaScript console.

    +

    The console message will have this format: [ERROR] [<component type> =<component id>: <message>

    +

    Also fires the message as an error event on the +parent Scene.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + message + String + + +
      +

      The message to log

      + +
      + +
    • +
    +
    + + + +
    +
    +

    fire

    + +
    + (
      +
    • + event +
    • +
    • + value +
    • +
    • + [forget=false] +
    • +
    ) +
    + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:410 +

    + + + +
    + +
    +

    Fires an event on this component.

    +

    Notifies existing subscribers to the event, optionally retains the event to give to +any subsequent notifications on the event as they are made.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + event + String + + +
      +

      The event type name

      + +
      + +
    • +
    • + value + Object + + +
      +

      The event parameters

      + +
      + +
    • +
    • + [forget=false] + Boolean + optional + + +
      +

      When true, does not retain for subsequent subscribers

      + +
      + +
    • +
    +
    + + + +
    +
    +

    isType

    + +
    + (
      +
    • + type +
    • +
    ) +
    + + + Boolean + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:361 +

    + + + +
    + +
    +

    Tests if this component is of the given type, or is a subclass of the given type.

    +

    The type may be given as either a string or a component constructor.

    +

    This method works by walking up the inheritance type chain, which this component provides in +property superTypes, returning true as soon as one of the type strings in +the chain matches the given type, of false if none match.

    +

    Examples:

    +
    var myRotate = new xeogl.Rotate({ ... });
    +
    +myRotate.isType(xeogl.Component); // Returns true for all xeogl components
    +myRotate.isType("xeogl.Component"); // Returns true for all xeogl components
    +myRotate.isType(xeogl.Rotate); // Returns true
    +myRotate.isType(xeogl.Transform); // Returns true
    +myRotate.isType("xeogl.Transform"); // Returns true
    +myRotate.isType(xeogl.Entity); // Returns false, because xeogl.Rotate does not (even indirectly) extend xeogl.Entity
    +
    + +
    + +
    +

    Parameters:

    + +
      +
    • + type + String | Function + + +
      +

      Component type to compare with, eg "xeogl.PhongMaterial", or a xeogl component constructor.

      + +
      + +
    • +
    +
    + +
    +

    Returns:

    + +
    + Boolean: +

    True if this component is of given type or is subclass of the given type.

    + +
    +
    + + +
    +
    +

    log

    + +
    + (
      +
    • + message +
    • +
    ) +
    + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:548 +

    + + + +
    + +
    +

    Logs a console debugging message for this component.

    +

    The console message will have this format: [LOG] [<component type> <component id>: <message>

    +

    Also fires the message as a log event on the +parent Scene.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + message + String + + +
      +

      The message to log

      + +
      + +
    • +
    +
    + + + +
    +
    +

    off

    + +
    + (
      +
    • + handle +
    • +
    ) +
    + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:502 +

    + + + +
    + +
    +

    Cancels an event subscription that was previously made with on or +once.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + handle + String + + +
      +

      Publication handle

      + +
      + +
    • +
    +
    + + + +
    +
    +

    on

    + +
    + (
      +
    • + event +
    • +
    • + callback +
    • +
    • + [scope=this] +
    • +
    ) +
    + + + String + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:459 +

    + + + +
    + +
    +

    Subscribes to an event on this component.

    +

    The callback is be called with this component as scope.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + event + String + + +
      +

      The event

      + +
      + +
    • +
    • + callback + Function + + +
      +

      Called fired on the event

      + +
      + +
    • +
    • + [scope=this] + Object + optional + + +
      +

      Scope for the callback

      + +
      + +
    • +
    +
    + +
    +

    Returns:

    + +
    + String: +

    Handle to the subscription, which may be used to unsubscribe with {@link #off}.

    + +
    +
    + + +
    +
    +

    once

    + +
    + (
      +
    • + event +
    • +
    • + callback +
    • +
    • + [scope=this] +
    • +
    ) +
    + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:527 +

    + + + +
    + +
    +

    Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is handled.

    +

    This is equivalent to calling on, and then calling +off inside the callback function.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + event + String + + +
      +

      Data event to listen to

      + +
      + +
    • +
    • + callback + Function(data) + + +
      +

      Called when fresh data is available at the event

      + +
      + +
    • +
    • + [scope=this] + Object + optional + + +
      +

      Scope for the callback

      + +
      + +
    • +
    +
    + + + +
    +
    +

    warn

    + +
    + (
      +
    • + message +
    • +
    ) +
    + + + + + + + + + +
    +

    Inherited from + Component: + src/component.js:573 +

    + + + +
    + +
    +

    Logs a warning for this component to the JavaScript console.

    +

    The console message will have this format: [WARN] [<component type> =<component id>: <message>

    +

    Also fires the message as a warn event on the +parent Scene.

    + +
    + +
    +

    Parameters:

    + +
      +
    • + message + String + + +
      +

      The message to log

      + +
      + +
    • +
    +
    + + + +
    +
    + +
    +

    Properties

    + +
    +

    color

    + Float32Array + + + + + +
    +

    + Defined in + src/outline/outline.js:110 +

    + + +
    + +
    +

    The Outline's RGB color.

    +

    Fires a color event on change.

    + +
    + +

    Default: [1.0, 1.0, 0.0]

    + + +
    +
    +

    destroyed

    + Boolean + + + + + +
    +

    Inherited from + Component: + src/component.js:281 +

    + + +
    + +
    +

    True as soon as this Component has been destroyed

    + +
    + + + +
    +
    +

    id

    + String + + + + final + + +
    +

    Inherited from + Component: + src/component.js:272 +

    + + +
    + +
    +

    Unique ID for this Component within its parent Scene.

    + +
    + + + +
    +
    +

    isDefault

    + Boolean + + + + + +
    +

    Inherited from + Component: + src/component.js:264 +

    + + +
    + +
    +

    Indicates whether this is one of the Scene's built-in Components.

    + +
    + + + +
    +
    +

    json

    + JSON + + + + final + + +
    +

    Inherited from + Component: + src/component.js:1029 +

    + + +
    + +
    +

    JSON object containing the state of this Component.

    + +
    + + + +
    +
    +

    metadata

    + Object + + + + + +
    +

    Inherited from + Component: + src/component.js:256 +

    + + +
    + +
    +

    Arbitrary, user-defined metadata on this component.

    + +
    + + + +
    +
    +

    scene

    + Scene + + + + final + + +
    +

    Inherited from + Component: + src/component.js:197 +

    + + +
    + +
    +

    The parent Scene that contains this Component.

    + +
    + + + +
    +
    +

    string

    + String + + + + final + + +
    +

    Inherited from + + Component + + but overwritten in + src/component.js:1056 +

    + + +
    + +
    +

    String containing the serialized JSON state of this Component.

    + +
    + + + +
    +
    +

    superTypes

    + Array of String + + + + final + + +
    +

    Inherited from + Component: + src/component.js:342 +

    + + +
    + +
    +

    An array of strings that indicates the chain of super-types within this component's inheritance hierarchy.

    +

    For example, if this component is a Rotate, which + extends Transform, which in turn extends Component, + then this property will have the value:

    +
    ["xeogl.Component", "xeogl.Transform"]
    +                    
    +

    Note that the chain is ordered downwards in the hierarchy, ie. from super-class down towards sub-class.

    + +
    + + + +
    +
    +

    thickness

    + Number + + + + + +
    +

    + Defined in + src/outline/outline.js:68 +

    + + +
    + +
    +

    The Outline's thickness in pixels.

    +

    Fires a thickness event on change.

    + +
    + +

    Default: 15

    + + +
    +
    +

    type

    + String + + + + final + + +
    +

    Inherited from + Component: + src/component.js:328 +

    + + +
    + +
    +

    JavaScript class name for this Component.

    +

    This is used when loading Scenes from JSON, and is included in the JSON + representation of this Component, so that this class may be instantiated when loading it from the JSON representation.

    +

    For example: "xeogl.AmbientLight", "xeogl.ColorTarget", "xeogl.Lights" etc.

    + +
    + + + +
    +
    + + +
    +

    Events

    + +
    +

    color

    + + + + + + +
    +

    + Defined in + src/outline/outline.js:145 +

    + + +
    + +
    +

    Fired whenever this Outline's color property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Float32Array + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + + +
    +
    +

    destroyed

    + + + + + + +
    +

    Inherited from + Component: + src/component.js:1227 +

    + + +
    + +
    +

    Fired when this Component is destroyed.

    + +
    + + + +
    +
    +

    thickness

    + + + + + + +
    +

    + Defined in + src/outline/outline.js:96 +

    + + +
    + +
    +

    Fired whenever this Outline's thickness property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Object + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/classes/Path.html b/docs/classes/Path.html index b58e51844..2daceb5d1 100644 --- a/docs/classes/Path.html +++ b/docs/classes/Path.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/PathGeometry.html b/docs/classes/PathGeometry.html index 774d3c685..3d4070dbd 100644 --- a/docs/classes/PathGeometry.html +++ b/docs/classes/PathGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Perspective.html b/docs/classes/Perspective.html index 61c7baba4..928106594 100644 --- a/docs/classes/Perspective.html +++ b/docs/classes/Perspective.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/PhongMaterial.html b/docs/classes/PhongMaterial.html index b8bb8440f..8b3535657 100644 --- a/docs/classes/PhongMaterial.html +++ b/docs/classes/PhongMaterial.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Pin.html b/docs/classes/Pin.html index ae73b58a3..e25417c92 100644 --- a/docs/classes/Pin.html +++ b/docs/classes/Pin.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/PlaneGeometry.html b/docs/classes/PlaneGeometry.html index b91713030..bad482410 100644 --- a/docs/classes/PlaneGeometry.html +++ b/docs/classes/PlaneGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/PointLight.html b/docs/classes/PointLight.html index 67b0b8c40..5755725fe 100644 --- a/docs/classes/PointLight.html +++ b/docs/classes/PointLight.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/PointLightHelper.html b/docs/classes/PointLightHelper.html index 6d207c6fb..185088754 100644 --- a/docs/classes/PointLightHelper.html +++ b/docs/classes/PointLightHelper.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -481,6 +483,10 @@

    Properties

  • morphTargets +
  • +
  • + outline +
  • pointLight @@ -601,6 +607,10 @@

    Events

  • morphTargets +
  • +
  • + Outline +
  • picked @@ -1376,7 +1386,7 @@

    billboard

    Inherited from Entity: - src/entities/entity.js:917 + src/entities/entity.js:920

    @@ -1407,7 +1417,7 @@

    camera

    Inherited from Entity: - src/entities/entity.js:223 + src/entities/entity.js:226

    @@ -1437,7 +1447,7 @@

    canvasBoundary

    Inherited from Entity: - src/entities/entity.js:1216 + src/entities/entity.js:1254

    @@ -1479,7 +1489,7 @@

    clips

    Inherited from Entity: - src/entities/entity.js:272 + src/entities/entity.js:275

    @@ -1508,7 +1518,7 @@

    colorBuf

    Inherited from Entity: - src/entities/entity.js:341 + src/entities/entity.js:344

    @@ -1538,7 +1548,7 @@

    colorTarget

    Inherited from Entity: - src/entities/entity.js:306 + src/entities/entity.js:309

    @@ -1567,7 +1577,7 @@

    cull

    Inherited from Entity: - src/entities/entity.js:482 + src/entities/entity.js:485

    @@ -1596,7 +1606,7 @@

    depthBuf

    Inherited from Entity: - src/entities/entity.js:412 + src/entities/entity.js:415

    @@ -1626,7 +1636,7 @@

    depthTarget

    Inherited from Entity: - src/entities/entity.js:376 + src/entities/entity.js:379

    @@ -1680,7 +1690,7 @@

    geometry

    Inherited from Entity: - src/entities/entity.js:553 + src/entities/entity.js:556

    @@ -1713,7 +1723,7 @@

    glsl

    Inherited from Entity: - src/entities/entity.js:1285 + src/entities/entity.js:1323

    @@ -1742,7 +1752,7 @@

    glslString

    Inherited from Entity: - src/entities/entity.js:1322 + src/entities/entity.js:1360

    @@ -1847,7 +1857,7 @@

    layer

    Inherited from Entity: - src/entities/entity.js:606 + src/entities/entity.js:609

    @@ -1876,7 +1886,7 @@

    lights

    Inherited from Entity: - src/entities/entity.js:641 + src/entities/entity.js:644

    @@ -1906,7 +1916,7 @@

    localBoundary

    Inherited from Entity: - src/entities/entity.js:1032 + src/entities/entity.js:1070

    @@ -1941,7 +1951,7 @@

    material

    Inherited from Entity: - src/entities/entity.js:676 + src/entities/entity.js:679

    @@ -1995,7 +2005,7 @@

    modes

    Inherited from Entity: - src/entities/entity.js:518 + src/entities/entity.js:521

    @@ -2025,7 +2035,7 @@

    morphTargets

    Inherited from Entity: - src/entities/entity.js:711 + src/entities/entity.js:714

    @@ -2042,6 +2052,35 @@

    morphTargets

    +
    +
    +

    outline

    + Outline + + + + + +
    +

    Inherited from + Entity: + src/entities/entity.js:1035 +

    + + +
    + +
    +

    The Outline attached to this Entity.

    +

    Must be within the same Scene as this Entity. Defaults to the parent + Scene's default Outline when set to + a null or undefined value.

    +

    Fires an Entity/outline:event event on change.

    + +
    + + +

    pointLight

    @@ -2107,7 +2146,7 @@

    shader

    Inherited from Entity: - src/entities/entity.js:746 + src/entities/entity.js:749

    @@ -2137,7 +2176,7 @@

    shaderParams

    Inherited from Entity: - src/entities/entity.js:781 + src/entities/entity.js:784

    @@ -2166,7 +2205,7 @@

    stage

    Inherited from Entity: - src/entities/entity.js:817 + src/entities/entity.js:820

    @@ -2195,7 +2234,7 @@

    stationary

    Inherited from Entity: - src/entities/entity.js:992 + src/entities/entity.js:995

    @@ -2288,7 +2327,7 @@

    transform

    Inherited from Entity: - src/entities/entity.js:852 + src/entities/entity.js:855

    @@ -2350,7 +2389,7 @@

    viewBoundary

    Inherited from Entity: - src/entities/entity.js:1148 + src/entities/entity.js:1186

    @@ -2391,7 +2430,7 @@

    viewport

    Inherited from Entity: - src/entities/entity.js:956 + src/entities/entity.js:959

    @@ -2420,7 +2459,7 @@

    visibility

    Inherited from Entity: - src/entities/entity.js:447 + src/entities/entity.js:450

    @@ -2450,7 +2489,7 @@

    worldBoundary

    Inherited from Entity: - src/entities/entity.js:1059 + src/entities/entity.js:1097

    @@ -2499,7 +2538,7 @@

    billboard

    Inherited from Entity: - src/entities/entity.js:936 + src/entities/entity.js:939

    @@ -2542,7 +2581,7 @@

    camera

    Inherited from Entity: - src/entities/entity.js:243 + src/entities/entity.js:246

    @@ -2584,7 +2623,7 @@

    clips

    Inherited from Entity: - src/entities/entity.js:288 + src/entities/entity.js:291

    @@ -2626,7 +2665,7 @@

    colorBuf

    Inherited from Entity: - src/entities/entity.js:357 + src/entities/entity.js:360

    @@ -2668,7 +2707,7 @@

    colorTarget

    Inherited from Entity: - src/entities/entity.js:323 + src/entities/entity.js:326

    @@ -2710,7 +2749,7 @@

    cull

    Inherited from Entity: - src/entities/entity.js:498 + src/entities/entity.js:501

    @@ -2752,7 +2791,7 @@

    depthBuf

    Inherited from Entity: - src/entities/entity.js:428 + src/entities/entity.js:431

    @@ -2794,7 +2833,7 @@

    depthTarget

    Inherited from Entity: - src/entities/entity.js:393 + src/entities/entity.js:396

    @@ -2861,7 +2900,7 @@

    layer

    Inherited from Entity: - src/entities/entity.js:622 + src/entities/entity.js:625

    @@ -2903,7 +2942,7 @@

    lights

    Inherited from Entity: - src/entities/entity.js:657 + src/entities/entity.js:660

    @@ -2945,7 +2984,7 @@

    material

    Inherited from Entity: - src/entities/entity.js:692 + src/entities/entity.js:695

    @@ -2990,7 +3029,7 @@

    modes

    Entity but overwritten in - src/entities/entity.js:534 + src/entities/entity.js:537

    @@ -3032,7 +3071,7 @@

    morphTargets

    Inherited from Entity: - src/entities/entity.js:728 + src/entities/entity.js:731

    @@ -3062,6 +3101,48 @@

    Event Payload:

    +
    +
    +

    Outline

    + + + + + + +
    +

    Inherited from + Entity: + src/entities/entity.js:1051 +

    + + +
    + +
    +

    Fired whenever this Entity's Entity/Outline:property property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Object + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + +

    picked

    @@ -3074,7 +3155,7 @@

    picked

    Inherited from Entity: - src/entities/entity.js:163 + src/entities/entity.js:165

    @@ -3139,7 +3220,7 @@

    shader

    Inherited from Entity: - src/entities/entity.js:763 + src/entities/entity.js:766

    @@ -3181,7 +3262,7 @@

    shaderParams

    Inherited from Entity: - src/entities/entity.js:798 + src/entities/entity.js:801

    @@ -3223,7 +3304,7 @@

    stage

    Inherited from Entity: - src/entities/entity.js:833 + src/entities/entity.js:836

    @@ -3265,7 +3346,7 @@

    stationary

    Inherited from Entity: - src/entities/entity.js:1012 + src/entities/entity.js:1015

    @@ -3308,7 +3389,7 @@

    transform

    Inherited from Entity: - src/entities/entity.js:876 + src/entities/entity.js:879

    @@ -3351,7 +3432,7 @@

    viewport

    Inherited from Entity: - src/entities/entity.js:972 + src/entities/entity.js:975

    @@ -3394,7 +3475,7 @@

    visibility

    Inherited from Entity: - src/entities/entity.js:463 + src/entities/entity.js:466

    diff --git a/docs/classes/PointMarkings.html b/docs/classes/PointMarkings.html index b3e7058ad..2fba15082 100644 --- a/docs/classes/PointMarkings.html +++ b/docs/classes/PointMarkings.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/QuadraticBezierCurve.html b/docs/classes/QuadraticBezierCurve.html index 1cffe595d..aca3baafb 100644 --- a/docs/classes/QuadraticBezierCurve.html +++ b/docs/classes/QuadraticBezierCurve.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Quaternion.html b/docs/classes/Quaternion.html index 233d0ea56..a5545672e 100644 --- a/docs/classes/Quaternion.html +++ b/docs/classes/Quaternion.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Rotate.html b/docs/classes/Rotate.html index 6810dacc4..d1095abbd 100644 --- a/docs/classes/Rotate.html +++ b/docs/classes/Rotate.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Scale.html b/docs/classes/Scale.html index 2283cee57..bab1b613d 100644 --- a/docs/classes/Scale.html +++ b/docs/classes/Scale.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Scene.html b/docs/classes/Scene.html index 014933a4c..6fef72fbf 100644 --- a/docs/classes/Scene.html +++ b/docs/classes/Scene.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -710,6 +712,10 @@

    Properties

  • morphTargets +
  • +
  • + outline +
  • passes @@ -871,7 +877,7 @@

    _getSharedComponent

    Defined in - src/scene.js:1735 + src/scene.js:1762

    @@ -956,7 +962,7 @@

    clear

    Defined in - src/scene.js:1709 + src/scene.js:1736

    @@ -1659,7 +1665,7 @@

    pick

    Defined in - src/scene.js:1397 + src/scene.js:1424

    @@ -1832,7 +1838,7 @@

    render

    Defined in - src/scene.js:531 + src/scene.js:532

    @@ -1945,7 +1951,7 @@

    billboard

    Defined in - src/scene.js:818 + src/scene.js:819

    @@ -1975,7 +1981,7 @@

    camera

    Defined in - src/scene.js:769 + src/scene.js:770

    @@ -2030,7 +2036,7 @@

    clearEachPass

    Defined in - src/scene.js:679 + src/scene.js:680

    @@ -2059,7 +2065,7 @@

    clips

    Defined in - src/scene.js:866 + src/scene.js:867

    @@ -2089,7 +2095,7 @@

    colorBuf

    Defined in - src/scene.js:889 + src/scene.js:890

    @@ -2120,7 +2126,7 @@

    colorTarget

    Defined in - src/scene.js:912 + src/scene.js:913

    @@ -2206,7 +2212,7 @@

    cull

    Defined in - src/scene.js:1009 + src/scene.js:1010

    @@ -2236,7 +2242,7 @@

    depthBuf

    Defined in - src/scene.js:937 + src/scene.js:938

    @@ -2267,7 +2273,7 @@

    depthTarget

    Defined in - src/scene.js:961 + src/scene.js:962

    @@ -2351,7 +2357,7 @@

    geometry

    Defined in - src/scene.js:1054 + src/scene.js:1055

    @@ -2483,7 +2489,7 @@

    layer

    Defined in - src/scene.js:1075 + src/scene.js:1076

    @@ -2513,7 +2519,7 @@

    lights

    Defined in - src/scene.js:1098 + src/scene.js:1099

    @@ -2544,7 +2550,7 @@

    material

    Defined in - src/scene.js:1171 + src/scene.js:1172

    @@ -2600,7 +2606,7 @@

    modes

    Defined in - src/scene.js:1032 + src/scene.js:1033

    @@ -2631,7 +2637,7 @@

    morphTargets

    Defined in - src/scene.js:1194 + src/scene.js:1195

    @@ -2648,6 +2654,38 @@

    morphTargets

    +
    +
    +

    outline

    + Outline + + + + final + + +
    +

    + Defined in + src/scene.js:1315 +

    + + +
    + +
    +

    The default Outline provided by this Scene.

    +

    This Outline has + an id equal to "default.outline", + a color set to [1,1,0] + a thickness set to 15.

    +

    Entities within this Scene are attached to this + Outline by default.

    + +
    + + +

    passes

    @@ -2660,7 +2698,7 @@

    passes

    Defined in - src/scene.js:633 + src/scene.js:634

    @@ -2688,7 +2726,7 @@

    project

    Defined in - src/scene.js:718 + src/scene.js:719

    @@ -2749,7 +2787,7 @@

    shader

    Defined in - src/scene.js:1217 + src/scene.js:1218

    @@ -2781,7 +2819,7 @@

    shaderParams

    Defined in - src/scene.js:1241 + src/scene.js:1242

    @@ -2811,7 +2849,7 @@

    stage

    Defined in - src/scene.js:1265 + src/scene.js:1266

    @@ -2842,7 +2880,7 @@

    stationary

    Defined in - src/scene.js:842 + src/scene.js:843

    @@ -2932,7 +2970,7 @@

    ticksPerRender

    Defined in - src/scene.js:589 + src/scene.js:590

    @@ -2985,7 +3023,7 @@

    transform

    Defined in - src/scene.js:794 + src/scene.js:795

    @@ -3070,7 +3108,7 @@

    view

    Defined in - src/scene.js:746 + src/scene.js:747

    @@ -3100,7 +3138,7 @@

    viewport

    Defined in - src/scene.js:1289 + src/scene.js:1290

    @@ -3131,7 +3169,7 @@

    visibility

    Defined in - src/scene.js:986 + src/scene.js:987

    @@ -3161,7 +3199,7 @@

    worldBoundary

    Defined in - src/scene.js:1314 + src/scene.js:1341

    @@ -3201,7 +3239,7 @@

    clearEachPass

    Defined in - src/scene.js:703 + src/scene.js:704

    @@ -3243,7 +3281,7 @@

    componentCreated

    Defined in - src/scene.js:454 + src/scene.js:455

    @@ -3285,7 +3323,7 @@

    componentDestroyed

    Defined in - src/scene.js:496 + src/scene.js:497

    @@ -3436,7 +3474,7 @@

    passes

    Defined in - src/scene.js:665 + src/scene.js:666

    @@ -3478,7 +3516,7 @@

    rendering

    Defined in - src/scene.js:575 + src/scene.js:576

    @@ -3531,7 +3569,7 @@

    rendering

    Defined in - src/scene.js:562 + src/scene.js:563

    @@ -3584,7 +3622,7 @@

    ticksPerRender

    Defined in - src/scene.js:619 + src/scene.js:620

    diff --git a/docs/classes/SceneJSModel.html b/docs/classes/SceneJSModel.html index 0043848e7..b12615bdc 100644 --- a/docs/classes/SceneJSModel.html +++ b/docs/classes/SceneJSModel.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Shader.html b/docs/classes/Shader.html index 1aec282f3..1998d5f14 100644 --- a/docs/classes/Shader.html +++ b/docs/classes/Shader.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/ShaderParams.html b/docs/classes/ShaderParams.html index ce6540c3a..020b21178 100644 --- a/docs/classes/ShaderParams.html +++ b/docs/classes/ShaderParams.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Shadow.html b/docs/classes/Shadow.html index e0e875ae7..f2016e7a6 100644 --- a/docs/classes/Shadow.html +++ b/docs/classes/Shadow.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Skybox.html b/docs/classes/Skybox.html index cd7b6c2be..2de159dda 100644 --- a/docs/classes/Skybox.html +++ b/docs/classes/Skybox.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/SpecularMaterial.html b/docs/classes/SpecularMaterial.html index ecdf32975..4c56b732c 100644 --- a/docs/classes/SpecularMaterial.html +++ b/docs/classes/SpecularMaterial.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/SphereGeometry.html b/docs/classes/SphereGeometry.html index 0c6b96cca..17e2e8560 100644 --- a/docs/classes/SphereGeometry.html +++ b/docs/classes/SphereGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Spinner.html b/docs/classes/Spinner.html index 6ab718b88..977ddf4d8 100644 --- a/docs/classes/Spinner.html +++ b/docs/classes/Spinner.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/SplineCurve.html b/docs/classes/SplineCurve.html index 20889d368..8c8c5066c 100644 --- a/docs/classes/SplineCurve.html +++ b/docs/classes/SplineCurve.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/SplineCurveHelper.html b/docs/classes/SplineCurveHelper.html index 77d28801c..9d0bc6da7 100644 --- a/docs/classes/SplineCurveHelper.html +++ b/docs/classes/SplineCurveHelper.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/SpotLight.html b/docs/classes/SpotLight.html index 86b853914..6c7d04f00 100644 --- a/docs/classes/SpotLight.html +++ b/docs/classes/SpotLight.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html index 984b3e819..77ba65faa 100644 --- a/docs/classes/Stage.html +++ b/docs/classes/Stage.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Stationary.html b/docs/classes/Stationary.html index 96c901261..94afaa6e1 100644 --- a/docs/classes/Stationary.html +++ b/docs/classes/Stationary.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/StereoEffect.html b/docs/classes/StereoEffect.html index d03684932..b864340fa 100644 --- a/docs/classes/StereoEffect.html +++ b/docs/classes/StereoEffect.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -590,6 +592,10 @@

    Properties

  • morphTargets +
  • +
  • + outline +
  • scene @@ -726,6 +732,10 @@

    Events

  • morphTargets +
  • +
  • + Outline +
  • picked @@ -1559,7 +1569,7 @@

    billboard

    Inherited from Entity: - src/entities/entity.js:917 + src/entities/entity.js:920

    @@ -1625,7 +1635,7 @@

    canvasBoundary

    Inherited from Entity: - src/entities/entity.js:1216 + src/entities/entity.js:1254

    @@ -1667,7 +1677,7 @@

    clips

    Inherited from Entity: - src/entities/entity.js:272 + src/entities/entity.js:275

    @@ -1696,7 +1706,7 @@

    colorBuf

    Inherited from Entity: - src/entities/entity.js:341 + src/entities/entity.js:344

    @@ -1726,7 +1736,7 @@

    colorTarget

    Inherited from Entity: - src/entities/entity.js:306 + src/entities/entity.js:309

    @@ -1755,7 +1765,7 @@

    cull

    Inherited from Entity: - src/entities/entity.js:482 + src/entities/entity.js:485

    @@ -1784,7 +1794,7 @@

    depthBuf

    Inherited from Entity: - src/entities/entity.js:412 + src/entities/entity.js:415

    @@ -1814,7 +1824,7 @@

    depthTarget

    Inherited from Entity: - src/entities/entity.js:376 + src/entities/entity.js:379

    @@ -1922,7 +1932,7 @@

    geometry

    Inherited from Entity: - src/entities/entity.js:553 + src/entities/entity.js:556

    @@ -1955,7 +1965,7 @@

    glsl

    Inherited from Entity: - src/entities/entity.js:1285 + src/entities/entity.js:1323

    @@ -1984,7 +1994,7 @@

    glslString

    Inherited from Entity: - src/entities/entity.js:1322 + src/entities/entity.js:1360

    @@ -2089,7 +2099,7 @@

    layer

    Inherited from Entity: - src/entities/entity.js:606 + src/entities/entity.js:609

    @@ -2118,7 +2128,7 @@

    lights

    Inherited from Entity: - src/entities/entity.js:641 + src/entities/entity.js:644

    @@ -2148,7 +2158,7 @@

    localBoundary

    Inherited from Entity: - src/entities/entity.js:1032 + src/entities/entity.js:1070

    @@ -2183,7 +2193,7 @@

    material

    Inherited from Entity: - src/entities/entity.js:676 + src/entities/entity.js:679

    @@ -2237,7 +2247,7 @@

    modes

    Inherited from Entity: - src/entities/entity.js:518 + src/entities/entity.js:521

    @@ -2267,7 +2277,7 @@

    morphTargets

    Inherited from Entity: - src/entities/entity.js:711 + src/entities/entity.js:714

    @@ -2284,6 +2294,35 @@

    morphTargets

    +
    +
    +

    outline

    + Outline + + + + + +
    +

    Inherited from + Entity: + src/entities/entity.js:1035 +

    + + +
    + +
    +

    The Outline attached to this Entity.

    +

    Must be within the same Scene as this Entity. Defaults to the parent + Scene's default Outline when set to + a null or undefined value.

    +

    Fires an Entity/outline:event event on change.

    + +
    + + +

    scene

    @@ -2323,7 +2362,7 @@

    shader

    Inherited from Entity: - src/entities/entity.js:746 + src/entities/entity.js:749

    @@ -2353,7 +2392,7 @@

    shaderParams

    Inherited from Entity: - src/entities/entity.js:781 + src/entities/entity.js:784

    @@ -2382,7 +2421,7 @@

    stage

    Inherited from Entity: - src/entities/entity.js:817 + src/entities/entity.js:820

    @@ -2411,7 +2450,7 @@

    stationary

    Inherited from Entity: - src/entities/entity.js:992 + src/entities/entity.js:995

    @@ -2504,7 +2543,7 @@

    transform

    Inherited from Entity: - src/entities/entity.js:852 + src/entities/entity.js:855

    @@ -2566,7 +2605,7 @@

    viewBoundary

    Inherited from Entity: - src/entities/entity.js:1148 + src/entities/entity.js:1186

    @@ -2607,7 +2646,7 @@

    viewport

    Inherited from Entity: - src/entities/entity.js:956 + src/entities/entity.js:959

    @@ -2664,7 +2703,7 @@

    visibility

    Inherited from Entity: - src/entities/entity.js:447 + src/entities/entity.js:450

    @@ -2694,7 +2733,7 @@

    worldBoundary

    Inherited from Entity: - src/entities/entity.js:1059 + src/entities/entity.js:1097

    @@ -2827,7 +2866,7 @@

    billboard

    Inherited from Entity: - src/entities/entity.js:936 + src/entities/entity.js:939

    @@ -2916,7 +2955,7 @@

    clips

    Inherited from Entity: - src/entities/entity.js:288 + src/entities/entity.js:291

    @@ -2958,7 +2997,7 @@

    colorBuf

    Inherited from Entity: - src/entities/entity.js:357 + src/entities/entity.js:360

    @@ -3000,7 +3039,7 @@

    colorTarget

    Inherited from Entity: - src/entities/entity.js:323 + src/entities/entity.js:326

    @@ -3042,7 +3081,7 @@

    cull

    Inherited from Entity: - src/entities/entity.js:498 + src/entities/entity.js:501

    @@ -3084,7 +3123,7 @@

    depthBuf

    Inherited from Entity: - src/entities/entity.js:428 + src/entities/entity.js:431

    @@ -3126,7 +3165,7 @@

    depthTarget

    Inherited from Entity: - src/entities/entity.js:393 + src/entities/entity.js:396

    @@ -3277,7 +3316,7 @@

    layer

    Inherited from Entity: - src/entities/entity.js:622 + src/entities/entity.js:625

    @@ -3319,7 +3358,7 @@

    lights

    Inherited from Entity: - src/entities/entity.js:657 + src/entities/entity.js:660

    @@ -3361,7 +3400,7 @@

    material

    Inherited from Entity: - src/entities/entity.js:692 + src/entities/entity.js:695

    @@ -3406,7 +3445,7 @@

    modes

    Entity but overwritten in - src/entities/entity.js:534 + src/entities/entity.js:537

    @@ -3448,7 +3487,7 @@

    morphTargets

    Inherited from Entity: - src/entities/entity.js:728 + src/entities/entity.js:731

    @@ -3478,6 +3517,48 @@

    Event Payload:

    +
    +
    +

    Outline

    + + + + + + +
    +

    Inherited from + Entity: + src/entities/entity.js:1051 +

    + + +
    + +
    +

    Fired whenever this Entity's Entity/Outline:property property changes.

    + +
    + +
    +

    Event Payload:

    + +
      +
    • + value + Object + + +
      +

      The property's new value

      + +
      + +
    • +
    +
    + +

    picked

    @@ -3490,7 +3571,7 @@

    picked

    Inherited from Entity: - src/entities/entity.js:163 + src/entities/entity.js:165

    @@ -3555,7 +3636,7 @@

    shader

    Inherited from Entity: - src/entities/entity.js:763 + src/entities/entity.js:766

    @@ -3597,7 +3678,7 @@

    shaderParams

    Inherited from Entity: - src/entities/entity.js:798 + src/entities/entity.js:801

    @@ -3639,7 +3720,7 @@

    stage

    Inherited from Entity: - src/entities/entity.js:833 + src/entities/entity.js:836

    @@ -3681,7 +3762,7 @@

    stationary

    Inherited from Entity: - src/entities/entity.js:1012 + src/entities/entity.js:1015

    @@ -3724,7 +3805,7 @@

    transform

    Inherited from Entity: - src/entities/entity.js:876 + src/entities/entity.js:879

    @@ -3810,7 +3891,7 @@

    viewport

    Inherited from Entity: - src/entities/entity.js:972 + src/entities/entity.js:975

    @@ -3853,7 +3934,7 @@

    visibility

    Inherited from Entity: - src/entities/entity.js:463 + src/entities/entity.js:466

    diff --git a/docs/classes/Story.html b/docs/classes/Story.html index 82419d061..1100e389c 100644 --- a/docs/classes/Story.html +++ b/docs/classes/Story.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/TeapotGeometry.html b/docs/classes/TeapotGeometry.html index e96845439..220025a8e 100644 --- a/docs/classes/TeapotGeometry.html +++ b/docs/classes/TeapotGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html index 41cd9bf0a..552cddd87 100644 --- a/docs/classes/Texture.html +++ b/docs/classes/Texture.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/TorusGeometry.html b/docs/classes/TorusGeometry.html index 0d2fab788..0f42d16ef 100644 --- a/docs/classes/TorusGeometry.html +++ b/docs/classes/TorusGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Transform.html b/docs/classes/Transform.html index 5713e229d..351ce7727 100644 --- a/docs/classes/Transform.html +++ b/docs/classes/Transform.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Translate.html b/docs/classes/Translate.html index 9dc578cd2..eda1ee698 100644 --- a/docs/classes/Translate.html +++ b/docs/classes/Translate.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/VectorTextGeometry.html b/docs/classes/VectorTextGeometry.html index e6f223228..f144869f7 100644 --- a/docs/classes/VectorTextGeometry.html +++ b/docs/classes/VectorTextGeometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Viewport.html b/docs/classes/Viewport.html index 4f0e1cd28..1d73fcac2 100644 --- a/docs/classes/Viewport.html +++ b/docs/classes/Viewport.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/Visibility.html b/docs/classes/Visibility.html index 32154620d..20b818dfa 100644 --- a/docs/classes/Visibility.html +++ b/docs/classes/Visibility.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/ZSpaceEffect.html b/docs/classes/ZSpaceEffect.html index 2fb51be58..29b1db1db 100644 --- a/docs/classes/ZSpaceEffect.html +++ b/docs/classes/ZSpaceEffect.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/ZSpaceStylusControl.html b/docs/classes/ZSpaceStylusControl.html index 29a274903..b29ef4fea 100644 --- a/docs/classes/ZSpaceStylusControl.html +++ b/docs/classes/ZSpaceStylusControl.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/xeogl.html b/docs/classes/xeogl.html index 776689bd6..7ade75fca 100644 --- a/docs/classes/xeogl.html +++ b/docs/classes/xeogl.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/classes/xeogl.math.math.html b/docs/classes/xeogl.math.math.html index af3fc8558..dd20636d3 100644 --- a/docs/classes/xeogl.math.math.html +++ b/docs/classes/xeogl.math.math.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/data.json b/docs/data.json index c5bb7a58e..146024ee1 100644 --- a/docs/data.json +++ b/docs/data.json @@ -147,6 +147,13 @@ "fors": {}, "namespaces": {} }, + "src/_renderer/renderer.new.js": { + "name": "src/_renderer/renderer.new.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, "src/_renderer/renderer.old.js": { "name": "src/_renderer/renderer.old.js", "modules": {}, @@ -821,6 +828,24 @@ "fors": {}, "namespaces": {} }, + "src/outline/_module.js": { + "name": "src/outline/_module.js", + "modules": { + "outline": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "src/outline/outline.js": { + "name": "src/outline/outline.js", + "modules": {}, + "classes": { + "Outline": 1 + }, + "fors": {}, + "namespaces": {} + }, "src/rendering/_module.js": { "name": "src/rendering/_module.js", "modules": { @@ -1510,6 +1535,7 @@ "materials": 1, "math": 1, "models": 1, + "outline": 1, "rendering": 1, "shaders": 1, "transforms": 1, @@ -1566,6 +1592,7 @@ "xeogl.math.math": 1, "GLTFModel": 1, "Model": 1, + "Outline": 1, "ColorBuf": 1, "DepthBuf": 1, "Layer": 1, @@ -2081,6 +2108,21 @@ "line": 1, "description": "Models are units of xeogl content." }, + "outline": { + "name": "outline", + "submodules": {}, + "classes": { + "Outline": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": {}, + "module": "xeogl", + "namespace": "", + "file": "src/outline/outline.js", + "line": 1, + "description": "An outline rendering effect for emphasis." + }, "rendering": { "name": "rendering", "submodules": {}, @@ -3206,6 +3248,12 @@ "type": "String|Viewport", "optional": true }, + { + "name": "outline", + "description": "ID or instance of a {{#crossLink \"Outline\"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default instance,\n{{#crossLink \"Scene/outline:property\"}}{{/crossLink}}.", + "type": "String|Outline", + "optional": true + }, { "name": "loading", "description": "Flag which indicates that this Entity is freshly loaded. This will increment the\n{{#crossLink \"Spinner/processes:property\"}}Spinner processes{{/crossLink}} count, and then when this Entity is first\nrendered, will decrement the count again.", @@ -5420,6 +5468,65 @@ ], "extends": "Component" }, + "Outline": { + "name": "Outline", + "shortname": "Outline", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "xeogl", + "namespace": "", + "file": "src/outline/outline.js", + "line": 1, + "description": "A **Outline** renders an outline around attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\n## Overview\n\nTODO\n\n## Usage\n\n````javascript\n\nvar outline = new xeogl.Outline({\n thickness: 15, // Default\n color: [1,0,0] // Default\n});\n\nnew xeogl.Entity({\n geometry: new xeogl.TorusGeometry(),\n outline: outline,\n modes: new xeogl.Modes({\n outline: false // Hide the outline (default)\n });\n});\n\nnew xeogl.Entity({\n geometry: new xeogl.BoxGeometry(),\n outline: outline,\n modes: new xeogl.Modes({\n outline: true // Show the outline\n });\n});\n````", + "submodule": "outline", + "is_constructor": 1, + "params": [ + { + "name": "scene", + "description": "Parent {{#crossLink \"Scene\"}}Scene{{/crossLink}}, creates this Outline within the\ndefault {{#crossLink \"Scene\"}}Scene{{/crossLink}} when omitted.", + "type": "Scene", + "optional": true + }, + { + "name": "cfg", + "description": "Outline configuration", + "type": "*", + "optional": true, + "props": [ + { + "name": "id", + "description": "Optional ID, unique among all components in the parent {{#crossLink \"Scene\"}}Scene{{/crossLink}}, generated automatically when omitted.", + "type": "String", + "optional": true + }, + { + "name": "meta", + "description": "Optional map of user-defined metadata to attach to this Outline.", + "type": "String:Object", + "optional": true + }, + { + "name": "thickness", + "description": "Thickness of the outline in pixels.", + "type": "Number", + "optional": true, + "optdefault": "15" + }, + { + "name": "color", + "description": "The RGB outline color.", + "type": "Float32Array", + "optional": true, + "optdefault": "[1,1,0]" + } + ] + } + ], + "extends": "Component" + }, "ColorBuf": { "name": "ColorBuf", "shortname": "ColorBuf", @@ -5609,7 +5716,7 @@ "namespace": "", "file": "src/rendering/modes.js", "line": 1, - "description": "A **Modes** toggles various xeogl modes and capabilities for attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\n## Overview\n\n* Though the rendering modes are defined by various different components attached to the {{#crossLink \"Entity\"}}Entities{{/crossLink}},\nModes components provide a single point through which you can toggle them on or off.\n* A Modes may be shared among multiple {{#crossLink \"Entity\"}}Entities{{/crossLink}} to toggle\nrendering modes for them as a group.\n\n\n\n## Usage\n\nIn this example we have a Modes that toggles rendering modes for two {{#crossLink \"Entity\"}}Entities{{/crossLink}}. The\nproperties of the Modes are initialised to their default values.\n\n````javascript\n// Create a Modes with default properties\nvar modes = new xeogl.Modes(scene, {\n collidable: true, // Include Entities in boundary calculations\n pickable: true, // Enable picking\n clippable true, // Enable effect of xeogl.Clip components\n transparent : false, // Disable transparency\n backfaces : true, // Render backfaces\n frontface : \"ccw\"\n});\n\nvar boxGeometry = new xeogl.BoxGeometry();\n\n// Create two Entities whose rendering modes will be controlled by our Modes\n\nvar entity1 = new xeogl.Entity({\n geometry: boxGeometry,\n modes: modes,\n translate: new xeogl.Translate({\n xyz: [3, 0, 0]\n })\n});\n\nvar entity2 = new xeogl.Entity(scene, {\n geometry: boxGeometry,\n modes: modes,\n translate: new xeogl.Translate({\n xyz: [3, 0, 0]\n })\n});\n````", + "description": "A **Modes** toggles various xeogl modes and capabilities for attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\n## Overview\n\n* Though the rendering modes are defined by various different components attached to the {{#crossLink \"Entity\"}}Entities{{/crossLink}},\nModes components provide a single point through which you can toggle them on or off.\n* A Modes may be shared among multiple {{#crossLink \"Entity\"}}Entities{{/crossLink}} to toggle\nrendering modes for them as a group.\n\n\n\n## Usage\n\nIn this example we have a Modes that toggles rendering modes for two {{#crossLink \"Entity\"}}Entities{{/crossLink}}. The\nproperties of the Modes are initialised to their default values.\n\n````javascript\n// Create a Modes with default properties\nvar modes = new xeogl.Modes(scene, {\n collidable: true, // Include Entities in boundary calculations\n pickable: true, // Enable picking\n clippable true, // Enable effect of xeogl.Clip components\n transparent : false, // Disable transparency\n backfaces : true, // Render backfaces\n frontface : \"ccw\", // Front faces have counter-clockwise vertex winding\n outline: false // Don't outline for emphasis\n});\n\nvar boxGeometry = new xeogl.BoxGeometry();\n\n// Create two Entities whose rendering modes will be controlled by our Modes\n\nvar entity1 = new xeogl.Entity({\n geometry: boxGeometry,\n modes: modes,\n translate: new xeogl.Translate({\n xyz: [3, 0, 0]\n })\n});\n\nvar entity2 = new xeogl.Entity(scene, {\n geometry: boxGeometry,\n modes: modes,\n translate: new xeogl.Translate({\n xyz: [3, 0, 0]\n })\n});\n````", "submodule": "rendering", "is_constructor": 1, "params": [ @@ -5692,6 +5799,13 @@ "type": "Boolean", "optional": true, "optdefault": "true" + }, + { + "name": "outline", + "description": "Whether an outline is drawn around the attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.", + "type": "Boolean", + "optional": true, + "optdefault": "false" } ] } @@ -9252,51 +9366,64 @@ { "file": "src/_renderer/program.js", "line": 55, + "description": "The outline program", + "type": "webgl.Program", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/program.js", + "line": 61, "description": "The count of display objects using this program", "type": "Number", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/program.js", - "line": 61, + "line": 67, "description": "True when successfully allocated", "type": "{boolean}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/program.js", - "line": 67, + "line": 73, "description": "True when successfully compiled", "type": "{boolean}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/program.js", - "line": 73, + "line": 79, "description": "True when successfully linked", "type": "{boolean}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/program.js", - "line": 79, + "line": 85, "description": "True when successfully validated", "type": "{boolean}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/program.js", - "line": 85, + "line": 91, "description": "Contains error log on failure to allocate, compile, validate or link", "type": "{boolean}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/program.js", - "line": 95, + "line": 101, "description": "Creates the render and pick programs.\n This is also re-called to re-create them after WebGL context loss.", "class": "CameraFlightAnimation" }, + { + "file": "src/_renderer/program.js", + "line": 230, + "description": "Destroys this program.", + "class": "CameraFlightAnimation" + }, { "file": "src/_renderer/programFactory.js", "line": 5, @@ -9327,7 +9454,7 @@ }, { "file": "src/_renderer/programFactory.js", - "line": 75, + "line": 72, "description": "Rebuild all programs in the pool after WebGL context was lost and restored.", "class": "CameraFlightAnimation" }, @@ -9380,76 +9507,100 @@ "name": "fragmentShadow", "description": "Fragment shader source for drawing the shadow buffer.", "type": "String" + }, + { + "name": "vertexOutline", + "description": "Vertex shader source for drawing outlines.", + "type": "String" + }, + { + "name": "fragmentOutline", + "description": "Fragment shader source for drawing outlines.", + "type": "String" } ], "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 24, + "line": 27, "description": "Hash code identifying the capabilities of the {@link xeogl.renderer.Program} that is compiled from this source", "type": "String", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 30, + "line": 33, "description": "Vertex shader source for object picking", "type": "{Array of String]", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 36, + "line": 39, "description": "Fragment shader source for object picking.", "type": "{Array of String}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 42, + "line": 45, "description": "Vertex shader source for primitive picking.", "type": "{Array of String]", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 48, + "line": 51, "description": "Fragment shader source for primitive picking.", "type": "{Array of String}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 54, + "line": 57, "description": "Vertex shader source for drawing.", "type": "{Array of String}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 60, + "line": 63, "description": "Fragment shader source for drawing.", "type": "{Array of String}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 66, + "line": 69, "description": "Vertex shader source for rendering shadow buffer.", "type": "{Array of String}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 72, + "line": 75, "description": "Fragment shader source for rendering shadow buffer.", "type": "{Array of String}", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSource.js", - "line": 78, + "line": 81, + "description": "Vertex shader source for rendering outlines.", + "type": "{Array of String}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/programSource.js", + "line": 87, + "description": "Fragment shader source for rendering outlines.", + "type": "{Array of String}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/programSource.js", + "line": 93, "description": "Count of {@link xeogl.renderer.Program}s compiled from this program source code", "type": "Number", "class": "CameraFlightAnimation" @@ -9462,13 +9613,13 @@ }, { "file": "src/_renderer/programSourceFactory.js", - "line": 36, + "line": 38, "description": "Get source code for a program to render the given states.\nAttempts to reuse cached source code for the given hash.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/programSourceFactory.js", - "line": 137, + "line": 141, "description": "Releases program source code back to this factory.", "class": "CameraFlightAnimation" }, @@ -9694,37 +9845,46 @@ }, { "file": "src/_renderer/renderer.js", - "line": 262, + "line": 260, + "description": "Outline state.", + "itemtype": "property", + "name": "outline", + "type": "{renderer.Outline}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.js", + "line": 270, "description": "Flags the object list as needing to be rebuilt from the object map.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 267, + "line": 275, "description": "Flags the object list as needing state orders to be recomputed.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 272, + "line": 280, "description": "Flags the object list as needing to be state-sorted.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 277, + "line": 285, "description": "Flags the image as needing to be redrawn from the object list.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 283, + "line": 291, "description": "Reallocates WebGL resources for objects within this renderer.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 306, + "line": 314, "description": "Internally creates (or updates) a {@link xeogl.renderer.Object} of the given\nID from whatever component state cores are currently set on this {@link xeogl.Renderer}.\nThe object is created if it does not already exist in the display, otherwise\nit is updated with the current states, possibly replacing states already\nreferenced by the object.", "params": [ { @@ -9737,12 +9897,12 @@ }, { "file": "src/_renderer/renderer.js", - "line": 449, + "line": 459, "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 505, + "line": 515, "description": "Removes an object from this Renderer", "params": [ { @@ -9755,13 +9915,13 @@ }, { "file": "src/_renderer/renderer.js", - "line": 541, + "line": 551, "description": "Renders a new frame, if neccessary.", "class": "CameraFlightAnimation" }, { "file": "src/_renderer/renderer.js", - "line": 878, + "line": 1021, "description": "Attempts to pick an object.", "params": [ { @@ -9778,7 +9938,7 @@ }, { "file": "src/_renderer/renderer.js", - "line": 1097, + "line": 1240, "description": "Reads the colors of some pixels in the last rendered frame.", "params": [ { @@ -9806,7 +9966,354 @@ }, { "file": "src/_renderer/renderer.js", - "line": 1143, + "line": 1286, + "description": "Destroys this Renderer.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 7, + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 25, + "description": "Indicates if the canvas is transparent", + "type": "{boolean}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 31, + "description": "Optional callback to fire when renderer wants to\nbind an output framebuffer. This is useful when we need to bind a stereo output buffer for WebVR.\n\nWhen this is missing, the renderer will implicitly bind\nWebGL's default framebuffer.\n\nThe callback takes one parameter, which is the index of the current\nrendering pass in which the buffer is to be bound.\n\nUse like this: myRenderer.bindOutputFramebuffer = function(pass) { .. });", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 45, + "description": "Optional callback to fire when renderer wants to\nunbind any output drawing framebuffer that was\npreviously bound with #bindOutputFramebuffer.\n\nThe callback takes one parameter, which is the index of the current\nrendering pass in which the buffer is to be bound.\n\nUse like this: myRenderer.unbindOutputFramebuffer = function(pass) { .. });\n\nCallback takes no parameters.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 65, + "description": "The current ambient color.", + "type": "Float32Array", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 113, + "description": "Visibility render state.", + "itemtype": "property", + "name": "visibility", + "type": "{renderer.Visibility}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 120, + "description": "Culling render state.", + "itemtype": "property", + "name": "cull", + "type": "{renderer.Cull}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 127, + "description": "Modes render state.", + "itemtype": "property", + "name": "modes", + "type": "{renderer.Modes}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 134, + "description": "Render state for an effects layer.", + "itemtype": "property", + "name": "layer", + "type": "{renderer.Layer}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 141, + "description": "Render state for an effects pipeline stage.", + "itemtype": "property", + "name": "stage", + "type": "{renderer.Layer}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 148, + "description": "Depth buffer render state.", + "itemtype": "property", + "name": "depthBuf", + "type": "{renderer.DepthBuf}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 155, + "description": "Color buffer render state.", + "itemtype": "property", + "name": "colorBuf", + "type": "{renderer.ColorBuf}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 162, + "description": "Lights render state.", + "itemtype": "property", + "name": "lights", + "type": "{renderer.Lights}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 169, + "description": "Material render state.", + "itemtype": "property", + "name": "material", + "type": "{renderer.Material}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 176, + "description": "Modelling transform render state.", + "itemtype": "property", + "name": "modelTransform", + "type": "{renderer.Transform}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 183, + "description": "View transform render state.", + "itemtype": "property", + "name": "viewTransform", + "type": "{renderer.Transform}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 190, + "description": "Projection transform render state.", + "itemtype": "property", + "name": "projTransform", + "type": "{renderer.Transform}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 197, + "description": "Billboard render state.", + "itemtype": "property", + "name": "billboard", + "type": "{renderer.Billboard}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 204, + "description": "Stationary render state.", + "itemtype": "property", + "name": "stationary", + "type": "{renderer.Stationary}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 211, + "description": "Color target render state.", + "itemtype": "property", + "name": "colorTarget", + "type": "{renderer.RenderTarget}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 218, + "description": "Depth target render state.", + "itemtype": "property", + "name": "depthTarget", + "type": "{renderer.RenderTarget}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 225, + "description": "Cross-section planes render state.", + "itemtype": "property", + "name": "clips", + "type": "{renderer.Clips}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 232, + "description": "Custom shader render state.", + "itemtype": "property", + "name": "shader", + "type": "{renderer.Shader}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 239, + "description": "Render state providing custom shader params.", + "itemtype": "property", + "name": "shaderParams", + "type": "{renderer.Shader}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 246, + "description": "Geometry render state.", + "itemtype": "property", + "name": "geometry", + "type": "{renderer.Geometry}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 253, + "description": "Viewport render state.", + "itemtype": "property", + "name": "viewport", + "type": "{renderer.Viewport}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 260, + "description": "Outline state.", + "itemtype": "property", + "name": "outline", + "type": "{renderer.Outline}", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 270, + "description": "Flags the object list as needing to be rebuilt from the object map.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 275, + "description": "Flags the object list as needing state orders to be recomputed.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 280, + "description": "Flags the object list as needing to be state-sorted.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 285, + "description": "Flags the image as needing to be redrawn from the object list.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 291, + "description": "Reallocates WebGL resources for objects within this renderer.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 314, + "description": "Internally creates (or updates) a {@link xeogl.renderer.Object} of the given\nID from whatever component state cores are currently set on this {@link xeogl.Renderer}.\nThe object is created if it does not already exist in the display, otherwise\nit is updated with the current states, possibly replacing states already\nreferenced by the object.", + "params": [ + { + "name": "objectId", + "description": "ID of object to create or update", + "type": "String" + } + ], + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 459, + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 515, + "description": "Removes an object from this Renderer", + "params": [ + { + "name": "objectId", + "description": "ID of object to remove", + "type": "String" + } + ], + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 551, + "description": "Renders a new frame, if neccessary.", + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 1015, + "description": "Attempts to pick an object.", + "params": [ + { + "name": "params", + "description": "Picking params.", + "type": "*" + } + ], + "return": { + "description": "Hit result, if any.", + "type": "*" + }, + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 1234, + "description": "Reads the colors of some pixels in the last rendered frame.", + "params": [ + { + "name": "pixels", + "description": "", + "type": "Float32Array" + }, + { + "name": "colors", + "description": "", + "type": "Float32Array" + }, + { + "name": "len", + "description": "", + "type": "Number" + }, + { + "name": "opaqueOnly", + "description": "", + "type": "Boolean" + } + ], + "class": "CameraFlightAnimation" + }, + { + "file": "src/_renderer/renderer.new.js", + "line": 1280, "description": "Destroys this Renderer.", "class": "CameraFlightAnimation" }, @@ -11480,7 +11987,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 244, + "line": 246, "description": "Boundary of the Canvas in absolute browser window coordinates.\n\n### Usage:\n\n````javascript\nvar boundary = myScene.canvas.boundary;\n\nvar xmin = boundary[0];\nvar ymin = boundary[1];\nvar width = boundary[2];\nvar height = boundary[3];\n````", "itemtype": "property", "name": "boundary", @@ -11492,7 +11999,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 281, + "line": 283, "description": "Fired whenever the WebGL context has been lost", "itemtype": "event", "name": "webglContextLost", @@ -11502,7 +12009,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 294, + "line": 296, "description": "Fired whenever the WebGL context has been restored again after having previously being lost", "itemtype": "event", "name": "webglContextRestored", @@ -11518,7 +12025,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 354, + "line": 356, "description": "Fired whenever this Canvas's {{#crossLink \"Canvas/boundary:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "boundary", @@ -11534,7 +12041,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 391, + "line": 393, "description": "Creates a default canvas in the DOM.", "access": "private", "tagname": "", @@ -11544,7 +12051,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 421, + "line": 423, "description": "Creates a image element behind the canvas, for purpose of showing a custom background.", "access": "private", "tagname": "", @@ -11554,7 +12061,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 448, + "line": 450, "description": "Creates an invisible DIV over the canvas, for purpose of catching\ninput events without interfering with app-lever UI bits floating underneath.", "access": "private", "tagname": "", @@ -11564,7 +12071,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 485, + "line": 487, "description": "Initialises the WebGL context", "access": "private", "tagname": "", @@ -11574,7 +12081,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 518, + "line": 520, "description": "Fired whenever the canvas failed to get a WebGL context, which probably means that WebGL\nis either unsupported or has been disabled.", "itemtype": "event", "name": "webglContextFailed", @@ -11584,7 +12091,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 527, + "line": 529, "description": "Returns a snapshot of this Canvas as a Base64-encoded image.\n\n#### Usage:\n````javascript\nimageElement.src = myScene.canvas.getSnapshot({\n width: 500, // Defaults to size of canvas\n height: 500,\n format: \"png\" // Options are \"jpeg\" (default), \"png\" and \"bmp\"\n});\n````", "itemtype": "method", "name": "getSnapshot", @@ -11627,7 +12134,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 585, + "line": 587, "description": "Reads colors of pixels from the last rendered frame.\n\n

    Call this method like this:

    \n\n````JavaScript\n\n// Ignore transparent pixels (default is false)\nvar opaqueOnly = true;\n\nvar colors = new Float32Array(8);\n\nmyCanvas.readPixels([ 100, 22, 12, 33 ], colors, 2, opaqueOnly);\n````\n\nThen the r,g,b components of the colors will be set to the colors at those pixels.", "params": [ { @@ -11657,7 +12164,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 613, + "line": 615, "description": "A background color for the canvas. This is overridden by {{#crossLink \"Canvas/backgroundImage:property\"}}{{/crossLink}}.\n\nYou can set this to a new color at any time.\n\nFires a {{#crossLink \"Canvas/backgroundColor:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "backgroundColor", @@ -11669,7 +12176,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 642, + "line": 644, "description": "Fired whenever this Canvas's {{#crossLink \"Canvas/backgroundColor:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "backgroundColor", @@ -11685,7 +12192,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 655, + "line": 657, "description": "URL of a background image for the canvas. This is overrided by {{#crossLink \"Canvas/backgroundColor/property\"}}{{/crossLink}}.\n\nYou can set this to a new file path at any time.\n\nFires a {{#crossLink \"Canvas/background:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "backgroundImage", @@ -11696,7 +12203,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 690, + "line": 692, "description": "Fired whenever this Canvas's {{#crossLink \"Canvas/backgroundImage:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "backgroundImage", @@ -11712,7 +12219,7 @@ }, { "file": "src/canvas/canvas.js", - "line": 703, + "line": 705, "description": "The busy {{#crossLink \"Spinner\"}}{{/crossLink}} for this Canvas.", "itemtype": "property", "name": "spinner", @@ -11960,7 +12467,7 @@ }, { "file": "src/controls/cameraControl.js", - "line": 249, + "line": 251, "description": "Flag which indicates whether this CameraControl is in \"first person\" mode.\n\nIn \"first person\" mode (disabled by default) the look position rotates about the eye position. Otherwise,\nthe eye rotates about the look.\n\nFires a {{#crossLink \"KeyboardRotateCamera/firstPerson:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "firstPerson", @@ -11972,7 +12479,7 @@ }, { "file": "src/controls/cameraControl.js", - "line": 272, + "line": 274, "description": "Fired whenever this CameraControl's {{#crossLink \"CameraControl/firstPerson:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "firstPerson", @@ -11988,7 +12495,7 @@ }, { "file": "src/controls/cameraControl.js", - "line": 285, + "line": 287, "description": "The {{#crossLink \"Camera\"}}{{/crossLink}} being controlled by this CameraControl.\n\nMust be within the same {{#crossLink \"Scene\"}}{{/crossLink}} as this CameraControl. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene's{{/crossLink}} default {{#crossLink \"Scene/camera:property\"}}camera{{/crossLink}} when set to\na null or undefined value.", "itemtype": "property", "name": "camera", @@ -11999,7 +12506,7 @@ }, { "file": "src/controls/cameraControl.js", - "line": 299, + "line": 301, "description": "Fired whenever this CameraControl's {{#crossLink \"CameraControl/camera:property\"}}{{/crossLink}}\nproperty changes.", "itemtype": "event", "name": "camera", @@ -12015,7 +12522,7 @@ }, { "file": "src/controls/cameraControl.js", - "line": 335, + "line": 337, "description": "Flag which indicates whether this CameraControl is active or not.\n\nFires an {{#crossLink \"CameraControl/active:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "active", @@ -12026,7 +12533,7 @@ }, { "file": "src/controls/cameraControl.js", - "line": 365, + "line": 367, "description": "Fired whenever this CameraControl's {{#crossLink \"CameraControl/active:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "active", @@ -12951,7 +13458,7 @@ }, { "file": "src/entities/entity.js", - "line": 163, + "line": 165, "description": "Fired when this Entity is *picked* via a call to the {{#crossLink \"Canvas/pick:method\"}}{{/crossLink}} method\non the parent {{#crossLink \"Scene\"}}Scene{{/crossLink}}'s {{#crossLink \"Canvas\"}}Canvas {{/crossLink}}.", "itemtype": "event", "name": "picked", @@ -12978,7 +13485,7 @@ }, { "file": "src/entities/entity.js", - "line": 223, + "line": 226, "description": "The {{#crossLink \"Camera\"}}Camera{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/camera:property\"}}camera{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/camera:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "camera", @@ -12989,7 +13496,7 @@ }, { "file": "src/entities/entity.js", - "line": 243, + "line": 246, "description": "Fired whenever this Entity's {{#crossLink \"Entity/camera:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "camera", @@ -13005,7 +13512,7 @@ }, { "file": "src/entities/entity.js", - "line": 272, + "line": 275, "description": "The {{#crossLink \"Clips\"}}Clips{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/clips:property\"}}clips{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/clips:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "clips", @@ -13016,7 +13523,7 @@ }, { "file": "src/entities/entity.js", - "line": 288, + "line": 291, "description": "Fired whenever this Entity's {{#crossLink \"Entity/clips:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "clips", @@ -13032,7 +13539,7 @@ }, { "file": "src/entities/entity.js", - "line": 306, + "line": 309, "description": "The {{#crossLink \"ColorTarget\"}}ColorTarget{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/colorTarget:property\"}}colorTarget{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/colorTarget:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "colorTarget", @@ -13045,7 +13552,7 @@ }, { "file": "src/entities/entity.js", - "line": 323, + "line": 326, "description": "Fired whenever this Entity's {{#crossLink \"Entity/colorTarget:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "colorTarget", @@ -13061,7 +13568,7 @@ }, { "file": "src/entities/entity.js", - "line": 341, + "line": 344, "description": "The {{#crossLink \"ColorBuf\"}}ColorBuf{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/colorBuf:property\"}}colorBuf{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/colorBuf:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "colorBuf", @@ -13072,7 +13579,7 @@ }, { "file": "src/entities/entity.js", - "line": 357, + "line": 360, "description": "Fired whenever this Entity's {{#crossLink \"Entity/colorBuf:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "colorBuf", @@ -13088,7 +13595,7 @@ }, { "file": "src/entities/entity.js", - "line": 376, + "line": 379, "description": "The {{#crossLink \"DepthTarget\"}}DepthTarget{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/depthTarget:property\"}}depthTarget{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/depthTarget:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "depthTarget", @@ -13101,7 +13608,7 @@ }, { "file": "src/entities/entity.js", - "line": 393, + "line": 396, "description": "Fired whenever this Entity's {{#crossLink \"Entity/depthTarget:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "depthTarget", @@ -13117,7 +13624,7 @@ }, { "file": "src/entities/entity.js", - "line": 412, + "line": 415, "description": "The {{#crossLink \"DepthBuf\"}}DepthBuf{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the\nparent {{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/depthBuf:property\"}}depthBuf{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/depthBuf:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "depthBuf", @@ -13128,7 +13635,7 @@ }, { "file": "src/entities/entity.js", - "line": 428, + "line": 431, "description": "Fired whenever this Entity's {{#crossLink \"Entity/depthBuf:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "depthBuf", @@ -13144,7 +13651,7 @@ }, { "file": "src/entities/entity.js", - "line": 447, + "line": 450, "description": "The {{#crossLink \"Visibility\"}}Visibility{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/visibility:property\"}}visibility{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/visibility:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "visibility", @@ -13155,7 +13662,7 @@ }, { "file": "src/entities/entity.js", - "line": 463, + "line": 466, "description": "Fired whenever this Entity's {{#crossLink \"Entity/visibility:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "visibility", @@ -13171,7 +13678,7 @@ }, { "file": "src/entities/entity.js", - "line": 482, + "line": 485, "description": "The {{#crossLink \"Cull\"}}{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/cull:property\"}}cull{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/cull:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "cull", @@ -13182,7 +13689,7 @@ }, { "file": "src/entities/entity.js", - "line": 498, + "line": 501, "description": "Fired whenever this Entity's {{#crossLink \"Entity/cull:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "cull", @@ -13198,7 +13705,7 @@ }, { "file": "src/entities/entity.js", - "line": 518, + "line": 521, "description": "The {{#crossLink \"Modes\"}}Modes{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/modes:property\"}}modes{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/modes:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "modes", @@ -13209,7 +13716,7 @@ }, { "file": "src/entities/entity.js", - "line": 534, + "line": 537, "description": "Fired whenever this Entity's {{#crossLink \"Entity/modes:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "modes", @@ -13225,7 +13732,7 @@ }, { "file": "src/entities/entity.js", - "line": 553, + "line": 556, "description": "The {{#crossLink \"Geometry\"}}Geometry{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/geometry:property\"}}camera{{/crossLink}}\n(a simple box) when set to a null or undefined value.\n\nFires an {{#crossLink \"Entity/geometry:event\"}}{{/crossLink}} event on change.\n\nUpdates {{#crossLink \"Entity/boundary\"}}{{/crossLink}},\n{{#crossLink \"Entity/worldObb\"}}{{/crossLink}} and\n{{#crossLink \"Entity/center\"}}{{/crossLink}}", "itemtype": "property", "name": "geometry", @@ -13236,7 +13743,7 @@ }, { "file": "src/entities/entity.js", - "line": 577, + "line": 580, "description": "Fired whenever this Entity's {{#crossLink \"Entity/geometry:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "modes", @@ -13252,7 +13759,7 @@ }, { "file": "src/entities/entity.js", - "line": 606, + "line": 609, "description": "The {{#crossLink \"Layer\"}}Layer{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/layer:property\"}}layer{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/layer:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "layer", @@ -13263,7 +13770,7 @@ }, { "file": "src/entities/entity.js", - "line": 622, + "line": 625, "description": "Fired whenever this Entity's {{#crossLink \"Entity/layer:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "layer", @@ -13279,7 +13786,7 @@ }, { "file": "src/entities/entity.js", - "line": 641, + "line": 644, "description": "The {{#crossLink \"Lights\"}}Lights{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/lights:property\"}}lights{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/lights:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "lights", @@ -13290,7 +13797,7 @@ }, { "file": "src/entities/entity.js", - "line": 657, + "line": 660, "description": "Fired whenever this Entity's {{#crossLink \"Entity/lights:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "lights", @@ -13306,7 +13813,7 @@ }, { "file": "src/entities/entity.js", - "line": 676, + "line": 679, "description": "The {{#crossLink \"Material\"}}Material{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/material:property\"}}material{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/material:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "material", @@ -13317,7 +13824,7 @@ }, { "file": "src/entities/entity.js", - "line": 692, + "line": 695, "description": "Fired whenever this Entity's {{#crossLink \"Entity/material:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "material", @@ -13333,7 +13840,7 @@ }, { "file": "src/entities/entity.js", - "line": 711, + "line": 714, "description": "The {{#crossLink \"MorphTargets\"}}MorphTargets{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/morphTargets:property\"}}morphTargets{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/morphTargets:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "morphTargets", @@ -13346,7 +13853,7 @@ }, { "file": "src/entities/entity.js", - "line": 728, + "line": 731, "description": "Fired whenever this Entity's {{#crossLink \"Entity/morphTargets:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "morphTargets", @@ -13362,7 +13869,7 @@ }, { "file": "src/entities/entity.js", - "line": 746, + "line": 749, "description": "The {{#crossLink \"Shader\"}}Shader{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/shader:property\"}}shader{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/shader:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "shader", @@ -13375,7 +13882,7 @@ }, { "file": "src/entities/entity.js", - "line": 763, + "line": 766, "description": "Fired whenever this Entity's {{#crossLink \"Entity/shader:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "shader", @@ -13391,7 +13898,7 @@ }, { "file": "src/entities/entity.js", - "line": 781, + "line": 784, "description": "The {{#crossLink \"ShaderParams\"}}ShaderParams{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/shaderParams:property\"}}shaderParams{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/shaderParams:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "shaderParams", @@ -13404,7 +13911,7 @@ }, { "file": "src/entities/entity.js", - "line": 798, + "line": 801, "description": "Fired whenever this Entity's {{#crossLink \"Entity/shaderParams:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "shaderParams", @@ -13420,7 +13927,7 @@ }, { "file": "src/entities/entity.js", - "line": 817, + "line": 820, "description": "The {{#crossLink \"Stage\"}}Stage{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/stage:property\"}}stage{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/stage:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "stage", @@ -13431,7 +13938,7 @@ }, { "file": "src/entities/entity.js", - "line": 833, + "line": 836, "description": "Fired whenever this Entity's {{#crossLink \"Entity/stage:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "stage", @@ -13447,7 +13954,7 @@ }, { "file": "src/entities/entity.js", - "line": 852, + "line": 855, "description": "The Local-to-World-space (modelling) {{#crossLink \"Transform\"}}{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/transform:property\"}}transform{{/crossLink}}\n(an identity matrix) when set to a null or undefined value.\n\nFires an {{#crossLink \"Entity/transform:event\"}}{{/crossLink}} event on change.\n\nUpdates {{#crossLink \"Entity/boundary\"}}{{/crossLink}},\n{{#crossLink \"Entity/worldObb\"}}{{/crossLink}} and\n{{#crossLink \"Entity/center\"}}{{/crossLink}}", "itemtype": "property", "name": "transform", @@ -13458,7 +13965,7 @@ }, { "file": "src/entities/entity.js", - "line": 876, + "line": 879, "description": "Fired whenever this Entity's {{#crossLink \"Entity/transform:property\"}}{{/crossLink}}\nproperty changes.", "itemtype": "event", "name": "transform", @@ -13474,7 +13981,7 @@ }, { "file": "src/entities/entity.js", - "line": 917, + "line": 920, "description": "The {{#crossLink \"Billboard\"}}{{/crossLink}} attached to this Entity.\n\nWhen {{#crossLink \"Billboard/property:active\"}}{{/crossLink}}, the {{#crossLink \"Billboard\"}}{{/crossLink}}\nwill keep this Entity oriented towards the viewpoint.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/billboard:property\"}}billboard{{/crossLink}}\n(an identity matrix) when set to a null or undefined value.\n\nFires an {{#crossLink \"Entity/billboard:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "billboard", @@ -13485,7 +13992,7 @@ }, { "file": "src/entities/entity.js", - "line": 936, + "line": 939, "description": "Fired whenever this Entity's {{#crossLink \"Entity/billboard:property\"}}{{/crossLink}}\nproperty changes.", "itemtype": "event", "name": "billboard", @@ -13501,7 +14008,7 @@ }, { "file": "src/entities/entity.js", - "line": 956, + "line": 959, "description": "The {{#crossLink \"Viewport\"}}{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. When set to a null or undefined value,\ndefaults to the parent {{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/viewport:property\"}}viewport{{/crossLink}},\nwhich automatically resizes to the canvas.\n\nFires an {{#crossLink \"Entity/viewport:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "viewport", @@ -13512,7 +14019,7 @@ }, { "file": "src/entities/entity.js", - "line": 972, + "line": 975, "description": "Fired whenever this Entity's {{#crossLink \"Entity/viewport:property\"}}{{/crossLink}}\nproperty changes.", "itemtype": "event", "name": "viewport", @@ -13528,7 +14035,7 @@ }, { "file": "src/entities/entity.js", - "line": 992, + "line": 995, "description": "The {{#crossLink \"Stationary\"}}{{/crossLink}} attached to this Entity.\n\nWhen {{#crossLink \"Stationary/property:active\"}}{{/crossLink}}, the {{#crossLink \"Stationary\"}}{{/crossLink}}\nwill prevent the translation component of the viewing transform from being applied to this Entity, yet\nstill allowing it to rotate.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/stationary:property\"}}stationary{{/crossLink}},\nwhich is disabled by default.\n\nFires an {{#crossLink \"Entity/stationary:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "stationary", @@ -13539,7 +14046,7 @@ }, { "file": "src/entities/entity.js", - "line": 1012, + "line": 1015, "description": "Fired whenever this Entity's {{#crossLink \"Entity/stationary:property\"}}{{/crossLink}}\nproperty changes.", "itemtype": "event", "name": "stationary", @@ -13555,7 +14062,34 @@ }, { "file": "src/entities/entity.js", - "line": 1032, + "line": 1035, + "description": "The {{#crossLink \"Outline\"}}Outline{{/crossLink}} attached to this Entity.\n\nMust be within the same {{#crossLink \"Scene\"}}Scene{{/crossLink}} as this Entity. Defaults to the parent\n{{#crossLink \"Scene\"}}Scene{{/crossLink}}'s default {{#crossLink \"Scene/outline:property\"}}Outline{{/crossLink}} when set to\na null or undefined value.\n\nFires an {{#crossLink \"Entity/outline:event\"}}{{/crossLink}} event on change.", + "itemtype": "property", + "name": "outline", + "type": "Outline", + "class": "Entity", + "module": "xeogl", + "submodule": "entities" + }, + { + "file": "src/entities/entity.js", + "line": 1051, + "description": "Fired whenever this Entity's {{#crossLink \"Entity/Outline:property\"}}{{/crossLink}} property changes.", + "itemtype": "event", + "name": "Outline", + "params": [ + { + "name": "value", + "description": "The property's new value" + } + ], + "class": "Entity", + "module": "xeogl", + "submodule": "entities" + }, + { + "file": "src/entities/entity.js", + "line": 1070, "description": "Local-space 3D boundary of this Entity.\n\nThis is a {{#crossLink \"Boundary3D\"}}{{/crossLink}} that encloses\nthe {{#crossLink \"Geometry\"}}{{/crossLink}} that is attached to this Entity.\n\nThe {{#crossLink \"Boundary3D\"}}{{/crossLink}} will fire an {{#crossLink \"Boundary3D/updated:event\"}}{{/crossLink}}\nevent whenever this Entity's {{#crossLink \"Entity/geometry:property\"}}{{/crossLink}} is linked to\na new {{#crossLink \"Geometry\"}}{{/crossLink}}, or whenever the {{#crossLink \"Geometry\"}}{{/crossLink}}'s\n{{#crossLink \"Geometry/positions:property\"}}{{/crossLink}} are updated.\n\nThe a {{#crossLink \"Boundary3D\"}}{{/crossLink}} is lazy-instantiated the first time that this\nproperty is referenced. If {{#crossLink \"Component/destroy:method\"}}{{/crossLink}} is then called on it,\nthen this property will be assigned to a fresh {{#crossLink \"Boundary3D\"}}{{/crossLink}} instance next\ntime it's referenced.", "itemtype": "property", "name": "localBoundary", @@ -13567,7 +14101,7 @@ }, { "file": "src/entities/entity.js", - "line": 1059, + "line": 1097, "description": "World-space 3D boundary of this Entity.\n\nThis is a {{#crossLink \"Boundary3D\"}}{{/crossLink}} that encloses the {{#crossLink \"Geometry\"}}{{/crossLink}}\nthat is attached to this Entity after transformation by this Entity's modelling\n{{#crossLink \"Entity/transform:property\"}}{{/crossLink}}.\n\nThe {{#crossLink \"Boundary3D\"}}{{/crossLink}} will fire an {{#crossLink \"Boundary3D/updated:event\"}}{{/crossLink}}\nevent whenever this Entity's {{#crossLink \"Entity/geometry:property\"}}{{/crossLink}} is linked to\na new {{#crossLink \"Geometry\"}}{{/crossLink}}, or whenever the {{#crossLink \"Geometry\"}}{{/crossLink}}'s\n{{#crossLink \"Geometry/positions:property\"}}{{/crossLink}} are updated.\n\nThe a {{#crossLink \"Boundary3D\"}}{{/crossLink}} is lazy-instantiated the first time that this\nproperty is referenced. If {{#crossLink \"Component/destroy:method\"}}{{/crossLink}} is then called on it,\nthen this property will be assigned to a fresh {{#crossLink \"Boundary3D\"}}{{/crossLink}} instance next\ntime it's referenced.\n\n

    Example

    \n\n[here](http://xeogl.org/examples/#boundaries_Entity_worldBoundary)\n\n

    Performance

    \n\nTo minimize performance overhead, only reference this property if you need it, and destroy\nthe {{#crossLink \"Boundary3D\"}}{{/crossLink}} as soon as you don't need it anymore.", "itemtype": "property", "name": "worldBoundary", @@ -13579,7 +14113,7 @@ }, { "file": "src/entities/entity.js", - "line": 1148, + "line": 1186, "description": "View-space 3D boundary of this Entity.\n\nThis is a {{#crossLink \"Boundary3D\"}}{{/crossLink}} that encloses the {{#crossLink \"Geometry\"}}{{/crossLink}}\nthat is attached to this Entity after transformation by this Entity's modelling\n{{#crossLink \"Entity/transform:property\"}}{{/crossLink}} and {{#crossLink \"Camera\"}}{{/crossLink}}\n{{#crossLink \"Camera/view:property\"}}view transform{{/crossLink}}.\n\nThe {{#crossLink \"Boundary3D\"}}{{/crossLink}} will fire an {{#crossLink \"Boundary3D/updated:event\"}}{{/crossLink}}\nevent whenever there are any changes to the {{#crossLink \"Geometry\"}}{{/crossLink}},\n{{#crossLink \"Entity/transform:property\"}}{{/crossLink}} or {{#crossLink \"Camera\"}}{{/crossLink}} that\nwould affect its extents.\n\nThe a {{#crossLink \"Boundary3D\"}}{{/crossLink}} is lazy-instantiated the first time that this\nproperty is referenced. If {{#crossLink \"Component/destroy:method\"}}{{/crossLink}} is then called on it,\nthen this property will be assigned to a fresh {{#crossLink \"Boundary3D\"}}{{/crossLink}} instance next\ntime it's referenced.\n\n

    Performance

    \n\nTo minimize performance overhead, only reference this property if you need it, and destroy\nthe {{#crossLink \"Boundary3D\"}}{{/crossLink}} as soon as you don't need it anymore.", "itemtype": "property", "name": "viewBoundary", @@ -13591,7 +14125,7 @@ }, { "file": "src/entities/entity.js", - "line": 1216, + "line": 1254, "description": "Canvas-space 2D boundary.\n\nThis is a {{#crossLink \"Boundary2D\"}}{{/crossLink}} that encloses this Entity's\n{{#crossLink \"Entity/geometry:property\"}}{{/crossLink}} after transformation by this Entity's modelling\n{{#crossLink \"Entity/transform:property\"}}{{/crossLink}} and {{#crossLink \"Camera\"}}{{/crossLink}}\n{{#crossLink \"Camera/view:property\"}}view{{/crossLink}} and\n{{#crossLink \"Camera/project:property\"}}projection{{/crossLink}} transforms.\n\nThe {{#crossLink \"Boundary2D\"}}{{/crossLink}} will fire an {{#crossLink \"Boundary3D/updated:event\"}}{{/crossLink}}\nevent whenever there are any changes to the {{#crossLink \"Geometry\"}}{{/crossLink}},\n{{#crossLink \"Entity/transform:property\"}}{{/crossLink}} or {{#crossLink \"Camera\"}}{{/crossLink}} that\nwould affect its extents.\n\nThe a {{#crossLink \"Boundary2D\"}}{{/crossLink}} is lazy-instantiated the first time that this\nproperty is referenced. If {{#crossLink \"Component/destroy:method\"}}{{/crossLink}} is then called on it,\nthen this property will be assigned to a fresh {{#crossLink \"Boundary2D\"}}{{/crossLink}} instance next\ntime it's referenced.\n\n

    Performance

    \n\nTo minimize performance overhead, only reference this property if you need it, and destroy\nthe {{#crossLink \"Boundary2D\"}}{{/crossLink}} as soon as you don't need it anymore.", "itemtype": "property", "name": "canvasBoundary", @@ -13603,7 +14137,7 @@ }, { "file": "src/entities/entity.js", - "line": 1285, + "line": 1323, "description": "JSON object containing the (GLSL) source code of the shaders for this Entity.\n\nThis is sometimes useful to have as a reference\nwhen constructing your own custom {{#crossLink \"Shader\"}}{{/crossLink}} components.\n\nWill return null if xeogl has not yet rendered this Entity.", "itemtype": "property", "name": "glsl", @@ -13615,7 +14149,7 @@ }, { "file": "src/entities/entity.js", - "line": 1322, + "line": 1360, "description": "The (GLSL) source code of the shaders for this Entity, as a string.\n\nThis is sometimes useful to have as a reference\nwhen constructing your own custom {{#crossLink \"Shader\"}}{{/crossLink}} components.\n\nWill return null if xeogl has not yet rendered this Entity.", "itemtype": "property", "name": "glslString", @@ -22519,6 +23053,63 @@ "module": "xeogl", "submodule": "models" }, + { + "file": "src/outline/outline.js", + "line": 68, + "description": "The Outline's thickness in pixels.\n\nFires a {{#crossLink \"Outline/thickness:event\"}}{{/crossLink}} event on change.", + "itemtype": "property", + "name": "thickness", + "default": "15", + "type": "Number", + "class": "Outline", + "module": "xeogl", + "submodule": "outline" + }, + { + "file": "src/outline/outline.js", + "line": 96, + "description": "Fired whenever this Outline's {{#crossLink \"Outline/thickness:property\"}}{{/crossLink}} property changes.", + "itemtype": "event", + "name": "thickness", + "params": [ + { + "name": "value", + "description": "The property's new value" + } + ], + "class": "Outline", + "module": "xeogl", + "submodule": "outline" + }, + { + "file": "src/outline/outline.js", + "line": 110, + "description": "The Outline's RGB color.\n\nFires a {{#crossLink \"Outline/color:event\"}}{{/crossLink}} event on change.", + "itemtype": "property", + "name": "color", + "default": "[1.0, 1.0, 0.0]", + "type": "Float32Array", + "class": "Outline", + "module": "xeogl", + "submodule": "outline" + }, + { + "file": "src/outline/outline.js", + "line": 145, + "description": "Fired whenever this Outline's {{#crossLink \"Outline/color:property\"}}{{/crossLink}} property changes.", + "itemtype": "event", + "name": "color", + "params": [ + { + "name": "value", + "description": "The property's new value", + "type": "Float32Array" + } + ], + "class": "Outline", + "module": "xeogl", + "submodule": "outline" + }, { "file": "src/rendering/colorBuf.js", "line": 61, @@ -22790,7 +23381,7 @@ }, { "file": "src/rendering/modes.js", - "line": 107, + "line": 111, "description": "Whether this Modes enables picking of attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nPicking is performed via calls to {{#crossLink \"Canvas/pick:method\"}}Canvas#pick{{/crossLink}}.\n\nFires a {{#crossLink \"Modes/pickable:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "pickable", @@ -22802,7 +23393,7 @@ }, { "file": "src/rendering/modes.js", - "line": 133, + "line": 137, "description": "Fired whenever this Modes' {{#crossLink \"Modes/pickable:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "pickable", @@ -22818,7 +23409,7 @@ }, { "file": "src/rendering/modes.js", - "line": 147, + "line": 151, "description": "Whether this Modes enables clippable of attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nclippable is done by {{#crossLink \"Clips\"}}{{/crossLink}} that are also attached to\nthe {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nFires a {{#crossLink \"Modes/clippable:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "clippable", @@ -22830,7 +23421,7 @@ }, { "file": "src/rendering/modes.js", - "line": 173, + "line": 177, "description": "Fired whenever this Modes' {{#crossLink \"Modes/clippable:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "clippable", @@ -22846,7 +23437,7 @@ }, { "file": "src/rendering/modes.js", - "line": 187, + "line": 191, "description": "Whether this Modes sets attached {{#crossLink \"Entity\"}}Entities{{/crossLink}} transparent.\n\nWhen true. this property will set attached {{#crossLink \"Entity\"}}Entities{{/crossLink}} transparent (ie. to be rendered in a\ntransparency pass with blending enabled etc), while\nthe {{#crossLink \"PhongMaterial/opacity:property\"}}{{/crossLink}} will be used to indicate the **degree** of their transparency\n(ie. where opacity of 0.0 indicates maximum translucency and opacity of 1.0 indicates minimum translucency).\n\nFires a {{#crossLink \"Modes/transparent:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "transparent", @@ -22858,7 +23449,7 @@ }, { "file": "src/rendering/modes.js", - "line": 215, + "line": 219, "description": "Fired whenever this Modes' {{#crossLink \"Modes/transparent:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "transparent", @@ -22874,7 +23465,7 @@ }, { "file": "src/rendering/modes.js", - "line": 229, + "line": 233, "description": "Whether this Modes enables backfaces to be visible on attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nThe backfaces will belong to {{#crossLink \"Geometry\"}}{{/crossLink}} compoents that are also attached to\nthe {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nFires a {{#crossLink \"Modes/backfaces:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "backfaces", @@ -22886,7 +23477,7 @@ }, { "file": "src/rendering/modes.js", - "line": 255, + "line": 259, "description": "Fired whenever this Modes' {{#crossLink \"Modes/backfaces:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "backfaces", @@ -22902,7 +23493,7 @@ }, { "file": "src/rendering/modes.js", - "line": 269, + "line": 273, "description": "Indicates the winding direction of front faces on attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nThe faces will belong to {{#crossLink \"Geometry\"}}{{/crossLink}} components that are also attached to\nthe {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nFires a {{#crossLink \"Modes/frontface:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "frontface", @@ -22914,7 +23505,7 @@ }, { "file": "src/rendering/modes.js", - "line": 295, + "line": 299, "description": "Fired whenever this Modes' {{#crossLink \"Modes/frontface:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "frontface", @@ -22930,7 +23521,7 @@ }, { "file": "src/rendering/modes.js", - "line": 309, + "line": 313, "description": "Whether attached {{#crossLink \"Entity\"}}Entities{{/crossLink}} are included\nin boundary-related calculations.\n\nSet this false if the\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} are things like helpers or indicators that should not be included in boundary calculations.\n\nFor example, when set false, the {{#crossLink \"Entity/worldBoundary:property\"}}World-space boundary{{/crossLink}} of all attached {{#crossLink \"Entity\"}}Entities{{/crossLink}} would not be considered when calculating the {{#crossLink \"Scene/worldBoundary:property\"}}World-space boundary{{/crossLink}} of their\n{{#crossLink \"Scene\"}}{{/crossLink}}.\n\nFires a {{#crossLink \"Modes/collidable:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "collidable", @@ -22942,7 +23533,7 @@ }, { "file": "src/rendering/modes.js", - "line": 337, + "line": 341, "description": "Fired whenever this Modes' {{#crossLink \"Modes/collidable:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "collidable", @@ -22958,7 +23549,7 @@ }, { "file": "src/rendering/modes.js", - "line": 352, + "line": 356, "description": "Whether attached {{#crossLink \"Entity\"}}Entities{{/crossLink}} casts shadows.\n\nFires a {{#crossLink \"Modes/castShadow:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "castShadow", @@ -22970,7 +23561,7 @@ }, { "file": "src/rendering/modes.js", - "line": 375, + "line": 379, "description": "Fired whenever this Modes' {{#crossLink \"Modes/castShadow:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "castShadow", @@ -22986,7 +23577,7 @@ }, { "file": "src/rendering/modes.js", - "line": 389, + "line": 393, "description": "Whether attached {{#crossLink \"Entity\"}}Entities{{/crossLink}} receives shadows.\n\nFires a {{#crossLink \"Modes/receiveShadow:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "receiveShadow", @@ -22998,7 +23589,7 @@ }, { "file": "src/rendering/modes.js", - "line": 414, + "line": 418, "description": "Fired whenever this Modes' {{#crossLink \"Modes/receiveShadow:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "receiveShadow", @@ -23012,6 +23603,34 @@ "module": "xeogl", "submodule": "rendering" }, + { + "file": "src/rendering/modes.js", + "line": 432, + "description": "Whether an outline is drawn around attached {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nFires a {{#crossLink \"Modes/outline:event\"}}{{/crossLink}} event on change.", + "itemtype": "property", + "name": "outline", + "default": "false", + "type": "Boolean", + "class": "Modes", + "module": "xeogl", + "submodule": "rendering" + }, + { + "file": "src/rendering/modes.js", + "line": 455, + "description": "Fired whenever this Modes' {{#crossLink \"Modes/outline:property\"}}{{/crossLink}} property changes.", + "itemtype": "event", + "name": "outline", + "params": [ + { + "name": "value", + "description": "The property's new value" + } + ], + "class": "Modes", + "module": "xeogl", + "submodule": "rendering" + }, { "file": "src/rendering/stage.js", "line": 95, @@ -24809,7 +25428,7 @@ }, { "file": "src/scene.js", - "line": 454, + "line": 455, "description": "Fired whenever a component has been created within this Scene.", "itemtype": "event", "name": "componentCreated", @@ -24825,7 +25444,7 @@ }, { "file": "src/scene.js", - "line": 496, + "line": 497, "description": "Fired whenever a component within this Scene has been destroyed.", "itemtype": "event", "name": "componentDestroyed", @@ -24841,7 +25460,7 @@ }, { "file": "src/scene.js", - "line": 531, + "line": 532, "description": "Renders a single frame of this Scene.\n\nThe Scene will automatically call this method on itself to render after any updates, but you\ncan call this method to force a render if required. This method is typically used when we want\nto synchronously take a snapshot of the canvas and need everything rendered right at that moment.", "itemtype": "method", "name": "render", @@ -24859,7 +25478,7 @@ }, { "file": "src/scene.js", - "line": 562, + "line": 563, "description": "Fired when about to render a frame for a Scene.", "itemtype": "event", "name": "rendering", @@ -24880,7 +25499,7 @@ }, { "file": "src/scene.js", - "line": 575, + "line": 576, "description": "Fired when we have just rendered a frame for a Scene.", "itemtype": "event", "name": "rendering", @@ -24901,7 +25520,7 @@ }, { "file": "src/scene.js", - "line": 589, + "line": 590, "description": "The number of {{#crossLink \"Scene/tick:property\"}}{{/crossLink}} that happen between each render or this Scene.\n\nFires a {{#crossLink \"Scene/ticksPerRender:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "ticksPerRender", @@ -24912,7 +25531,7 @@ }, { "file": "src/scene.js", - "line": 619, + "line": 620, "description": "Fired whenever this Scene's {{#crossLink \"Scene/ticksPerRender:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "ticksPerRender", @@ -24928,7 +25547,7 @@ }, { "file": "src/scene.js", - "line": 633, + "line": 634, "description": "The number of times this Scene renders per frame.\n\nFires a {{#crossLink \"Scene/passes:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "passes", @@ -24939,7 +25558,7 @@ }, { "file": "src/scene.js", - "line": 665, + "line": 666, "description": "Fired whenever this Scene's {{#crossLink \"Scene/passes:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "passes", @@ -24955,7 +25574,7 @@ }, { "file": "src/scene.js", - "line": 679, + "line": 680, "description": "When doing multiple passes per frame, specifies whether to clear the\ncanvas before each pass (true) or just before the first pass (false).\n\nFires a {{#crossLink \"Scene/clearEachPass:event\"}}{{/crossLink}} event on change.", "itemtype": "property", "name": "clearEachPass", @@ -24966,7 +25585,7 @@ }, { "file": "src/scene.js", - "line": 703, + "line": 704, "description": "Fired whenever this Scene's {{#crossLink \"Scene/clearEachPass:property\"}}{{/crossLink}} property changes.", "itemtype": "event", "name": "clearEachPass", @@ -24982,7 +25601,7 @@ }, { "file": "src/scene.js", - "line": 718, + "line": 719, "description": "The default projection transform provided by this Scene, which is\na {{#crossLink \"Perspective\"}}Perspective{{/crossLink}}.\n\nThis {{#crossLink \"Perspective\"}}Perspective{{/crossLink}} has an\n{{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to\n\"default.project\", with all other properties set to their default\nvalues.\n\n{{#crossLink \"Camera\"}}Cameras{{/crossLink}} within this Scene\nare attached to this {{#crossLink \"Perspective\"}}Perspective{{/crossLink}}\nby default.", "itemtype": "property", "name": "project", @@ -24993,7 +25612,7 @@ }, { "file": "src/scene.js", - "line": 746, + "line": 747, "description": "The default viewing transform provided by this Scene, which is a {{#crossLink \"Lookat\"}}Lookat{{/crossLink}}.\n\nThis {{#crossLink \"Lookat\"}}Lookat{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.view\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Camera\"}}Cameras{{/crossLink}} within this Scene are attached to\nthis {{#crossLink \"Lookat\"}}Lookat{{/crossLink}} by default.", "itemtype": "property", "name": "view", @@ -25004,7 +25623,7 @@ }, { "file": "src/scene.js", - "line": 769, + "line": 770, "description": "The default {{#crossLink \"Camera\"}}Camera{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Camera\"}}Camera{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.camera\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to\nthis {{#crossLink \"Camera\"}}Camera{{/crossLink}} by default.", "itemtype": "property", "name": "camera", @@ -25015,7 +25634,7 @@ }, { "file": "src/scene.js", - "line": 794, + "line": 795, "description": "The default modelling {{#crossLink \"Transform\"}}{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Transform\"}}{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.transform\",\nwith all other properties initialised to their default values (ie. an identity matrix).\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to\nthis {{#crossLink \"Transform\"}}{{/crossLink}} by default.", "itemtype": "property", "name": "transform", @@ -25026,7 +25645,7 @@ }, { "file": "src/scene.js", - "line": 818, + "line": 819, "description": "The default {{#crossLink \"Billboard\"}}Billboard{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Billboard\"}}Billboard{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.billboard\"\nand an {{#crossLink \"Billboard/active:property\"}}{{/crossLink}} property set to false, to disable it.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Billboard\"}}Billboard{{/crossLink}} by default.", "itemtype": "property", "name": "billboard", @@ -25037,7 +25656,7 @@ }, { "file": "src/scene.js", - "line": 842, + "line": 843, "description": "The default {{#crossLink \"Stationary\"}}Stationary{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Stationary\"}}Stationary{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.stationary\"\nand an {{#crossLink \"Stationary/active:property\"}}{{/crossLink}} property set to false, to disable it.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Stationary\"}}Stationary{{/crossLink}} by default.", "itemtype": "property", "name": "stationary", @@ -25048,7 +25667,7 @@ }, { "file": "src/scene.js", - "line": 866, + "line": 867, "description": "The default {{#crossLink \"Clips\"}}Clips{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Clips\"}}Clips{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.clips\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Clips\"}}Clips{{/crossLink}} by default.", "itemtype": "property", "name": "clips", @@ -25059,7 +25678,7 @@ }, { "file": "src/scene.js", - "line": 889, + "line": 890, "description": "The default {{#crossLink \"ColorBuf\"}}ColorBuf{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"ColorBuf\"}}ColorBuf{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.colorBuf\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"ColorBuf\"}}ColorBuf{{/crossLink}} by default.", "itemtype": "property", "name": "colorBuf", @@ -25070,7 +25689,7 @@ }, { "file": "src/scene.js", - "line": 912, + "line": 913, "description": "The default {{#crossLink \"ColorTarget\"}}ColorTarget{{/crossLink}} provided by this Scene.\n\nThe {{#crossLink \"ColorTarget\"}}DepthTarget{{/crossLink}} is\n{{#crossLink \"ColorTarget/active:property\"}}inactive{{/crossLink}} by default and will have an\n{{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.depthTarget\".\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"ColorTarget\"}}ColorTarget{{/crossLink}} by default.", "itemtype": "property", "name": "colorTarget", @@ -25083,7 +25702,7 @@ }, { "file": "src/scene.js", - "line": 937, + "line": 938, "description": "The default {{#crossLink \"DepthBuf\"}}DepthBuf{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"DepthBuf\"}}DepthBuf{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.depthBuf\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"DepthBuf\"}}DepthBuf{{/crossLink}} by default.", "itemtype": "property", "name": "depthBuf", @@ -25094,7 +25713,7 @@ }, { "file": "src/scene.js", - "line": 961, + "line": 962, "description": "The default {{#crossLink \"DepthTarget\"}}DepthTarget{{/crossLink}} provided by this Scene.\n\nThe {{#crossLink \"DepthTarget\"}}DepthTarget{{/crossLink}} is\n{{#crossLink \"DepthTarget/active:property\"}}inactive{{/crossLink}} by default and has an\n{{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.depthTarget\".\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"DepthTarget\"}}DepthTarget{{/crossLink}} by default.", "itemtype": "property", "name": "depthTarget", @@ -25107,7 +25726,7 @@ }, { "file": "src/scene.js", - "line": 986, + "line": 987, "description": "The default {{#crossLink \"Visibility\"}}Visibility{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Visibility\"}}Visibility{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.visibility\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Visibility\"}}Visibility{{/crossLink}} by default.", "itemtype": "property", "name": "visibility", @@ -25118,7 +25737,7 @@ }, { "file": "src/scene.js", - "line": 1009, + "line": 1010, "description": "The default {{#crossLink \"Cull\"}}{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Cull\"}}cull{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.cull\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Cull\"}}{{/crossLink}} by default.", "itemtype": "property", "name": "cull", @@ -25129,7 +25748,7 @@ }, { "file": "src/scene.js", - "line": 1032, + "line": 1033, "description": "The default {{#crossLink \"Modes\"}}Modes{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Modes\"}}Modes{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.modes\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Modes\"}}Modes{{/crossLink}} by default.", "itemtype": "property", "name": "modes", @@ -25140,7 +25759,7 @@ }, { "file": "src/scene.js", - "line": 1054, + "line": 1055, "description": "The default geometry provided by this Scene, which is a {{#crossLink \"BoxGeometry\"}}BoxGeometry{{/crossLink}}.\n\nThis {{#crossLink \"BoxGeometry\"}}BoxGeometry{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.geometry\".\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Geometry\"}}Geometry{{/crossLink}} by default.", "itemtype": "property", "name": "geometry", @@ -25151,7 +25770,7 @@ }, { "file": "src/scene.js", - "line": 1075, + "line": 1076, "description": "The default {{#crossLink \"Layer\"}}Layer{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Layer\"}}Layer{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.layer\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Layer\"}}Layer{{/crossLink}} by default.", "itemtype": "property", "name": "layer", @@ -25162,7 +25781,7 @@ }, { "file": "src/scene.js", - "line": 1098, + "line": 1099, "description": "The default {{#crossLink \"Lights\"}}Lights{{/crossLink}} provided\nby this Scene.\n\nThis {{#crossLink \"Lights\"}}Lights{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to *````\"default.lights\"````*,\nwith all other properties initialised to their default values (ie. the default set of light sources for a {{#crossLink \"Lights\"}}Lights{{/crossLink}}).\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Lights\"}}Lights{{/crossLink}} by default.", "itemtype": "property", "name": "lights", @@ -25173,7 +25792,7 @@ }, { "file": "src/scene.js", - "line": 1171, + "line": 1172, "description": "The {{#crossLink \"PhongMaterial\"}}PhongMaterial{{/crossLink}} provided as the default material by this Scene.\n\nThis {{#crossLink \"PhongMaterial\"}}PhongMaterial{{/crossLink}} has\nan {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.material\", with all\nother properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"PhongMaterial\"}}PhongMaterial{{/crossLink}} by default.", "itemtype": "property", "name": "material", @@ -25184,7 +25803,7 @@ }, { "file": "src/scene.js", - "line": 1194, + "line": 1195, "description": "The default {{#crossLink \"MorphTargets\"}}MorphTargets{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"MorphTargets\"}}MorphTargets{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.morphTargets\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"MorphTargets\"}}MorphTargets{{/crossLink}} by default.", "itemtype": "property", "name": "morphTargets", @@ -25197,7 +25816,7 @@ }, { "file": "src/scene.js", - "line": 1217, + "line": 1218, "description": "The default {{#crossLink \"Shader\"}}Shader{{/crossLink}} provided by this Scene\n(which is initially an empty {{#crossLink \"Shader\"}}Shader{{/crossLink}} that has no effect).\n\nThis {{#crossLink \"Shader\"}}Shader{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.shader\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Shader\"}}Shader{{/crossLink}} by default.", "itemtype": "property", "name": "shader", @@ -25210,7 +25829,7 @@ }, { "file": "src/scene.js", - "line": 1241, + "line": 1242, "description": "The default {{#crossLink \"ShaderParams\"}}ShaderParams{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"ShaderParams\"}}ShaderParams{{/crossLink}} has an {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.shaderParams\",\nwith all other properties initialised to their default values.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"ShaderParams\"}}{{/crossLink}} by default.", "itemtype": "property", "name": "shaderParams", @@ -25223,7 +25842,7 @@ }, { "file": "src/scene.js", - "line": 1265, + "line": 1266, "description": "The default {{#crossLink \"Stage\"}}Stage{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Stage\"}}Stage{{/crossLink}} has\nan {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.stage\" and\na {{#crossLink \"Stage/priority:property\"}}priority{{/crossLink}} equal to ````0````.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Stage\"}}Stage{{/crossLink}} by default.", "itemtype": "property", "name": "stage", @@ -25234,7 +25853,7 @@ }, { "file": "src/scene.js", - "line": 1289, + "line": 1290, "description": "The default {{#crossLink \"Viewport\"}}{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Viewport\"}}{{/crossLink}} has\nan {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.viewport\" and\n{{#crossLink \"Viewport/autoBoundary:property\"}}{{/crossLink}} set ````true````.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Viewport\"}}{{/crossLink}} by default.", "itemtype": "property", "name": "viewport", @@ -25245,7 +25864,18 @@ }, { "file": "src/scene.js", - "line": 1314, + "line": 1315, + "description": "The default {{#crossLink \"Outline\"}}{{/crossLink}} provided by this Scene.\n\nThis {{#crossLink \"Outline\"}}{{/crossLink}} has\nan {{#crossLink \"Component/id:property\"}}id{{/crossLink}} equal to \"default.outline\",\na {{#crossLink \"Outline/color:property\"}}color{{/crossLink}} set to ````[1,1,0]````\na {{#crossLink \"Outline/thickness:property\"}}thickness{{/crossLink}} set to ````15````.\n\n{{#crossLink \"Entity\"}}Entities{{/crossLink}} within this Scene are attached to this\n{{#crossLink \"Outline\"}}{{/crossLink}} by default.", + "itemtype": "property", + "name": "outline", + "final": 1, + "type": "Outline", + "class": "Scene", + "module": "xeogl" + }, + { + "file": "src/scene.js", + "line": 1341, "description": "The World-space 3D boundary of this Scene.\n\nThe {{#crossLink \"Boundary3D\"}}{{/crossLink}} will be lazy-initialized the first time\nyou reference this property, and will persist on this Scene until you\ncall {{#crossLink \"Component/destroy:method\"}}{{/crossLink}} on the {{#crossLink \"Boundary3D\"}}{{/crossLink}}\nagain. The property will then be set to a fresh {{#crossLink \"Boundary3D\"}}{{/crossLink}} instance\nnext time you reference it.\n\n

    Performance

    \n\nTo minimize performance overhead, only reference this property if you need it, and destroy\nthe {{#crossLink \"Boundary3D\"}}{{/crossLink}} as soon as you don't need it anymore.", "itemtype": "property", "name": "worldBoundary", @@ -25256,7 +25886,7 @@ }, { "file": "src/scene.js", - "line": 1397, + "line": 1424, "description": "Attempts to pick an {{#crossLink \"Entity\"}}Entity{{/crossLink}} in this Scene.\n\nIgnores {{#crossLink \"Entity\"}}Entities{{/crossLink}} that are attached\nto either a {{#crossLink \"Stage\"}}Stage{{/crossLink}} with {{#crossLink \"Stage/pickable:property\"}}pickable{{/crossLink}}\nset *false* or a {{#crossLink \"Modes\"}}Modes{{/crossLink}} with {{#crossLink \"Modes/pickable:property\"}}pickable{{/crossLink}} set *false*.\n\nPicking the {{#crossLink \"Entity\"}}{{/crossLink}} at the given canvas coordinates:\n\n````javascript\nvar hit = scene.pick({\n canvasPos: [23, 131]\n });\n\nif (hit) { // Picked an Entity\n var entity = hit.entity;\n}\n````\n\n**Usage:**\n\nPicking the {{#crossLink \"Entity\"}}{{/crossLink}} that intersects a ray cast through the canvas:\n\n````javascript\nvar hit = scene.pick({\n pickSurface: true,\n canvasPos: [23, 131]\n });\n\nif (hit) { // Picked an Entity\n\n var entity = hit.entity;\n\n // These properties are only on the hit result when we do a ray-pick:\n\n var primitive = hit.primitive; // Type of primitive that was picked, usually \"triangles\"\n var primIndex = hit.primIndex; // Position of triangle's first index in the picked Entity's Geometry's indices array\n var indices = hit.indices; // UInt32Array containing the triangle's vertex indices\n var localPos = hit.localPos; // Float32Array containing the picked Local-space position on the triangle\n var worldPos = hit.worldPos; // Float32Array containing the picked World-space position on the triangle\n var viewPos = hit.viewPos; // Float32Array containing the picked View-space position on the triangle\n var bary = hit.bary; // Float32Array containing the picked barycentric position within the triangle\n var normal = hit.normal; // Float32Array containing the interpolated normal vector at the picked position on the triangle\n var uv = hit.uv; // Float32Array containing the interpolated UV coordinates at the picked position on the triangle\n}\n````\n\nPicking the {{#crossLink \"Entity\"}}{{/crossLink}} that intersects an arbitrarily-aligned World-space ray:\n\n````javascript\nvar hit = scene.pick({\n pickSurface: true, // Picking with arbitrarily-positioned ray\n origin: [0,0,-5], // Ray origin\n direction: [0,0,1] // Ray direction\n});\n\nif (hit) { // Picked an Entity with the ray\n\n var entity = hit.entity;\n\n var primitive = hit.primitive; // Type of primitive that was picked, usually \"triangles\"\n var primIndex = hit.primIndex; // Position of triangle's first index in the picked Entity's Geometry's indices array\n var indices = hit.indices; // UInt32Array containing the triangle's vertex indices\n var localPos = hit.localPos; // Float32Array containing the picked Local-space position on the triangle\n var worldPos = hit.worldPos; // Float32Array containing the picked World-space position on the triangle\n var viewPos = hit.viewPos; // Float32Array containing the picked View-space position on the triangle\n var bary = hit.bary; // Float32Array containing the picked barycentric position within the triangle\n var normal = hit.normal; // Float32Array containing the interpolated normal vector at the picked position on the triangle\n var uv = hit.uv; // Float32Array containing the interpolated UV coordinates at the picked position on the triangle\n var origin = hit.origin; // Float32Array containing the World-space ray origin\n var direction = hit.direction; // Float32Array containing the World-space ray direction\n}\n````", "itemtype": "method", "name": "pick", @@ -25303,7 +25933,7 @@ }, { "file": "src/scene.js", - "line": 1709, + "line": 1736, "description": "Resets this Scene to its default state.\n\nReferences to any components in this Scene will become invalid.", "itemtype": "method", "name": "clear", @@ -25312,7 +25942,7 @@ }, { "file": "src/scene.js", - "line": 1735, + "line": 1762, "description": "Convenience method for creating or reusing a Component within this Scene.\n\nYou would typically use this method to conveniently instantiate components that you'd want to\nshare (ie. \"instance\") among your {{#crossLink \"Entity\"}}Entities{{/crossLink}}.\n\nThe method is given a component type, share ID and constructor attributes, like so:\n\n````javascript\nvar material = myScene.getComponent(\"xeogl.PhongMaterial\", \"myMaterial\", { diffuse: [1,0,0] });\n````\n\nThe first time you call this method for the given ````type```` and ````instanceId````, this method will create the\n{{#crossLink \"PhongMaterial\"}}{{/crossLink}}, passing the given attributes to the component's constructor.\n\nIf you call this method again, specifying the same ````type```` and ````instanceId````, the method will return the same\ncomponent instance that it returned the first time, and will ignore the attributes:\n\n````javascript\nvar material2 = myScene.getComponent(\"xeogl.PhongMaterial\", \"myMaterial\", { specular: [1,1,0] });\n````\n\nEach time you call this method with the same ````type```` and ````instanceId````, the Scene will internally increment a\nreference count for the component instance. You can release the shared component instance with a call to\n{{#crossLink \"Scene/putSharedComponent:method\"}}{{/crossLink}}, and once you have released it as many\ntimes as you got it, the Scene will destroy the component.", "itemtype": "method", "name": "_getSharedComponent", @@ -25340,7 +25970,7 @@ }, { "file": "src/scene.js", - "line": 1849, + "line": 1876, "description": "Releases a shared component instance that was got earlier\nwith {{#crossLink \"Scene/getSharedComponent:method\"}}{{/crossLink}}.", "params": [ { @@ -25354,7 +25984,7 @@ }, { "file": "src/scene.js", - "line": 1877, + "line": 1904, "description": "Compiles and renders this Scene", "access": "private", "tagname": "", @@ -29681,7 +30311,11 @@ "warnings": [ { "message": "replacing incorrect tag: returns with return", - "line": " src/_renderer/renderer.js:878" + "line": " src/_renderer/renderer.js:1021" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " src/_renderer/renderer.new.js:1015" }, { "message": "replacing incorrect tag: returns with return", @@ -29697,7 +30331,7 @@ }, { "message": "replacing incorrect tag: returns with return", - "line": " src/canvas/canvas.js:527" + "line": " src/canvas/canvas.js:529" }, { "message": "replacing incorrect tag: returns with return", @@ -29781,11 +30415,11 @@ }, { "message": "replacing incorrect tag: returns with return", - "line": " src/scene.js:1397" + "line": " src/scene.js:1424" }, { "message": "replacing incorrect tag: returns with return", - "line": " src/scene.js:1735" + "line": " src/scene.js:1762" }, { "message": "unknown tag: demo", @@ -30160,32 +30794,40 @@ "line": " src/_renderer/program.js:49" }, { - "message": "Missing item type\nThe count of display objects using this program", + "message": "Missing item type\nThe outline program", "line": " src/_renderer/program.js:55" }, { - "message": "Missing item type\nTrue when successfully allocated", + "message": "Missing item type\nThe count of display objects using this program", "line": " src/_renderer/program.js:61" }, { - "message": "Missing item type\nTrue when successfully compiled", + "message": "Missing item type\nTrue when successfully allocated", "line": " src/_renderer/program.js:67" }, { - "message": "Missing item type\nTrue when successfully linked", + "message": "Missing item type\nTrue when successfully compiled", "line": " src/_renderer/program.js:73" }, { - "message": "Missing item type\nTrue when successfully validated", + "message": "Missing item type\nTrue when successfully linked", "line": " src/_renderer/program.js:79" }, { - "message": "Missing item type\nContains error log on failure to allocate, compile, validate or link", + "message": "Missing item type\nTrue when successfully validated", "line": " src/_renderer/program.js:85" }, + { + "message": "Missing item type\nContains error log on failure to allocate, compile, validate or link", + "line": " src/_renderer/program.js:91" + }, { "message": "Missing item type\nCreates the render and pick programs.\n This is also re-called to re-create them after WebGL context loss.", - "line": " src/_renderer/program.js:95" + "line": " src/_renderer/program.js:101" + }, + { + "message": "Missing item type\nDestroys this program.", + "line": " src/_renderer/program.js:230" }, { "message": "Missing item type\nManages {@link xeogl.renderer.ProgramState} instances.", @@ -30201,7 +30843,7 @@ }, { "message": "Missing item type\nRebuild all programs in the pool after WebGL context was lost and restored.", - "line": " src/_renderer/programFactory.js:75" + "line": " src/_renderer/programFactory.js:72" }, { "message": "Missing item type\nSource code for pick and draw shader programs, to be compiled into one or more {@link xeogl.renderer.Program}s", @@ -30209,43 +30851,51 @@ }, { "message": "Missing item type\nHash code identifying the capabilities of the {@link xeogl.renderer.Program} that is compiled from this source", - "line": " src/_renderer/programSource.js:24" + "line": " src/_renderer/programSource.js:27" }, { "message": "Missing item type\nVertex shader source for object picking", - "line": " src/_renderer/programSource.js:30" + "line": " src/_renderer/programSource.js:33" }, { "message": "Missing item type\nFragment shader source for object picking.", - "line": " src/_renderer/programSource.js:36" + "line": " src/_renderer/programSource.js:39" }, { "message": "Missing item type\nVertex shader source for primitive picking.", - "line": " src/_renderer/programSource.js:42" + "line": " src/_renderer/programSource.js:45" }, { "message": "Missing item type\nFragment shader source for primitive picking.", - "line": " src/_renderer/programSource.js:48" + "line": " src/_renderer/programSource.js:51" }, { "message": "Missing item type\nVertex shader source for drawing.", - "line": " src/_renderer/programSource.js:54" + "line": " src/_renderer/programSource.js:57" }, { "message": "Missing item type\nFragment shader source for drawing.", - "line": " src/_renderer/programSource.js:60" + "line": " src/_renderer/programSource.js:63" }, { "message": "Missing item type\nVertex shader source for rendering shadow buffer.", - "line": " src/_renderer/programSource.js:66" + "line": " src/_renderer/programSource.js:69" }, { "message": "Missing item type\nFragment shader source for rendering shadow buffer.", - "line": " src/_renderer/programSource.js:72" + "line": " src/_renderer/programSource.js:75" + }, + { + "message": "Missing item type\nVertex shader source for rendering outlines.", + "line": " src/_renderer/programSource.js:81" + }, + { + "message": "Missing item type\nFragment shader source for rendering outlines.", + "line": " src/_renderer/programSource.js:87" }, { "message": "Missing item type\nCount of {@link xeogl.renderer.Program}s compiled from this program source code", - "line": " src/_renderer/programSource.js:78" + "line": " src/_renderer/programSource.js:93" }, { "message": "Missing item type\nManages creation, sharing and recycle of {@link xeogl.renderer.ProgramSource} instances", @@ -30253,11 +30903,11 @@ }, { "message": "Missing item type\nGet source code for a program to render the given states.\nAttempts to reuse cached source code for the given hash.", - "line": " src/_renderer/programSourceFactory.js:36" + "line": " src/_renderer/programSourceFactory.js:38" }, { "message": "Missing item type\nReleases program source code back to this factory.", - "line": " src/_renderer/programSourceFactory.js:137" + "line": " src/_renderer/programSourceFactory.js:141" }, { "message": "Missing item type", @@ -30281,51 +30931,119 @@ }, { "message": "Missing item type\nFlags the object list as needing to be rebuilt from the object map.", - "line": " src/_renderer/renderer.js:262" + "line": " src/_renderer/renderer.js:270" + }, + { + "message": "Missing item type\nFlags the object list as needing state orders to be recomputed.", + "line": " src/_renderer/renderer.js:275" + }, + { + "message": "Missing item type\nFlags the object list as needing to be state-sorted.", + "line": " src/_renderer/renderer.js:280" + }, + { + "message": "Missing item type\nFlags the image as needing to be redrawn from the object list.", + "line": " src/_renderer/renderer.js:285" + }, + { + "message": "Missing item type\nReallocates WebGL resources for objects within this renderer.", + "line": " src/_renderer/renderer.js:291" + }, + { + "message": "Missing item type\nInternally creates (or updates) a {@link xeogl.renderer.Object} of the given\nID from whatever component state cores are currently set on this {@link xeogl.Renderer}.\nThe object is created if it does not already exist in the display, otherwise\nit is updated with the current states, possibly replacing states already\nreferenced by the object.", + "line": " src/_renderer/renderer.js:314" + }, + { + "message": "Missing item type", + "line": " src/_renderer/renderer.js:459" + }, + { + "message": "Missing item type\nRemoves an object from this Renderer", + "line": " src/_renderer/renderer.js:515" + }, + { + "message": "Missing item type\nRenders a new frame, if neccessary.", + "line": " src/_renderer/renderer.js:551" + }, + { + "message": "Missing item type\nAttempts to pick an object.", + "line": " src/_renderer/renderer.js:1021" + }, + { + "message": "Missing item type\nReads the colors of some pixels in the last rendered frame.", + "line": " src/_renderer/renderer.js:1240" + }, + { + "message": "Missing item type\nDestroys this Renderer.", + "line": " src/_renderer/renderer.js:1286" + }, + { + "message": "Missing item type", + "line": " src/_renderer/renderer.new.js:7" + }, + { + "message": "Missing item type\nIndicates if the canvas is transparent", + "line": " src/_renderer/renderer.new.js:25" + }, + { + "message": "Missing item type\nOptional callback to fire when renderer wants to\nbind an output framebuffer. This is useful when we need to bind a stereo output buffer for WebVR.\n\nWhen this is missing, the renderer will implicitly bind\nWebGL's default framebuffer.\n\nThe callback takes one parameter, which is the index of the current\nrendering pass in which the buffer is to be bound.\n\nUse like this: myRenderer.bindOutputFramebuffer = function(pass) { .. });", + "line": " src/_renderer/renderer.new.js:31" + }, + { + "message": "Missing item type\nOptional callback to fire when renderer wants to\nunbind any output drawing framebuffer that was\npreviously bound with #bindOutputFramebuffer.\n\nThe callback takes one parameter, which is the index of the current\nrendering pass in which the buffer is to be bound.\n\nUse like this: myRenderer.unbindOutputFramebuffer = function(pass) { .. });\n\nCallback takes no parameters.", + "line": " src/_renderer/renderer.new.js:45" + }, + { + "message": "Missing item type\nThe current ambient color.", + "line": " src/_renderer/renderer.new.js:65" + }, + { + "message": "Missing item type\nFlags the object list as needing to be rebuilt from the object map.", + "line": " src/_renderer/renderer.new.js:270" }, { "message": "Missing item type\nFlags the object list as needing state orders to be recomputed.", - "line": " src/_renderer/renderer.js:267" + "line": " src/_renderer/renderer.new.js:275" }, { "message": "Missing item type\nFlags the object list as needing to be state-sorted.", - "line": " src/_renderer/renderer.js:272" + "line": " src/_renderer/renderer.new.js:280" }, { "message": "Missing item type\nFlags the image as needing to be redrawn from the object list.", - "line": " src/_renderer/renderer.js:277" + "line": " src/_renderer/renderer.new.js:285" }, { "message": "Missing item type\nReallocates WebGL resources for objects within this renderer.", - "line": " src/_renderer/renderer.js:283" + "line": " src/_renderer/renderer.new.js:291" }, { "message": "Missing item type\nInternally creates (or updates) a {@link xeogl.renderer.Object} of the given\nID from whatever component state cores are currently set on this {@link xeogl.Renderer}.\nThe object is created if it does not already exist in the display, otherwise\nit is updated with the current states, possibly replacing states already\nreferenced by the object.", - "line": " src/_renderer/renderer.js:306" + "line": " src/_renderer/renderer.new.js:314" }, { "message": "Missing item type", - "line": " src/_renderer/renderer.js:449" + "line": " src/_renderer/renderer.new.js:459" }, { "message": "Missing item type\nRemoves an object from this Renderer", - "line": " src/_renderer/renderer.js:505" + "line": " src/_renderer/renderer.new.js:515" }, { "message": "Missing item type\nRenders a new frame, if neccessary.", - "line": " src/_renderer/renderer.js:541" + "line": " src/_renderer/renderer.new.js:551" }, { "message": "Missing item type\nAttempts to pick an object.", - "line": " src/_renderer/renderer.js:878" + "line": " src/_renderer/renderer.new.js:1015" }, { "message": "Missing item type\nReads the colors of some pixels in the last rendered frame.", - "line": " src/_renderer/renderer.js:1097" + "line": " src/_renderer/renderer.new.js:1234" }, { "message": "Missing item type\nDestroys this Renderer.", - "line": " src/_renderer/renderer.js:1143" + "line": " src/_renderer/renderer.new.js:1280" }, { "message": "Missing item type", @@ -30521,23 +31239,23 @@ }, { "message": "Missing item type\nCreates a default canvas in the DOM.", - "line": " src/canvas/canvas.js:391" + "line": " src/canvas/canvas.js:393" }, { "message": "Missing item type\nCreates a image element behind the canvas, for purpose of showing a custom background.", - "line": " src/canvas/canvas.js:421" + "line": " src/canvas/canvas.js:423" }, { "message": "Missing item type\nCreates an invisible DIV over the canvas, for purpose of catching\ninput events without interfering with app-lever UI bits floating underneath.", - "line": " src/canvas/canvas.js:448" + "line": " src/canvas/canvas.js:450" }, { "message": "Missing item type\nInitialises the WebGL context", - "line": " src/canvas/canvas.js:485" + "line": " src/canvas/canvas.js:487" }, { "message": "Missing item type\nReads colors of pixels from the last rendered frame.\n\n

    Call this method like this:

    \n\n````JavaScript\n\n// Ignore transparent pixels (default is false)\nvar opaqueOnly = true;\n\nvar colors = new Float32Array(8);\n\nmyCanvas.readPixels([ 100, 22, 12, 33 ], colors, 2, opaqueOnly);\n````\n\nThen the r,g,b components of the colors will be set to the colors at those pixels.", - "line": " src/canvas/canvas.js:585" + "line": " src/canvas/canvas.js:587" }, { "message": "Missing item type\nImplement protected virtual template method {{#crossLink \"Geometry/method:_update\"}}{{/crossLink}},\nto generate geometry data arrays.", @@ -30873,11 +31591,11 @@ }, { "message": "Missing item type\nReleases a shared component instance that was got earlier\nwith {{#crossLink \"Scene/getSharedComponent:method\"}}{{/crossLink}}.", - "line": " src/scene.js:1849" + "line": " src/scene.js:1876" }, { "message": "Missing item type\nCompiles and renders this Scene", - "line": " src/scene.js:1877" + "line": " src/scene.js:1904" }, { "message": "Missing item type\nInformation about available WebGL support", diff --git a/docs/files/examples_js_animation__module.js.html b/docs/files/examples_js_animation__module.js.html index 07208b200..298549abd 100644 --- a/docs/files/examples_js_animation__module.js.html +++ b/docs/files/examples_js_animation__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_animation_cameraFollowAnimation.js.html b/docs/files/examples_js_animation_cameraFollowAnimation.js.html index 7b959fc43..1d8eb6c58 100644 --- a/docs/files/examples_js_animation_cameraFollowAnimation.js.html +++ b/docs/files/examples_js_animation_cameraFollowAnimation.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_animation_cameraPath.js.html b/docs/files/examples_js_animation_cameraPath.js.html index e0f6ab176..ce97ae558 100644 --- a/docs/files/examples_js_animation_cameraPath.js.html +++ b/docs/files/examples_js_animation_cameraPath.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_animation_cameraPathAnimation.js.html b/docs/files/examples_js_animation_cameraPathAnimation.js.html index 05899632c..0cbbe08c8 100644 --- a/docs/files/examples_js_animation_cameraPathAnimation.js.html +++ b/docs/files/examples_js_animation_cameraPathAnimation.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_annotations__module.js.html b/docs/files/examples_js_annotations__module.js.html index 643d0c920..e33fbcb16 100644 --- a/docs/files/examples_js_annotations__module.js.html +++ b/docs/files/examples_js_annotations__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_annotations_annotation.js.html b/docs/files/examples_js_annotations_annotation.js.html index 9f75b7dc0..760b560cf 100644 --- a/docs/files/examples_js_annotations_annotation.js.html +++ b/docs/files/examples_js_annotations_annotation.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_annotations_pin.js.html b/docs/files/examples_js_annotations_pin.js.html index ce3362928..83bb2890c 100644 --- a/docs/files/examples_js_annotations_pin.js.html +++ b/docs/files/examples_js_annotations_pin.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -805,7 +807,7 @@

    File: examples/js/annotations/pin.js

    _entityVisible: function (visible) { if (!visible) { - this.visible = false; + this._setVisible(false); } this._visTester.setPinTestable(this.id, visible); }, diff --git a/docs/files/examples_js_controls__module.js.html b/docs/files/examples_js_controls__module.js.html index 12deac32b..5d71e12f3 100644 --- a/docs/files/examples_js_controls__module.js.html +++ b/docs/files/examples_js_controls__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_controls_bimCameraControl.js.html b/docs/files/examples_js_controls_bimCameraControl.js.html index 9baa7c580..4c8a50c31 100644 --- a/docs/files/examples_js_controls_bimCameraControl.js.html +++ b/docs/files/examples_js_controls_bimCameraControl.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_curves__module.js.html b/docs/files/examples_js_curves__module.js.html index 9af1b494e..52af673f9 100644 --- a/docs/files/examples_js_curves__module.js.html +++ b/docs/files/examples_js_curves__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_curves_cubicBezierCurve.js.html b/docs/files/examples_js_curves_cubicBezierCurve.js.html index 17faf0095..98cf9cf5c 100644 --- a/docs/files/examples_js_curves_cubicBezierCurve.js.html +++ b/docs/files/examples_js_curves_cubicBezierCurve.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_curves_curve.js.html b/docs/files/examples_js_curves_curve.js.html index c9c59f843..150c7ec55 100644 --- a/docs/files/examples_js_curves_curve.js.html +++ b/docs/files/examples_js_curves_curve.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_curves_path.js.html b/docs/files/examples_js_curves_path.js.html index 567db3f61..88537995a 100644 --- a/docs/files/examples_js_curves_path.js.html +++ b/docs/files/examples_js_curves_path.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_curves_quadraticBezierCurve.js.html b/docs/files/examples_js_curves_quadraticBezierCurve.js.html index 733dc5fe2..a2a155ab8 100644 --- a/docs/files/examples_js_curves_quadraticBezierCurve.js.html +++ b/docs/files/examples_js_curves_quadraticBezierCurve.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_curves_splineCurve.js.html b/docs/files/examples_js_curves_splineCurve.js.html index 186432ab9..378917706 100644 --- a/docs/files/examples_js_curves_splineCurve.js.html +++ b/docs/files/examples_js_curves_splineCurve.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_effects__module.js.html b/docs/files/examples_js_effects__module.js.html index 5f5db4551..06c09b7cf 100644 --- a/docs/files/examples_js_effects__module.js.html +++ b/docs/files/examples_js_effects__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_effects_cardboardEffect.js.html b/docs/files/examples_js_effects_cardboardEffect.js.html index dada16eaa..86451a354 100644 --- a/docs/files/examples_js_effects_cardboardEffect.js.html +++ b/docs/files/examples_js_effects_cardboardEffect.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_effects_highlightEntityEffect.js.html b/docs/files/examples_js_effects_highlightEntityEffect.js.html index 8b5ab3cdc..e7564a87a 100644 --- a/docs/files/examples_js_effects_highlightEntityEffect.js.html +++ b/docs/files/examples_js_effects_highlightEntityEffect.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_effects_stereoEffect.js.html b/docs/files/examples_js_effects_stereoEffect.js.html index b2e3ef192..36bb2c664 100644 --- a/docs/files/examples_js_effects_stereoEffect.js.html +++ b/docs/files/examples_js_effects_stereoEffect.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_generation__module.js.html b/docs/files/examples_js_generation__module.js.html index 1a7b6d3fd..533c6425f 100644 --- a/docs/files/examples_js_generation__module.js.html +++ b/docs/files/examples_js_generation__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_generation_geometryBuilder.js.html b/docs/files/examples_js_generation_geometryBuilder.js.html index d380c613b..286c6ed2b 100644 --- a/docs/files/examples_js_generation_geometryBuilder.js.html +++ b/docs/files/examples_js_generation_geometryBuilder.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_generation_voxelGeometryBuilder.js.html b/docs/files/examples_js_generation_voxelGeometryBuilder.js.html index 872d9fcb4..97be30870 100644 --- a/docs/files/examples_js_generation_voxelGeometryBuilder.js.html +++ b/docs/files/examples_js_generation_voxelGeometryBuilder.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_geometry__module.js.html b/docs/files/examples_js_geometry__module.js.html index 65b2e2bcc..fe885a5da 100644 --- a/docs/files/examples_js_geometry__module.js.html +++ b/docs/files/examples_js_geometry__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_geometry_heightmapGeometry.js.html b/docs/files/examples_js_geometry_heightmapGeometry.js.html index 41e197cd3..50f681e79 100644 --- a/docs/files/examples_js_geometry_heightmapGeometry.js.html +++ b/docs/files/examples_js_geometry_heightmapGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_geometry_nintendo3DSGeometry.js.html b/docs/files/examples_js_geometry_nintendo3DSGeometry.js.html index 3075b572c..313c8172a 100644 --- a/docs/files/examples_js_geometry_nintendo3DSGeometry.js.html +++ b/docs/files/examples_js_geometry_nintendo3DSGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_geometry_objGeometry.js.html b/docs/files/examples_js_geometry_objGeometry.js.html index 651530566..bd7910f52 100644 --- a/docs/files/examples_js_geometry_objGeometry.js.html +++ b/docs/files/examples_js_geometry_objGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_geometry_teapotGeometry.js.html b/docs/files/examples_js_geometry_teapotGeometry.js.html index 2dceb0dbd..1914f2ace 100644 --- a/docs/files/examples_js_geometry_teapotGeometry.js.html +++ b/docs/files/examples_js_geometry_teapotGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_geometry_vectorTextGeometry.js.html b/docs/files/examples_js_geometry_vectorTextGeometry.js.html index be727574c..f8dd78fdd 100644 --- a/docs/files/examples_js_geometry_vectorTextGeometry.js.html +++ b/docs/files/examples_js_geometry_vectorTextGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_helpers__module.js.html b/docs/files/examples_js_helpers__module.js.html index 37c2ed6f8..1e076d872 100644 --- a/docs/files/examples_js_helpers__module.js.html +++ b/docs/files/examples_js_helpers__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_helpers_axisHelper.js.html b/docs/files/examples_js_helpers_axisHelper.js.html index f21d3c0e8..10551f0c1 100644 --- a/docs/files/examples_js_helpers_axisHelper.js.html +++ b/docs/files/examples_js_helpers_axisHelper.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_helpers_labelHelper.js.html b/docs/files/examples_js_helpers_labelHelper.js.html index cd88fe1c6..16a02e26c 100644 --- a/docs/files/examples_js_helpers_labelHelper.js.html +++ b/docs/files/examples_js_helpers_labelHelper.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_helpers_lookatHelper.js.html b/docs/files/examples_js_helpers_lookatHelper.js.html index 0bc00ac2e..4ba0437e9 100644 --- a/docs/files/examples_js_helpers_lookatHelper.js.html +++ b/docs/files/examples_js_helpers_lookatHelper.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_helpers_pointLightHelper.js.html b/docs/files/examples_js_helpers_pointLightHelper.js.html index e0efa8177..45ca8c498 100644 --- a/docs/files/examples_js_helpers_pointLightHelper.js.html +++ b/docs/files/examples_js_helpers_pointLightHelper.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_helpers_splineCurveHelper.js.html b/docs/files/examples_js_helpers_splineCurveHelper.js.html index 6c3fbdbb2..fd49cbdc1 100644 --- a/docs/files/examples_js_helpers_splineCurveHelper.js.html +++ b/docs/files/examples_js_helpers_splineCurveHelper.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_marking__module.js.html b/docs/files/examples_js_marking__module.js.html index 1496318e7..7650ecf04 100644 --- a/docs/files/examples_js_marking__module.js.html +++ b/docs/files/examples_js_marking__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_marking_pointMarkings.js.html b/docs/files/examples_js_marking_pointMarkings.js.html index 802112006..ffa1618de 100644 --- a/docs/files/examples_js_marking_pointMarkings.js.html +++ b/docs/files/examples_js_marking_pointMarkings.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_models__module.js.html b/docs/files/examples_js_models__module.js.html index 87f3becf1..751e51474 100644 --- a/docs/files/examples_js_models__module.js.html +++ b/docs/files/examples_js_models__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_models_buildableModel.js.html b/docs/files/examples_js_models_buildableModel.js.html index a821409f5..2283b74a3 100644 --- a/docs/files/examples_js_models_buildableModel.js.html +++ b/docs/files/examples_js_models_buildableModel.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_models_sceneJSModel.js.html b/docs/files/examples_js_models_sceneJSModel.js.html index 25bd98b69..93881dc96 100644 --- a/docs/files/examples_js_models_sceneJSModel.js.html +++ b/docs/files/examples_js_models_sceneJSModel.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_skyboxes__module.js.html b/docs/files/examples_js_skyboxes__module.js.html index 795d1575b..aca0d0c69 100644 --- a/docs/files/examples_js_skyboxes__module.js.html +++ b/docs/files/examples_js_skyboxes__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_skyboxes_skybox.js.html b/docs/files/examples_js_skyboxes_skybox.js.html index e69ca4380..7c44d5770 100644 --- a/docs/files/examples_js_skyboxes_skybox.js.html +++ b/docs/files/examples_js_skyboxes_skybox.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_stories__module.js.html b/docs/files/examples_js_stories__module.js.html index e53be2c54..0b1064fe4 100644 --- a/docs/files/examples_js_stories__module.js.html +++ b/docs/files/examples_js_stories__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_stories_annotationStory.js.html b/docs/files/examples_js_stories_annotationStory.js.html index c0d024fe9..067096d72 100644 --- a/docs/files/examples_js_stories_annotationStory.js.html +++ b/docs/files/examples_js_stories_annotationStory.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_stories_story.js.html b/docs/files/examples_js_stories_story.js.html index 445013a3d..bd4a59e92 100644 --- a/docs/files/examples_js_stories_story.js.html +++ b/docs/files/examples_js_stories_story.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_zspace__module.js.html b/docs/files/examples_js_zspace__module.js.html index 4e97aca88..1579536ba 100644 --- a/docs/files/examples_js_zspace__module.js.html +++ b/docs/files/examples_js_zspace__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_zspace_zSpaceEffect.js.html b/docs/files/examples_js_zspace_zSpaceEffect.js.html index 51d4ae081..980aa2248 100644 --- a/docs/files/examples_js_zspace_zSpaceEffect.js.html +++ b/docs/files/examples_js_zspace_zSpaceEffect.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_zspace_zSpaceEffect_complete.js.html b/docs/files/examples_js_zspace_zSpaceEffect_complete.js.html index 369050bbc..ade2e6a76 100644 --- a/docs/files/examples_js_zspace_zSpaceEffect_complete.js.html +++ b/docs/files/examples_js_zspace_zSpaceEffect_complete.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_zspace_zSpaceStylusControl.js.html b/docs/files/examples_js_zspace_zSpaceStylusControl.js.html index cab9fb999..1f2bcb7dd 100644 --- a/docs/files/examples_js_zspace_zSpaceStylusControl.js.html +++ b/docs/files/examples_js_zspace_zSpaceStylusControl.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/examples_js_zspace_zSpaceStylusControlV2.js.html b/docs/files/examples_js_zspace_zSpaceStylusControlV2.js.html index c1340ba25..838c6c934 100644 --- a/docs/files/examples_js_zspace_zSpaceStylusControlV2.js.html +++ b/docs/files/examples_js_zspace_zSpaceStylusControlV2.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_chunks_chunk.js.html b/docs/files/src__renderer_chunks_chunk.js.html index 9c9c6a8a3..88ffb47a2 100644 --- a/docs/files/src__renderer_chunks_chunk.js.html +++ b/docs/files/src__renderer_chunks_chunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_chunks_chunkFactory.js.html b/docs/files/src__renderer_chunks_chunkFactory.js.html index 683765f9f..937a4ca8e 100644 --- a/docs/files/src__renderer_chunks_chunkFactory.js.html +++ b/docs/files/src__renderer_chunks_chunkFactory.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_chunks_clipsChunk.js.html b/docs/files/src__renderer_chunks_clipsChunk.js.html index 1adc077b7..291df2968 100644 --- a/docs/files/src__renderer_chunks_clipsChunk.js.html +++ b/docs/files/src__renderer_chunks_clipsChunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -281,6 +283,10 @@

    File: src/_renderer/chunks/clipsChunk.js

    } } } + }, + + outline: function(frameCtx) { + this.drawPick(frameCtx); } }); diff --git a/docs/files/src__renderer_chunks_colorBufferChunk.js.html b/docs/files/src__renderer_chunks_colorBufferChunk.js.html index 81771acbd..96ac068d0 100644 --- a/docs/files/src__renderer_chunks_colorBufferChunk.js.html +++ b/docs/files/src__renderer_chunks_colorBufferChunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_chunks_depthBufferChunk.js.html b/docs/files/src__renderer_chunks_depthBufferChunk.js.html index d2959e108..b5511d0ce 100644 --- a/docs/files/src__renderer_chunks_depthBufferChunk.js.html +++ b/docs/files/src__renderer_chunks_depthBufferChunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_chunks_geometryChunk.js.html b/docs/files/src__renderer_chunks_geometryChunk.js.html index 100ff543e..cdbaf69db 100644 --- a/docs/files/src__renderer_chunks_geometryChunk.js.html +++ b/docs/files/src__renderer_chunks_geometryChunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -233,6 +235,10 @@

    File: src/_renderer/chunks/geometryChunk.js

    var pickPrimitive = this.program.pickPrimitive; this._aPositionPickPrimitive = pickPrimitive.getAttribute("position"); this._aColorPickPrimitive = pickPrimitive.getAttribute("color"); + + var outline = this.program.outline; + this._aPositionOutline = outline.getAttribute("position"); + this._aNormalOutline = outline.getAttribute("normal"); }, draw: function (frameCtx) { @@ -316,6 +322,26 @@

    File: src/_renderer/chunks/geometryChunk.js

    if (this._aColorPickPrimitive) { this._aColorPickPrimitive.bindFloatArrayBuffer(state.getPickColors()); } + }, + + outline: function (frameCtx) { + + var state = this.state; + + if (this._aPositionOutline) { + this._aPositionOutline.bindFloatArrayBuffer(state.positions); + frameCtx.bindArray++; + } + + if (this._aNormalOutline) { + this._aNormalOutline.bindFloatArrayBuffer(state.normals); + frameCtx.bindArray++; + } + + if (state.indices) { + state.indices.bind(); + frameCtx.bindArray++; + } } }); diff --git a/docs/files/src__renderer_chunks_renderTargetChunk.js.html b/docs/files/src__renderer_chunks_renderTargetChunk.js.html index 254e42796..525ad8a0c 100644 --- a/docs/files/src__renderer_chunks_renderTargetChunk.js.html +++ b/docs/files/src__renderer_chunks_renderTargetChunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_chunks_viewportChunk.js.html b/docs/files/src__renderer_chunks_viewportChunk.js.html index c96a5b6f5..cbc30812e 100644 --- a/docs/files/src__renderer_chunks_viewportChunk.js.html +++ b/docs/files/src__renderer_chunks_viewportChunk.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -226,18 +228,19 @@

    File: src/_renderer/chunks/viewportChunk.js

    }, shadow: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); }, pickObject: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); }, pickPrimitive: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); + }, + + outline: function() { + this.draw(); } }); diff --git a/docs/files/src__renderer_object.js.html b/docs/files/src__renderer_object.js.html index c1c9bbd6d..b7db16a89 100644 --- a/docs/files/src__renderer_object.js.html +++ b/docs/files/src__renderer_object.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_program.js.html b/docs/files/src__renderer_program.js.html index c0e528565..4a0c399e5 100644 --- a/docs/files/src__renderer_program.js.html +++ b/docs/files/src__renderer_program.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -259,6 +261,12 @@

    File: src/_renderer/program.js

    */ this.pickPrimitive = null; + /** + * The outline program + * @type webgl.Program + */ + this.outline = null; + /** * The count of display objects using this program * @type Number @@ -317,6 +325,7 @@

    File: src/_renderer/program.js

    this.shadow = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexShadow, this.source.fragmentShadow); this.pickObject = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexPickObject, this.source.fragmentPickObject); this.pickPrimitive = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexPickPrimitive, this.source.fragmentPickPrimitive); + this.outline = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexOutline, this.source.fragmentOutline); if (!this.draw.allocated) { this.errorLog = ["Draw program failed to allocate"].concat(this.draw.errorLog); @@ -338,6 +347,11 @@

    File: src/_renderer/program.js

    return; } + if (!this.outline.allocated) { + this.errorLog = ["Outline effect program failed to allocate"].concat(this.outline.errorLog); + return; + } + this.allocated = true; if (!this.draw.compiled) { @@ -360,6 +374,11 @@

    File: src/_renderer/program.js

    return; } + if (!this.outline.compiled) { + this.errorLog = ["Outline effect program failed to compile"].concat(this.outline.errorLog); + return; + } + this.compiled = true; if (!this.draw.linked) { @@ -382,6 +401,11 @@

    File: src/_renderer/program.js

    return; } + if (!this.outline.linked) { + this.errorLog = ["Outline effect program failed to link"].concat(this.outline.errorLog); + return; + } + this.linked = true; if (!this.draw.validated) { @@ -404,9 +428,35 @@

    File: src/_renderer/program.js

    return; } + if (!this.outline.validated) { + this.errorLog = ["Outline effect program failed to validate"].concat(this.outline.errorLog); + return; + } + this.validated = true; }; + /** + * Destroys this program. + */ + xeogl.renderer.Program.prototype.destroy = function() { + if (this.draw) { + this.draw.destroy(); + } + if (this.shadow) { + this.shadow.destroy(); + } + if (this.pickObject) { + this.pickObject.destroy(); + } + if (this.pickPrimitive) { + this.pickPrimitive.destroy(); + } + if (this.outline) { + this.outline.destroy(); + } + }; + })(); diff --git a/docs/files/src__renderer_programFactory.js.html b/docs/files/src__renderer_programFactory.js.html index b753a7784..15a5aaa28 100644 --- a/docs/files/src__renderer_programFactory.js.html +++ b/docs/files/src__renderer_programFactory.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -266,15 +268,12 @@

    File: src/_renderer/programFactory.js

    var program = programState.program; - program.draw.destroy(); - program.shadow.destroy(); - program.pickObject.destroy(); - program.pickPrimitive.destroy(); - xeogl.renderer.ProgramSourceFactory.putSource(program.hash); delete this._programStates[program.hash]; + program.destroy(); + this.stats.memory.programs--; } }; diff --git a/docs/files/src__renderer_programSource.js.html b/docs/files/src__renderer_programSource.js.html index 045ef85d5..8dfb1f8a2 100644 --- a/docs/files/src__renderer_programSource.js.html +++ b/docs/files/src__renderer_programSource.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -221,12 +223,15 @@

    File: src/_renderer/programSource.js

    * @param {String} fragmentDraw Fragment shader source for drawing. * @param {String} vertexShadow Vertex shader source for drawing the shadow buffer. * @param {String} fragmentShadow Fragment shader source for drawing the shadow buffer. + * @param {String} vertexOutline Vertex shader source for drawing outlines. + * @param {String} fragmentOutline Fragment shader source for drawing outlines. */ xeogl.renderer.ProgramSource = function (hash, vertexPickObject, fragmentPickObject, vertexPickPrimitive, fragmentPickPrimitive, vertexDraw, fragmentDraw, - vertexShadow, fragmentShadow) { + vertexShadow, fragmentShadow, + vertexOutline, fragmentOutline) { /** * Hash code identifying the capabilities of the {@link xeogl.renderer.Program} that is compiled from this source @@ -282,6 +287,18 @@

    File: src/_renderer/programSource.js

    */ this.fragmentShadow = fragmentShadow; + /** + * Vertex shader source for rendering outlines. + * @type {Array of String} + */ + this.vertexOutline = vertexOutline; + + /** + * Fragment shader source for rendering outlines. + * @type {Array of String} + */ + this.fragmentOutline = fragmentOutline; + /** * Count of {@link xeogl.renderer.Program}s compiled from this program source code * @type Number diff --git a/docs/files/src__renderer_programSourceFactory.js.html b/docs/files/src__renderer_programSourceFactory.js.html index 477a3229c..dbf5d9c9c 100644 --- a/docs/files/src__renderer_programSourceFactory.js.html +++ b/docs/files/src__renderer_programSourceFactory.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -239,6 +241,8 @@

    File: src/_renderer/programSourceFactory.js

    var fragmentPickPrimSrc; var vertexShadowSrc; var fragmentShadowSrc; + var vertexOutlineSrc; + var fragmentOutlineSrc; /** * Get source code for a program to render the given states. @@ -278,7 +282,9 @@

    File: src/_renderer/programSourceFactory.js

    vertexDraw(), fragmentDraw(), vertexShadow(), - fragmentShadow() + fragmentShadow(), + vertexOutline(), + fragmentOutline() ); cache[hash] = source; @@ -464,6 +470,75 @@

    File: src/_renderer/programSourceFactory.js

    return fragmentShadowSrc = end(); } + function vertexOutline() { + begin(); + add("attribute vec4 position;"); + add("uniform mat4 modelMatrix;"); + add("uniform mat4 viewMatrix;"); + add("uniform mat4 projMatrix;"); + add("uniform float thickness;"); + + if (normals) { + add("attribute vec3 normal;"); + } + + if (states.billboard.active) { + add("void billboard(inout mat4 mat) {"); + add(" mat[0][0] = 1.0;"); + add(" mat[0][1] = 0.0;"); + add(" mat[0][2] = 0.0;"); + if (states.billboard.spherical) { + add(" mat[1][0] = 0.0;"); + add(" mat[1][1] = 1.0;"); + add(" mat[1][2] = 0.0;"); + } + add(" mat[2][0] = 0.0;"); + add(" mat[2][1] = 0.0;"); + add(" mat[2][2] =1.0;"); + add("}"); + } + + add("void main(void) {"); + + add("mat4 viewMatrix2 = viewMatrix;"); + add("mat4 modelMatrix2 = modelMatrix;"); + + if (states.stationary.active) { + add("viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;") + } + + if (states.billboard.active) { + add("billboard(modelMatrix2);"); + add("billboard(viewMatrix2);"); + } + + // Displacement + + if (normals) { + add("vec4 projPos = projMatrix * viewMatrix2 * modelMatrix2 * vec4(position.xyz, 1.0); "); + add(" vec3 offset = (normalize(normal) * (thickness * 0.0005 * (projPos.z/1.0)));"); + } else { + add(" vec3 offset = vec3(0.0, 0.0, 0.0);"); + } + + add("vec4 worldVertex = modelMatrix * vec4(position.xyz + offset, 1.0); "); + + add(" gl_Position = projMatrix * (viewMatrix * worldVertex);"); + add("}"); + return vertexOutlineSrc = end(); + } + + function fragmentOutline() { + begin(); + add("precision " + getFSFloatPrecision(states.gl) + " float;"); + add("uniform vec3 color;"); + add("void main(void) {"); + add(" gl_FragColor = vec4(color, 1.0);"); + add("}"); + + return fragmentOutlineSrc = end(); + } + function vertexDraw() { var vertex = states.shader.vertex; @@ -1230,7 +1305,8 @@

    File: src/_renderer/programSourceFactory.js

    } if (light.type === "dir" && light.space === "view") { add("uniform vec3 lightDir" + i + ";"); - } if (light.type === "point" && light.space === "view") { + } + if (light.type === "point" && light.space === "view") { add("uniform vec3 lightPos" + i + ";"); } else { add("varying vec4 vViewLightReverseDirAndDist" + i + ";"); diff --git a/docs/files/src__renderer_renderer.js.html b/docs/files/src__renderer_renderer.js.html index f1b803749..27739ff87 100644 --- a/docs/files/src__renderer_renderer.js.html +++ b/docs/files/src__renderer_renderer.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -464,6 +466,14 @@

    File: src/_renderer/renderer.js

    */ this.viewport = null; + /** + Outline state. + @property outline + @type {renderer.Outline} + */ + this.outline = null; + + //----------------- Renderer dirty flags ------------------------------- /** @@ -544,6 +554,7 @@

    File: src/_renderer/renderer.js

    object.stationary = this.stationary; object.viewport = this.viewport; object.lights = this.lights; + object.outline = this.outline; // Build hash of the object's state configuration. This is used // to hash the object's shader so that it may be reused by other @@ -615,8 +626,9 @@

    File: src/_renderer/renderer.js

    this._setChunk(object, 10, this.material.type, this.material); // Supports different material systems this._setChunk(object, 11, "clips", this.clips); this._setChunk(object, 12, "viewport", this.viewport); - this._setChunk(object, 13, "geometry", this.geometry); - this._setChunk(object, 14, "draw", this.geometry, true); // Must be last + this._setChunk(object, 13, "outline", this.outline); + this._setChunk(object, 14, "geometry", this.geometry); + this._setChunk(object, 15, "draw", this.geometry, true); // Must be last // Ambient light is global across everything in display, and // can never be disabled, so grab it now because we want to @@ -813,8 +825,8 @@

    File: src/_renderer/renderer.js

    object.sortKey = -1; } else { object.sortKey = - ((object.stage.priority + 1) * 10000000000000000) - + ((object.modes.transparent ? 2 : 1) * 100000000000000) + ((object.stage.priority + 1) * 100000000000000) + // + ((object.modes.transparent ? 2 : 1) * 100000000000000) + ((object.layer.priority + 1) * 10000000000000) + ((object.program.id + 1) * 100000000) + ((object.material.id + 1) * 10000) @@ -877,9 +889,9 @@

    File: src/_renderer/renderer.js

    if (shadowObjectLists.hasOwnProperty(lightId)) { shadowObjectList = shadowObjectLists[lightId]; light = shadowObjectList.light; - // if (light.shadowDirty) { - this._renderShadowMap(light, shadowObjectList.objects); - // } + // if (light.shadowDirty) { + this._renderShadowMap(light, shadowObjectList.objects); + // } } } }; @@ -962,125 +974,258 @@

    File: src/_renderer/renderer.js

    renderBuf.unbind(); }; - xeogl.renderer.Renderer.prototype._renderObjectList = function (params) { + xeogl.renderer.Renderer.prototype._renderObjectList = (function () { - var gl = this.gl; + var outlinedObjects = []; + var lastChunkId = new Int32Array(30); - var ambient = this._ambient; - var ambientColor; - if (ambient) { - var color = ambient.color; - var intensity = ambient.intensity; - this.ambientColor[0] = color[0] * intensity; - this.ambientColor[1] = color[1] * intensity; - this.ambientColor[2] = color[2] * intensity; - } else { - this.ambientColor[0] = 0; - this.ambientColor[1] = 0; - this.ambientColor[2] = 0; + var transparentObjects = []; + var numTransparentObjects = 0; + + function clearStateTracking() { + for (var i = 0; i < 20; i++) { + lastChunkId[i] = -9999999999; + } } - var frameCtx = this._frameCtx; + function drawObject(frameCtx, object) { + var chunks = object.chunks; + var chunk; + for (var i = 0, len = chunks.length; i < len; i++) { + chunk = chunks[i]; + if (chunk) { + if (chunk.draw && (chunk.unique || lastChunkId[i] !== chunk.id)) { + chunk.draw(frameCtx); + lastChunkId[i] = chunk.id; + } + } + } + } - frameCtx.renderTarget = null; - frameCtx.renderBuf = null; - frameCtx.depthbufEnabled = null; - frameCtx.clearDepth = null; - frameCtx.depthFunc = gl.LESS; - frameCtx.blendEnabled = false; - frameCtx.backfaces = true; - frameCtx.frontface = true; // true == "ccw" else "cw" - frameCtx.textureUnit = 0; - frameCtx.transparent = false; // True while rendering transparency bin - frameCtx.ambientColor = this.ambientColor; - frameCtx.drawElements = 0; - frameCtx.useProgram = 0; - frameCtx.bindTexture = 0; - frameCtx.bindArray = 0; - frameCtx.pass = params.pass; - frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer; - frameCtx.pickViewMatrix = params.pickViewMatrix; - frameCtx.pickProjMatrix = params.pickProjMatrix; - frameCtx.pickIndex = 0; + function drawObjectOutline(frameCtx, object) { + var chunks = object.chunks; + var chunk; + for (var i = 0, len = chunks.length; i < len; i++) { + chunk = chunks[i]; + if (chunk) { + if (chunk.outline && (chunk.unique || lastChunkId[i] !== chunk.id)) { + chunk.outline(frameCtx); + lastChunkId[i] = chunk.id; + } + } + } + } - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + return function (params) { - if (this.transparent) { // Canvas is transparent - gl.clearColor(0, 0, 0, 0); - } else { - gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0); - } + var gl = this.gl; - gl.enable(gl.DEPTH_TEST); - gl.frontFace(gl.CCW); - gl.disable(gl.CULL_FACE); - gl.disable(gl.BLEND); + var ambient = this._ambient; + if (ambient) { + var color = ambient.color; + var intensity = ambient.intensity; + this.ambientColor[0] = color[0] * intensity; + this.ambientColor[1] = color[1] * intensity; + this.ambientColor[2] = color[2] * intensity; + } else { + this.ambientColor[0] = 0; + this.ambientColor[1] = 0; + this.ambientColor[2] = 0; + } - var i; - var len; - var object; - var j; - var lenj; - var chunks; - var chunk; + var frameCtx = this._frameCtx; + + frameCtx.renderTarget = null; + frameCtx.renderBuf = null; + frameCtx.depthbufEnabled = null; + frameCtx.clearDepth = null; + frameCtx.depthFunc = gl.LESS; + frameCtx.blendEnabled = false; + frameCtx.backfaces = true; + frameCtx.frontface = true; // true == "ccw" else "cw" + frameCtx.textureUnit = 0; + frameCtx.transparent = false; // True while rendering transparency bin + frameCtx.ambientColor = this.ambientColor; + frameCtx.drawElements = 0; + frameCtx.useProgram = 0; + frameCtx.bindTexture = 0; + frameCtx.bindArray = 0; + frameCtx.pass = params.pass; + frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer; + frameCtx.pickViewMatrix = params.pickViewMatrix; + frameCtx.pickProjMatrix = params.pickProjMatrix; + frameCtx.pickIndex = 0; + + gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + + if (this.transparent) { // Canvas is transparent + gl.clearColor(0, 0, 0, 0); + } else { + gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0); + } - var lastChunkId = this._lastChunkId = this._lastChunkId || new Int32Array(30); - for (i = 0; i < 20; i++) { - lastChunkId[i] = -9999999999999; - } + gl.enable(gl.DEPTH_TEST); + gl.frontFace(gl.CCW); + gl.enable(gl.CULL_FACE); + gl.depthMask(true); - var startTime = (new Date()).getTime(); + var i; + var len; + var object; - if (this.bindOutputFramebuffer) { - this.bindOutputFramebuffer(params.pass); - } + var startTime = (new Date()).getTime(); - if (params.clear) { - gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); - } + if (this.bindOutputFramebuffer) { + this.bindOutputFramebuffer(params.pass); + } - for (i = 0, len = this._objectListLen; i < len; i++) { - object = this._objectList[i]; - if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) { - continue; + if (params.clear) { + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); } - chunks = object.chunks; - for (j = 0, lenj = chunks.length; j < lenj; j++) { - chunk = chunks[j]; - if (chunk) { - if (chunk.draw && (chunk.unique || lastChunkId[j] !== chunk.id)) { - chunk.draw(frameCtx); - lastChunkId[j] = chunk.id; + + // Render opaque, non-outlined objects + + var numOutlinedObjects = 0; + + numTransparentObjects = 0; + + clearStateTracking(); + + for (i = 0, len = this._objectListLen; i < len; i++) { + object = this._objectList[i]; + if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) { + continue; + } + if (object.modes.transparent) { + transparentObjects[numTransparentObjects++] = object; + continue; + } + if (object.modes.outline) { + outlinedObjects[numOutlinedObjects++] = object; + continue; + } + drawObject(frameCtx, object); + } + + // Render opaque outlined objects + + if (numOutlinedObjects > 0) { + + // Render objects + + gl.enable(gl.STENCIL_TEST); + gl.stencilFunc(gl.ALWAYS, 1, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + gl.stencilMask(1); + gl.clearStencil(0); + gl.clear(gl.STENCIL_BUFFER_BIT); + + clearStateTracking(); + + for (i = 0; i < numOutlinedObjects; i++) { + drawObject(frameCtx, outlinedObjects[i]); + } + + // Render outlines + + gl.stencilFunc(gl.EQUAL, 0, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + gl.stencilMask(0x00); + gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals + + clearStateTracking(); + + for (i = 0; i < numOutlinedObjects; i++) { + drawObjectOutline(frameCtx, outlinedObjects[i]); + } + + gl.disable(gl.STENCIL_TEST); + } + + // Draw transparent objects + + if (numTransparentObjects > 0) { + + gl.enable(gl.CULL_FACE); + gl.enable(gl.BLEND); + // gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + + numOutlinedObjects = 0; + + clearStateTracking(); + + for (i = 0; i < numTransparentObjects; i++) { + object = transparentObjects[i]; + if (object.modes.outline) { + outlinedObjects[numOutlinedObjects++] = object; // Build outlined list + continue; } + drawObject(frameCtx, object); } + + // Transparent outlined objects are not supported yet + + //if (numOutlinedObjects > 0) { + // + // gl.disable(gl.CULL_FACE); + // gl.enable(gl.STENCIL_TEST); + // gl.stencilFunc(gl.ALWAYS, 1, 1); + // gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + // gl.stencilMask(1); + // gl.clearStencil(0); + // gl.clear(gl.STENCIL_BUFFER_BIT); + // // gl.enable(gl.DEPTH_TEST); + // + // clearStateTracking(); + // + // for (i = 0, len = numOutlinedObjects; i < len; i++) { + // drawObject(frameCtx, outlinedObjects[i]); + // } + // + // gl.stencilFunc(gl.EQUAL, 0, 1); + // gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + // gl.stencilMask(0x00); + // gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals + // + // clearStateTracking(); + // + // for (i = 0, len = numOutlinedObjects; i < len; i++) { + // drawObjectOutline(frameCtx, outlinedObjects[i]); + // } + // + // gl.disable(gl.STENCIL_TEST); + //} + + gl.disable(gl.BLEND); } - } - var endTime = Date.now(); - var frameStats = this.stats.frame; + var endTime = Date.now(); + var frameStats = this.stats.frame; - frameStats.renderTime = (endTime - startTime) / 1000.0; - frameStats.drawElements = frameCtx.drawElements; - frameStats.useProgram = frameCtx.useProgram; - frameStats.bindTexture = frameCtx.bindTexture; - frameStats.bindArray = frameCtx.bindArray; + frameStats.renderTime = (endTime - startTime) / 1000.0; + frameStats.drawElements = frameCtx.drawElements; + frameStats.useProgram = frameCtx.useProgram; + frameStats.bindTexture = frameCtx.bindTexture; + frameStats.bindArray = frameCtx.bindArray; - if (frameCtx.renderBuf) { - frameCtx.renderBuf.unbind(); - } + if (frameCtx.renderBuf) { + frameCtx.renderBuf.unbind(); + } - var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); + var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); - for (var ii = 0; ii < numTextureUnits; ii++) { - gl.activeTexture(gl.TEXTURE0 + ii); - gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); - gl.bindTexture(gl.TEXTURE_2D, null); - } + for (var ii = 0; ii < numTextureUnits; ii++) { + gl.activeTexture(gl.TEXTURE0 + ii); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); + gl.bindTexture(gl.TEXTURE_2D, null); + } - if (this.unbindOutputFramebuffer) { - this.unbindOutputFramebuffer(params.pass); - } - }; + if (this.unbindOutputFramebuffer) { + this.unbindOutputFramebuffer(params.pass); + } + }; + })(); /** * Attempts to pick an object. diff --git a/docs/files/src__renderer_renderer.new.js.html b/docs/files/src__renderer_renderer.new.js.html new file mode 100644 index 000000000..f2cddbf1a --- /dev/null +++ b/docs/files/src__renderer_renderer.new.js.html @@ -0,0 +1,1514 @@ + + + + + src/_renderer/renderer.new.js - xeogl + + + + + + + + + +
    +
    +
    + +

    xeogl / API Docs

    + +
    +
    + API Docs for: 1.0.0 +
    +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    File: src/_renderer/renderer.new.js

    + +
    +
    +(function () {
    +
    +    "use strict";
    +
    +    xeogl.renderer = xeogl.renderer || {};
    +
    +    /**
    +     *
    +     */
    +    xeogl.renderer.Renderer = function (stats, canvas, gl, options) {
    +
    +        options = options || {};
    +
    +        this.stats = stats || {};
    +
    +        this.gl = gl;
    +        this.canvas = canvas;
    +
    +        this._programFactory = new xeogl.renderer.ProgramFactory(this.stats, gl);
    +        this._objectFactory = new xeogl.renderer.ObjectFactory();
    +        this._chunkFactory = new xeogl.renderer.ChunkFactory();
    +
    +        this._shadowLightObjects = {}; // Objects for each light that has a shadow
    +
    +        /**
    +         * Indicates if the canvas is transparent
    +         * @type {boolean}
    +         */
    +        this.transparent = options.transparent === true;
    +
    +        /**
    +         * Optional callback to fire when renderer wants to
    +         * bind an output framebuffer. This is useful when we need to bind a stereo output buffer for WebVR.
    +         *
    +         * When this is missing, the renderer will implicitly bind
    +         * WebGL's default framebuffer.
    +         *
    +         * The callback takes one parameter, which is the index of the current
    +         * rendering pass in which the buffer is to be bound.
    +         *
    +         * Use like this: myRenderer.bindOutputFramebuffer = function(pass) { .. });
    +         */
    +        this.bindOutputFramebuffer = null;
    +
    +        /**
    +         * Optional callback to fire when renderer wants to
    +         * unbind any output drawing framebuffer that was
    +         * previously bound with #bindOutputFramebuffer.
    +         *
    +         * The callback takes one parameter, which is the index of the current
    +         * rendering pass in which the buffer is to be bound.
    +         *
    +         * Use like this: myRenderer.unbindOutputFramebuffer = function(pass) { .. });
    +         *
    +         * Callback takes no parameters.
    +         */
    +        this.unbindOutputFramebuffer = null;
    +
    +        // Objects mapped to their IDs
    +        this.objects = {};
    +
    +        // The current ambient color, if available
    +        this._ambient = null;
    +
    +        /**
    +         * The current ambient color.
    +         * @type Float32Array
    +         */
    +        this.ambientColor = xeogl.math.vec4([0, 0, 0, 1]);
    +
    +        // Objects in a list, ordered by state
    +        this._objectList = [];
    +        this._objectListLen = 0;
    +
    +        // List of objects that were rendered in the last picking pass,
    +        // for indexing when using color-index picking
    +        this._objectPickList = [];
    +        this._objectPickListLen = 0;
    +
    +        // Shadow->Object lookup
    +        this._shadowObjectLists = {};
    +
    +        // The frame context holds state shared across a single render of the
    +        // draw list, along with any results of the render, such as pick hits
    +        this._frameCtx = {
    +            canvas: this.canvas,
    +            renderTarget: null,
    +            renderBuf: null,
    +            depthbufEnabled: null,
    +            clearDepth: null,
    +            depthFunc: null,
    +            blendEnabled: false,
    +            backfaces: true,
    +            frontface: true, // true = "ccw" else "cw"
    +            textureUnit: 0,
    +            transparent: false, // True while rendering transparency bin
    +            ambientColor: null,
    +            drawElements: 0,
    +            useProgram: 0,
    +            bindTexture: 0,
    +            bindArray: null,
    +            pass: null,
    +            bindOutputFramebuffer: null,
    +            pickIndex: 0,
    +            shadowViewMatrix: null,
    +            shadowProjmatrix: null,
    +            pickViewMatrix: null,
    +            pickProjmatrix: null
    +        };
    +
    +        //----------------- Render states --------------------------------------
    +
    +        /**
    +         Visibility render state.
    +         @property visibility
    +         @type {renderer.Visibility}
    +         */
    +        this.visibility = null;
    +
    +        /**
    +         Culling render state.
    +         @property cull
    +         @type {renderer.Cull}
    +         */
    +        this.cull = null;
    +
    +        /**
    +         Modes render state.
    +         @property modes
    +         @type {renderer.Modes}
    +         */
    +        this.modes = null;
    +
    +        /**
    +         Render state for an effects layer.
    +         @property layer
    +         @type {renderer.Layer}
    +         */
    +        this.layer = null;
    +
    +        /**
    +         Render state for an effects pipeline stage.
    +         @property stage
    +         @type {renderer.Layer}
    +         */
    +        this.stage = null;
    +
    +        /**
    +         Depth buffer render state.
    +         @property depthBuf
    +         @type {renderer.DepthBuf}
    +         */
    +        this.depthBuf = null;
    +
    +        /**
    +         Color buffer render state.
    +         @property colorBuf
    +         @type {renderer.ColorBuf}
    +         */
    +        this.colorBuf = null;
    +
    +        /**
    +         Lights render state.
    +         @property lights
    +         @type {renderer.Lights}
    +         */
    +        this.lights = null;
    +
    +        /**
    +         Material render state.
    +         @property material
    +         @type {renderer.Material}
    +         */
    +        this.material = null;
    +
    +        /**
    +         Modelling transform render state.
    +         @property modelTransform
    +         @type {renderer.Transform}
    +         */
    +        this.modelTransform = null;
    +
    +        /**
    +         View transform render state.
    +         @property viewTransform
    +         @type {renderer.Transform}
    +         */
    +        this.viewTransform = null;
    +
    +        /**
    +         Projection transform render state.
    +         @property projTransform
    +         @type {renderer.Transform}
    +         */
    +        this.projTransform = null;
    +
    +        /**
    +         Billboard render state.
    +         @property billboard
    +         @type {renderer.Billboard}
    +         */
    +        this.billboard = null;
    +
    +        /**
    +         Stationary render state.
    +         @property stationary
    +         @type {renderer.Stationary}
    +         */
    +        this.stationary = null;
    +
    +        /**
    +         Color target render state.
    +         @property colorTarget
    +         @type {renderer.RenderTarget}
    +         */
    +        this.colorTarget = null;
    +
    +        /**
    +         Depth target render state.
    +         @property depthTarget
    +         @type {renderer.RenderTarget}
    +         */
    +        this.depthTarget = null;
    +
    +        /**
    +         Cross-section planes render state.
    +         @property clips
    +         @type {renderer.Clips}
    +         */
    +        this.clips = null;
    +
    +        /**
    +         Custom shader render state.
    +         @property shader
    +         @type {renderer.Shader}
    +         */
    +        this.shader = null;
    +
    +        /**
    +         Render state providing custom shader params.
    +         @property shaderParams
    +         @type {renderer.Shader}
    +         */
    +        this.shaderParams = null;
    +
    +        /**
    +         Geometry render state.
    +         @property geometry
    +         @type {renderer.Geometry}
    +         */
    +        this.geometry = null;
    +
    +        /**
    +         Viewport render state.
    +         @property viewport
    +         @type {renderer.Viewport}
    +         */
    +        this.viewport = null;
    +
    +        /**
    +         Outline state.
    +         @property outline
    +         @type {renderer.Outline}
    +         */
    +        this.outline = null;
    +
    +
    +        //----------------- Renderer dirty flags -------------------------------
    +
    +        /**
    +         * Flags the object list as needing to be rebuilt from the object map.
    +         */
    +        this.objectListDirty = true;
    +
    +        /**
    +         * Flags the object list as needing state orders to be recomputed.
    +         */
    +        this.stateOrderDirty = true;
    +
    +        /**
    +         * Flags the object list as needing to be state-sorted.
    +         */
    +        this.stateSortDirty = true;
    +
    +        /**
    +         * Flags the image as needing to be redrawn from the object list.
    +         */
    +        this.imageDirty = true;
    +    };
    +
    +    /**
    +     * Reallocates WebGL resources for objects within this renderer.
    +     */
    +    xeogl.renderer.Renderer.prototype.webglRestored = function (gl) {
    +
    +        this.gl = gl;
    +
    +        // Re-allocate programs
    +        this._programFactory.webglRestored(gl);
    +
    +        // Re-bind chunks to the programs
    +        this._chunkFactory.webglRestored();
    +
    +        // Rebuild pick buffer
    +        if (this.pickBuf) {
    +            this.pickBuf.webglRestored(gl);
    +        }
    +
    +        // Need redraw
    +
    +        this.imageDirty = true;
    +    };
    +
    +    /**
    +     * Internally creates (or updates) a {@link xeogl.renderer.Object} of the given
    +     * ID from whatever component state cores are currently set on this {@link xeogl.Renderer}.
    +     * The object is created if it does not already exist in the display, otherwise
    +     * it is updated with the current states, possibly replacing states already
    +     * referenced by the object.
    +     *
    +     * @param {String} objectId ID of object to create or update
    +     */
    +    xeogl.renderer.Renderer.prototype.buildObject = function (objectId) {
    +
    +        var object = this.objects[objectId];
    +
    +        if (!object) {
    +            object = this._objectFactory.get(objectId);
    +            object.hash = "";
    +        }
    +
    +        // Attach to the object any states that we need to get off it later.
    +        // Most of these will be used when composing the object's shader.
    +
    +        object.stage = this.stage;
    +        object.layer = this.layer;
    +        object.colorTarget = this.colorTarget;
    +        object.depthTarget = this.depthTarget;
    +        object.material = this.material;
    +        object.geometry = this.geometry;
    +        object.visibility = this.visibility;
    +        object.cull = this.cull;
    +        object.modes = this.modes;
    +        object.billboard = this.billboard;
    +        object.stationary = this.stationary;
    +        object.viewport = this.viewport;
    +        object.lights = this.lights;
    +        object.outline = this.outline;
    +
    +        // Build hash of the object's state configuration. This is used
    +        // to hash the object's shader so that it may be reused by other
    +        // objects that have the same state configuration.
    +
    +        var hash = ([
    +
    +            // Make sure that every state type
    +            // with a hash is concatenated here
    +
    +            this.geometry.hash,
    +            this.shader.hash,
    +            this.clips.hash,
    +            this.material.hash,
    +            this.lights.hash,
    +            this.modes.hash,
    +            this.billboard.hash,
    +            this.stationary.hash
    +
    +        ]).join(";");
    +
    +        var newProgram = false;
    +
    +        if (hash !== object.hash) {
    +
    +            // Get new program for object
    +
    +            if (object.program) {
    +                this._programFactory.put(object.program);
    +            }
    +
    +            object.program = this._programFactory.get(hash, this);
    +            object.hash = hash;
    +
    +            newProgram = true;
    +
    +            // Handle shader error
    +
    +            var programState = object.program;
    +            if (programState) {
    +                var program = programState.program;
    +                if (!program.allocated || !program.compiled || !program.validated || !program.linked) {
    +                    if (this.objects[objectId]) {
    +                        this.removeObject(objectId); // Don't keep faulty objects in the renderer
    +                    }
    +                    return {
    +                        error: true,
    +                        errorLog: program.errorLog
    +                    }
    +                }
    +            }
    +        }
    +
    +        // Build list of draw chunks on the object
    +
    +        // The order of some of these is important because some chunks will set
    +        // state on this._frameCtx to be consumed by other chunks downstream
    +
    +        this._setChunk(object, 0, "program", object.program); // Must be first
    +        this._setChunk(object, 1, "modelTransform", this.modelTransform);
    +        this._setChunk(object, 2, "viewTransform", this.viewTransform);
    +        this._setChunk(object, 3, "projTransform", this.projTransform);
    +        this._setChunk(object, 4, "modes", this.modes);
    +        this._setChunk(object, 5, "shader", this.shader);
    +        this._setChunk(object, 6, "shaderParams", this.shaderParams);
    +        this._setChunk(object, 7, "depthBuf", this.depthBuf);
    +        this._setChunk(object, 8, "colorBuf", this.colorBuf);
    +        this._setChunk(object, 9, "lights", this.lights);
    +        this._setChunk(object, 10, this.material.type, this.material); // Supports different material systems
    +        this._setChunk(object, 11, "clips", this.clips);
    +        this._setChunk(object, 12, "viewport", this.viewport);
    +        this._setChunk(object, 13, "outline", this.outline);
    +        this._setChunk(object, 14, "geometry", this.geometry);
    +        this._setChunk(object, 15, "draw", this.geometry, true); // Must be last
    +
    +        // Ambient light is global across everything in display, and
    +        // can never be disabled, so grab it now because we want to
    +        // feed it to gl.clearColor before each display list render
    +
    +        // Also grab the first spotlight we get, because we'll use that to cast shadows
    +
    +        this._setAmbientAndSpotLights(this.lights);
    +
    +        if (!this.objects[objectId]) {
    +            this.objects[objectId] = object;
    +            this.objectListDirty = true;
    +
    +        } else {
    +
    +            // At the very least, the object sort order will need be recomputed
    +            this.stateOrderDirty = true;
    +        }
    +
    +        object.compiled = true;
    +
    +        return object;
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._mapShadowLightObject = function (lights, object) {
    +        var shadow;
    +        var objects;
    +        for (var i = 0, len = lights.length; i < len; i++) {
    +            shadow = lights[i].shadow;
    +            if (shadow) {
    +                objects = (this._shadowLightObjects[shadow.id] || (this._shadowLightObjects[shadow.id] = {}));
    +                objects[object.id] = object;
    +            }
    +        }
    +    };
    +
    +    /** Adds a render state chunk to a render graph object.
    +     */
    +    xeogl.renderer.Renderer.prototype._setChunk = function (object, order, type, state, neg) {
    +
    +        var id;
    +
    +        var chunkType = this._chunkFactory.types[type];
    +
    +        if (type === "program") {
    +            id = (object.program.id + 1) * 100000000;
    +
    +        } else if (chunkType.constructor.prototype.programGlobal) {
    +            id = state.id;
    +
    +        } else {
    +            id = ((object.program.id + 1) * 100000000) + ((state.id + 1));
    +        }
    +
    +        if (neg) {
    +            id *= 100000;
    +        }
    +
    +        var oldChunk = object.chunks[order];
    +
    +        if (oldChunk) {
    +            this._chunkFactory.putChunk(oldChunk);
    +            object.chunks[order] = null;
    +        }
    +
    +        // Attach new chunk
    +
    +        object.chunks[order] = this._chunkFactory.getChunk(id, type, object.program.program, state);
    +    };
    +
    +    // Sets the singular ambient and spot lights
    +    xeogl.renderer.Renderer.prototype._setAmbientAndSpotLights = function (state) {
    +
    +        var lights = state.lights;
    +        var light;
    +
    +        for (var i = 0, len = lights.length; i < len; i++) {
    +
    +            light = lights[i];
    +
    +            if (light.type === "ambient") {
    +
    +                this._ambient = light;
    +            }
    +
    +            if (light.type === "spot") {
    +
    +                this._spotLight = light;
    +            }
    +        }
    +    };
    +
    +    /**
    +     * Removes an object from this Renderer
    +     *
    +     * @param {String} objectId ID of object to remove
    +     */
    +    xeogl.renderer.Renderer.prototype.removeObject = function (objectId) {
    +
    +        var object = this.objects[objectId];
    +
    +        if (!object) {
    +            console.error("xeogl.renderer.Chunkfactory.removeObject: object not found: " + objectId);
    +            return;
    +        }
    +
    +        // Release draw chunks
    +        var chunks = object.chunks;
    +        for (var i = 0, len = chunks.length; i < len; i++) {
    +            this._chunkFactory.putChunk(chunks[i]);
    +            chunks[i] = null;
    +        }
    +
    +        // Release object's shader
    +        this._programFactory.put(object.program);
    +
    +        object.program = null;
    +        object.hash = null;
    +
    +        // Release object
    +        this._objectFactory.put(object);
    +
    +        delete this.objects[objectId];
    +
    +        // Need to repack object map into fast iteration list
    +        this.objectListDirty = true;
    +    };
    +
    +    /**
    +     * Renders a new frame, if neccessary.
    +     */
    +    xeogl.renderer.Renderer.prototype.render = function (params) {
    +
    +        params = params || {};
    +
    +        this._prepareDisplay();
    +
    +        if (this.imageDirty || params.force) {
    +
    +            if (xeogl.WEBGL_INFO.SUPPORTED_EXTENSIONS["OES_element_index_uint"]) { // In case context lost/recovered
    +                this.gl.getExtension("OES_element_index_uint");
    +            }
    +
    +            this._renderShadowMaps();
    +
    +            this._renderObjectList({
    +                clear: (params.clear !== false),
    +                opaqueOnly: params.opaqueOnly,
    +                pass: params.pass
    +            });
    +
    +            this.stats.frame.frameCount++;
    +            this.imageDirty = false;
    +        }
    +    };
    +
    +
    +    xeogl.renderer.Renderer.prototype._prepareDisplay = function () {
    +
    +        if (this.objectListDirty) {
    +            this._buildObjectList(); // Build the scene object list
    +            this.objectListDirty = false;
    +            this.stateOrderDirty = true; // Now needs state ordering
    +        }
    +
    +        if (this.stateOrderDirty) {
    +            this._makeStateSortKeys(); // Determine the state sort order
    +            this.stateOrderDirty = false;
    +            this.stateSortDirty = true; // Now needs state sorting
    +        }
    +
    +        if (this.stateSortDirty) {
    +            this._stateSort(); // State sort the scene object list
    +            this._buildShadowObjectLists();
    +            this.stateSortDirty = false;
    +            this.imageDirty = true; // Now need to build object draw list
    +        }
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._buildObjectList = function () {
    +        this._objectListLen = 0;
    +        for (var objectId in this.objects) {
    +            if (this.objects.hasOwnProperty(objectId)) {
    +                this._objectList[this._objectListLen++] = this.objects[objectId];
    +            }
    +        }
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._makeStateSortKeys = function () {
    +        var object;
    +        for (var i = 0, len = this._objectListLen; i < len; i++) {
    +            object = this._objectList[i];
    +            if (!object.program) { // Non-visual object (eg. sound)
    +                object.sortKey = -1;
    +            } else {
    +                object.sortKey =
    +                    ((object.stage.priority + 1) * 100000000000000)
    +                 //   + ((object.modes.transparent ? 2 : 1) * 100000000000000)
    +                    + ((object.layer.priority + 1) * 10000000000000)
    +                    + ((object.program.id + 1) * 100000000)
    +                    + ((object.material.id + 1) * 10000)
    +                    + object.geometry.id;
    +            }
    +        }
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._stateSort = function () {
    +        this._objectList.length = this._objectListLen;
    +        this._objectList.sort(function (a, b) {
    +            return a.sortKey - b.sortKey;
    +        });
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._buildShadowObjectLists = function () {
    +
    +        var i;
    +        var len;
    +        var object;
    +        var j;
    +        var lenj;
    +        var lights;
    +        var light;
    +        var shadowObjectList;
    +
    +        this._shadowObjectLists = {}; // TODO: Optimize to avoid garbage collection?
    +
    +        for (i = 0, len = this._objectListLen; i < len; i++) {
    +            object = this._objectList[i];
    +            if (!object.compiled || object.cull.culled === true || object.visibility.visible === false || object.modes.castShadow === false) {
    +                continue;
    +            }
    +            lights = object.lights.lights;
    +            for (j = 0, lenj = lights.length; j < lenj; j++) {
    +                light = lights[j];
    +                if (!light.shadow) {
    +                    continue;
    +                }
    +                shadowObjectList = this._shadowObjectLists[light.id];
    +                if (!shadowObjectList) {
    +                    shadowObjectList = this._shadowObjectLists[light.id] = {
    +                        light: light,
    +                        objects: []
    +                    };
    +                }
    +                shadowObjectList.objects.push(object);
    +            }
    +        }
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._renderShadowMaps = function () {
    +
    +        var lightId;
    +        var shadowObjectLists = this._shadowObjectLists;
    +        var shadowObjectList;
    +        var light;
    +
    +        for (lightId in shadowObjectLists) {
    +            if (shadowObjectLists.hasOwnProperty(lightId)) {
    +                shadowObjectList = shadowObjectLists[lightId];
    +                light = shadowObjectList.light;
    +                //   if (light.shadowDirty) {
    +                this._renderShadowMap(light, shadowObjectList.objects);
    +                //   }
    +            }
    +        }
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._renderShadowMap = function (light, objects) {
    +
    +        var shadow = light.shadow;
    +
    +        if (!shadow) {
    +            return;
    +        }
    +
    +        var gl = this.gl;
    +
    +        var renderBuf = light.getShadowRenderBuf();
    +
    +        if (!renderBuf) {
    +            return;
    +        }
    +
    +        renderBuf.bind();
    +        renderBuf.clear();
    +
    +        var frameCtx = this._frameCtx;
    +
    +        frameCtx.depthbufEnabled = null;
    +        frameCtx.clearDepth = null;
    +        frameCtx.depthFunc = gl.LESS;
    +        frameCtx.blendEnabled = false;
    +        frameCtx.backfaces = true;
    +        frameCtx.frontface = true;
    +        frameCtx.drawElements = 0;
    +        frameCtx.useProgram = 0;
    +        frameCtx.shadowViewMatrix = light.getShadowViewMatrix();
    +        frameCtx.shadowProjMatrix = light.getShadowProjMatrix();
    +
    +        gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
    +        gl.enable(gl.DEPTH_TEST);
    +        gl.frontFace(gl.CCW);
    +        gl.disable(gl.CULL_FACE);
    +        gl.disable(gl.BLEND);
    +        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
    +
    +        var i;
    +        var len;
    +        var j;
    +        var lenj;
    +        var chunks;
    +        var chunk;
    +        var object;
    +
    +        var lastChunkId = this._lastChunkId = this._lastChunkId || new Int32Array(30);
    +        for (i = 0; i < 20; i++) {
    +            lastChunkId[i] = -9999999999999;
    +        }
    +
    +        for (i = 0, len = objects.length; i < len; i++) {
    +
    +            object = objects[i];
    +
    +            if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) {
    +                continue;
    +            }
    +
    +            chunks = object.chunks;
    +
    +            for (j = 0, lenj = chunks.length; j < lenj; j++) {
    +                chunk = chunks[j];
    +                if (chunk) {
    +                    if (chunk.shadow && (chunk.unique || lastChunkId[j] !== chunk.id)) {
    +                        chunk.shadow(frameCtx);
    +                        lastChunkId[j] = chunk.id;
    +                    }
    +                }
    +            }
    +        }
    +
    +        gl.finish();
    +
    +        renderBuf.unbind();
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._renderObjectList = (function () {
    +
    +        var outlinedObjects = [];
    +        var lastChunkId = new Int32Array(30);
    +
    +        var transparentObjects = [];
    +        var numTransparentObjects = 0;
    +
    +        function clearStateTracking() {
    +            for (var i = 0; i < 20; i++) {
    +                lastChunkId[i] = -9999999999;
    +            }
    +        }
    +
    +        function drawObject(frameCtx, object) {
    +            var chunks = object.chunks;
    +            var chunk;
    +            for (var j = 0, lenj = chunks.length; j < lenj; j++) {
    +                chunk = chunks[j];
    +                if (chunk) {
    +                    if (chunk.draw && (chunk.unique || lastChunkId[j] !== chunk.id)) {
    +                        chunk.draw(frameCtx);
    +                        lastChunkId[j] = chunk.id;
    +                    }
    +                }
    +            }
    +        }
    +
    +        function drawObjectOutline(frameCtx, object) {
    +            var chunks = object.chunks;
    +            var chunk;
    +            for (var j = 0, lenj = chunks.length; j < lenj; j++) {
    +                chunk = chunks[j];
    +                if (chunk) {
    +                    if (chunk.outline && (chunk.unique || lastChunkId[j] !== chunk.id)) {
    +                        chunk.outline(frameCtx);
    +                        lastChunkId[j] = chunk.id;
    +                    }
    +                }
    +            }
    +        }
    +
    +        return function (params) {
    +
    +            var gl = this.gl;
    +
    +            var ambient = this._ambient;
    +            if (ambient) {
    +                var color = ambient.color;
    +                var intensity = ambient.intensity;
    +                this.ambientColor[0] = color[0] * intensity;
    +                this.ambientColor[1] = color[1] * intensity;
    +                this.ambientColor[2] = color[2] * intensity;
    +            } else {
    +                this.ambientColor[0] = 0;
    +                this.ambientColor[1] = 0;
    +                this.ambientColor[2] = 0;
    +            }
    +
    +            var frameCtx = this._frameCtx;
    +
    +            frameCtx.renderTarget = null;
    +            frameCtx.renderBuf = null;
    +            frameCtx.depthbufEnabled = null;
    +            frameCtx.clearDepth = null;
    +            frameCtx.depthFunc = gl.LESS;
    +            frameCtx.blendEnabled = false;
    +            frameCtx.backfaces = true;
    +            frameCtx.frontface = true; // true == "ccw" else "cw"
    +            frameCtx.textureUnit = 0;
    +            frameCtx.transparent = false; // True while rendering transparency bin
    +            frameCtx.ambientColor = this.ambientColor;
    +            frameCtx.drawElements = 0;
    +            frameCtx.useProgram = 0;
    +            frameCtx.bindTexture = 0;
    +            frameCtx.bindArray = 0;
    +            frameCtx.pass = params.pass;
    +            frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer;
    +            frameCtx.pickViewMatrix = params.pickViewMatrix;
    +            frameCtx.pickProjMatrix = params.pickProjMatrix;
    +            frameCtx.pickIndex = 0;
    +
    +            gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
    +
    +            if (this.transparent) { // Canvas is transparent
    +                gl.clearColor(0, 0, 0, 0);
    +            } else {
    +                gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0);
    +            }
    +
    +            gl.enable(gl.DEPTH_TEST);
    +            gl.frontFace(gl.CCW);
    +            gl.disable(gl.CULL_FACE);
    +
    +            var i;
    +            var len;
    +            var object;
    +
    +            var startTime = (new Date()).getTime();
    +
    +            if (this.bindOutputFramebuffer) {
    +                this.bindOutputFramebuffer(params.pass);
    +            }
    +
    +            if (params.clear) {
    +                gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
    +            }
    +
    +            // Render opaque, non-outlined objects
    +
    +            var numOutlinedObjects = 0;
    +
    +            clearStateTracking();
    +
    +            for (i = 0, len = this._objectListLen; i < len; i++) {
    +                object = this._objectList[i];
    +                if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) {
    +                    continue;
    +                }
    +                if (object.modes.transparent) {
    +                    transparentObjects[numTransparentObjects++] = object;
    +                    continue;
    +                }
    +                if (object.modes.outline) {
    +                    outlinedObjects[numOutlinedObjects++] = object;
    +                    continue;
    +                }
    +                drawObject(frameCtx, object);
    +            }
    +
    +            // Render opaque outlined objects
    +
    +            if (false && numOutlinedObjects > 0) {
    +
    +                // Render objects
    +
    +                gl.enable(gl.STENCIL_TEST);
    +                gl.stencilFunc(gl.ALWAYS, 1, 1);
    +                gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
    +                gl.stencilMask(1);
    +                gl.clearStencil(0);
    +                gl.clear(gl.STENCIL_BUFFER_BIT);
    +                gl.enable(gl.DEPTH_TEST);
    +
    +                clearStateTracking();
    +
    +                for (i = 0; i < numOutlinedObjects; i++) {
    +                    drawObject(frameCtx, outlinedObjects[i]);
    +                }
    +
    +                // Render outlines
    +
    +                gl.stencilFunc(gl.EQUAL, 0, 1);
    +                gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
    +                gl.stencilMask(0x00);
    +                gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals
    +
    +                clearStateTracking();
    +
    +                for (i = 0; i < numOutlinedObjects; i++) {
    +                    drawObjectOutline(frameCtx, outlinedObjects[i]);
    +                }
    +
    +                gl.disable(gl.STENCIL_TEST);
    +            }
    +
    +            // Draw transparent objects
    +
    +            if (numTransparentObjects > 0) {
    +
    +              //  gl.enable(gl.BLEND);
    +               // gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +               // gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    +
    +                numOutlinedObjects = 0;
    +
    +                for (i = 0; i < numTransparentObjects; i++) {
    +                    object = transparentObjects[i];
    +                    if (object.modes.outline) {
    +                        outlinedObjects[numOutlinedObjects++] = object;
    +                    } else {
    +                        drawObject(frameCtx, object);
    +                    }
    +                }
    +
    +                // Render transparent outlined objects
    +
    +                if (numOutlinedObjects > 0) {
    +
    +                    gl.enable(gl.STENCIL_TEST);
    +                    gl.stencilFunc(gl.ALWAYS, 1, 1);
    +                    gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
    +                    gl.stencilMask(1);
    +                    gl.clearStencil(0);
    +                    gl.clear(gl.STENCIL_BUFFER_BIT);
    +                    gl.enable(gl.DEPTH_TEST);
    +
    +                    clearStateTracking();
    +
    +                    for (i = 0, len = numOutlinedObjects; i < len; i++) {
    +                        drawObject(frameCtx, outlinedObjects[i]);
    +                    }
    +
    +                    gl.stencilFunc(gl.EQUAL, 0, 1);
    +                    gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
    +                    gl.stencilMask(0x00);
    +                    gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals
    +
    +                    clearStateTracking();
    +
    +                    for (i = 0, len = numOutlinedObjects; i < len; i++) {
    +                        drawObjectOutline(frameCtx, outlinedObjects[i]);
    +                    }
    +
    +                    gl.disable(gl.STENCIL_TEST);
    +                }
    +
    +                gl.disable(gl.BLEND);
    +            }
    +
    +            var endTime = Date.now();
    +            var frameStats = this.stats.frame;
    +
    +            frameStats.renderTime = (endTime - startTime) / 1000.0;
    +            frameStats.drawElements = frameCtx.drawElements;
    +            frameStats.useProgram = frameCtx.useProgram;
    +            frameStats.bindTexture = frameCtx.bindTexture;
    +            frameStats.bindArray = frameCtx.bindArray;
    +
    +            if (frameCtx.renderBuf) {
    +                frameCtx.renderBuf.unbind();
    +            }
    +
    +            var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
    +
    +            for (var ii = 0; ii < numTextureUnits; ii++) {
    +                gl.activeTexture(gl.TEXTURE0 + ii);
    +                gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
    +                gl.bindTexture(gl.TEXTURE_2D, null);
    +            }
    +
    +            if (this.unbindOutputFramebuffer) {
    +                this.unbindOutputFramebuffer(params.pass);
    +            }
    +        };
    +    })();
    +
    +    /**
    +     * Attempts to pick an object.
    +     *
    +     * @param {*} params Picking params.
    +     * @returns {*} Hit result, if any.
    +     */
    +    xeogl.renderer.Renderer.prototype.pick = (function () {
    +
    +        var math = xeogl.math;
    +
    +        var tempVec3a = math.vec3();
    +        var tempMat4a = math.mat4();
    +        var up = math.vec3([0, 1, 0]);
    +        var pickFrustumMatrix = math.frustumMat4(-1, 1, -1, 1, 0.1, 10000);
    +
    +        return function (params) {
    +
    +            var hit = null;
    +            var pickBuf = this.pickBuf;
    +
    +            if (!pickBuf) {  // Lazy-create the pick buffer
    +                pickBuf = new xeogl.renderer.webgl.RenderBuffer(this.canvas, this.gl);
    +                this.pickBuf = pickBuf;
    +            }
    +
    +            this._prepareDisplay();
    +
    +            if (xeogl.WEBGL_INFO.SUPPORTED_EXTENSIONS["OES_element_index_uint"]) { // In case context lost/recovered
    +                this.gl.getExtension("OES_element_index_uint");
    +            }
    +
    +            pickBuf.bind();
    +            pickBuf.clear();
    +
    +            var pickBufX;
    +            var pickBufY;
    +            var origin;
    +            var direction;
    +            var look;
    +            var pickViewMatrix = null;
    +            var pickProjMatrix = null;
    +
    +            if (!params.canvasPos) { // Ray-picking with arbitrarily World-space ray
    +
    +                origin = params.origin || math.vec3([0, 0, 0]);
    +                direction = params.direction || math.vec3([0, 0, 1]);
    +                look = math.addVec3(origin, direction, tempVec3a);
    +
    +                pickViewMatrix = math.lookAtMat4v(origin, look, up, tempMat4a);
    +                pickProjMatrix = pickFrustumMatrix;
    +
    +                pickBufX = this.canvas.clientWidth * 0.5;
    +                pickBufY = this.canvas.clientHeight * 0.5;
    +
    +            } else {
    +
    +                if (params.canvasPos) {
    +                    pickBufX = params.canvasPos[0];
    +                    pickBufY = params.canvasPos[1];
    +
    +                } else {
    +                    pickBufX = this.canvas.clientWidth * 0.5;
    +                    pickBufY = this.canvas.clientHeight * 0.5;
    +                }
    +            }
    +
    +            this._pickObject(pickViewMatrix, pickProjMatrix);
    +
    +            // Convert picked pixel color to object index
    +            var pix = pickBuf.read(pickBufX, pickBufY);
    +            var pickedObjectIndex = pix[0] + pix[1] * 256 + pix[2] * 65536;
    +            pickedObjectIndex = (pickedObjectIndex >= 1) ? pickedObjectIndex - 1 : -1;
    +
    +            var object = this._objectPickList[pickedObjectIndex];
    +
    +            if (object) { // Object was picked
    +
    +                hit = {
    +                    entity: object.id
    +                };
    +
    +                if (params.pickSurface) { // Now do a primitive-pick if requested
    +
    +                    pickBuf.clear();
    +
    +                    this._pickPrimitive(object, pickViewMatrix, pickProjMatrix);
    +
    +                    this.gl.finish();
    +
    +                    // Convert picked pixel color to primitive index
    +                    pix = pickBuf.read(pickBufX, pickBufY);
    +                    var primIndex = pix[0] + (pix[1] * 256) + (pix[2] * 256 * 256) + (pix[3] * 256 * 256 * 256);
    +                    primIndex *= 3; // Convert from triangle number to first vertex in indices
    +
    +                    hit.primIndex = primIndex;
    +
    +                    if (pickViewMatrix) {
    +                        hit.origin = origin;
    +                        hit.direction = direction;
    +                    }
    +                }
    +            }
    +
    +            pickBuf.unbind();
    +
    +            return hit;
    +        };
    +    })();
    +
    +
    +    xeogl.renderer.Renderer.prototype._pickObject = function (pickViewMatrix, pickProjMatrix) {
    +
    +        var gl = this.gl;
    +
    +        var frameCtx = this._frameCtx;
    +
    +        frameCtx.depthbufEnabled = null;
    +        frameCtx.clearDepth = null;
    +        frameCtx.depthFunc = gl.LESS;
    +        frameCtx.blendEnabled = false;
    +        frameCtx.backfaces = true;
    +        frameCtx.frontface = true; // true == "ccw" else "cw"
    +        frameCtx.textureUnit = 0;
    +        frameCtx.drawElements = 0;
    +        frameCtx.useProgram = 0;
    +        frameCtx.bindTexture = 0;
    +        frameCtx.bindArray = 0;
    +        frameCtx.pickViewMatrix = pickViewMatrix;
    +        frameCtx.pickProjMatrix = pickProjMatrix;
    +        frameCtx.pickIndex = 0;
    +
    +        gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
    +        gl.clearColor(0, 0, 0, 0);
    +        gl.enable(gl.DEPTH_TEST);
    +        gl.frontFace(gl.CCW);
    +        gl.disable(gl.CULL_FACE);
    +        gl.disable(gl.BLEND);
    +        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
    +
    +        var i;
    +        var len;
    +        var j;
    +        var lenj;
    +        var chunks;
    +        var chunk;
    +
    +        var lastChunkId = this._lastChunkId = this._lastChunkId || new Int32Array(30);
    +        for (i = 0; i < 20; i++) {
    +            lastChunkId[i] = -9999999999999;
    +        }
    +
    +        this._objectPickListLen = 0;
    +        var object;
    +        for (i = 0, len = this._objectListLen; i < len; i++) {
    +            object = this._objectList[i];
    +            if (!object.compiled || object.cull.culled === true || object.visibility.visible === false || object.modes.pickable === false) {
    +                continue;
    +            }
    +            this._objectPickList[this._objectPickListLen++] = object;
    +            chunks = object.chunks;
    +            for (j = 0, lenj = chunks.length; j < lenj; j++) {
    +                chunk = chunks[j];
    +                if (chunk) {
    +                    if (chunk.pickObject && (chunk.unique || lastChunkId[j] !== chunk.id)) {
    +                        chunk.pickObject(frameCtx);
    +                        lastChunkId[j] = chunk.id;
    +                    }
    +                }
    +            }
    +        }
    +    };
    +
    +    xeogl.renderer.Renderer.prototype._pickPrimitive = function (object, pickViewMatrix, pickProjMatrix) {
    +
    +        var gl = this.gl;
    +
    +        var frameCtx = this._frameCtx;
    +        frameCtx.renderBuf = null;
    +        frameCtx.depthbufEnabled = null;
    +        frameCtx.clearDepth = null;
    +        frameCtx.depthFunc = gl.LESS;
    +        frameCtx.blendEnabled = false;
    +        frameCtx.backfaces = true;
    +        frameCtx.frontface = true; // true == "ccw" else "cw"
    +        frameCtx.drawElements = 0;
    +        frameCtx.useProgram = 0;
    +        frameCtx.bindTexture = 0;
    +        frameCtx.bindArray = 0;
    +        frameCtx.pickViewMatrix = pickViewMatrix;
    +        frameCtx.pickProjMatrix = pickProjMatrix;
    +        frameCtx.pickIndex = 0;
    +
    +        gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
    +        gl.clearColor(0, 0, 0, 0);
    +        gl.enable(gl.DEPTH_TEST);
    +        gl.frontFace(gl.CCW);
    +        gl.disable(gl.CULL_FACE);
    +        gl.disable(gl.BLEND);
    +        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
    +
    +        var i;
    +        var len;
    +        var chunks;
    +        var chunk;
    +
    +        var lastChunkId = this._lastChunkId = this._lastChunkId || new Int32Array(30);
    +        for (i = 0; i < 20; i++) {
    +            lastChunkId[i] = -9999999999999;
    +        }
    +
    +        chunks = object.chunks;
    +        for (i = 0, len = chunks.length; i < len; i++) {
    +            chunk = chunks[i];
    +            if (chunk.pickPrimitive) {
    +                chunk.pickPrimitive(frameCtx);
    +            }
    +        }
    +    };
    +
    +    /**
    +     * Reads the colors of some pixels in the last rendered frame.
    +     *
    +     * @param {Float32Array} pixels
    +     * @param {Float32Array} colors
    +     * @param {Number} len
    +     * @param {Boolean} opaqueOnly
    +     */
    +    xeogl.renderer.Renderer.prototype.readPixels = function (pixels, colors, len, opaqueOnly) {
    +
    +        if (!this._readPixelBuf) {
    +            this._readPixelBuf = new xeogl.renderer.webgl.RenderBuffer(this.canvas, this.gl);
    +        }
    +
    +        this._readPixelBuf.bind();
    +
    +        this._readPixelBuf.clear();
    +
    +        this.render({
    +            force: true,
    +            opaqueOnly: opaqueOnly
    +        });
    +
    +        var color;
    +        var i;
    +        var j;
    +        var k;
    +
    +        for (i = 0; i < len; i++) {
    +
    +            j = i * 2;
    +            k = i * 4;
    +
    +            color = this._readPixelBuf.read(pixels[j], pixels[j + 1]);
    +
    +            colors[k] = color[0];
    +            colors[k + 1] = color[1];
    +            colors[k + 2] = color[2];
    +            colors[k + 3] = color[3];
    +        }
    +
    +        this._readPixelBuf.unbind();
    +
    +        this.imageDirty = true;
    +    };
    +
    +    /**
    +     * Destroys this Renderer.
    +     */
    +    xeogl.renderer.Renderer.prototype.destroy = function () {
    +        this._programFactory.destroy();
    +    };
    +})();
    +
    +    
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src__renderer_renderer.old.js.html b/docs/files/src__renderer_renderer.old.js.html index dabaa44e5..b0fce5597 100644 --- a/docs/files/src__renderer_renderer.old.js.html +++ b/docs/files/src__renderer_renderer.old.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_renderer.opt.js.html b/docs/files/src__renderer_renderer.opt.js.html index 65546d3c9..f53bfd4ec 100644 --- a/docs/files/src__renderer_renderer.opt.js.html +++ b/docs/files/src__renderer_renderer.opt.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_states.js.html b/docs/files/src__renderer_states.js.html index b1d8715dd..9e6242791 100644 --- a/docs/files/src__renderer_states.js.html +++ b/docs/files/src__renderer_states.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -642,6 +644,23 @@

    File: src/_renderer/states.js

    xeogl.renderer.Viewport = xeogl.renderer.State.extend({ _ids: new xeogl.utils.Map({}) }); + + /** + + Outline state. + + renderer.Outline + @module xeogl + + @constructor + @param cfg {*} Configs + @param [cfg.thickness=15] {Number} Thickness of the outline in pixels. + @param [cfg.color=[1,0,0]] {Array of Number} The outline color, + @extends renderer.State + */ + xeogl.renderer.Outline = xeogl.renderer.State.extend({ + _ids: new xeogl.utils.Map({}) + }); })(); diff --git a/docs/files/src__renderer_webgl_arrayBuffer.js.html b/docs/files/src__renderer_webgl_arrayBuffer.js.html index 1cda1eb03..74a58d613 100644 --- a/docs/files/src__renderer_webgl_arrayBuffer.js.html +++ b/docs/files/src__renderer_webgl_arrayBuffer.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_webgl_attribute.js.html b/docs/files/src__renderer_webgl_attribute.js.html index c468d2ee0..69ab63aad 100644 --- a/docs/files/src__renderer_webgl_attribute.js.html +++ b/docs/files/src__renderer_webgl_attribute.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_webgl_program.js.html b/docs/files/src__renderer_webgl_program.js.html index cc9f12cd9..4bd64a9ff 100644 --- a/docs/files/src__renderer_webgl_program.js.html +++ b/docs/files/src__renderer_webgl_program.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_webgl_renderBuffer.js.html b/docs/files/src__renderer_webgl_renderBuffer.js.html index 317dc62b3..48b6702ec 100644 --- a/docs/files/src__renderer_webgl_renderBuffer.js.html +++ b/docs/files/src__renderer_webgl_renderBuffer.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_webgl_shader.js.html b/docs/files/src__renderer_webgl_shader.js.html index 4562e519a..9d22eae6f 100644 --- a/docs/files/src__renderer_webgl_shader.js.html +++ b/docs/files/src__renderer_webgl_shader.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__renderer_webgl_webgl.js.html b/docs/files/src__renderer_webgl_webgl.js.html index 9bc8193ce..40eb30190 100644 --- a/docs/files/src__renderer_webgl_webgl.js.html +++ b/docs/files/src__renderer_webgl_webgl.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__utils_inheritance.js.html b/docs/files/src__utils_inheritance.js.html index 2559ff7e6..d92e60b1a 100644 --- a/docs/files/src__utils_inheritance.js.html +++ b/docs/files/src__utils_inheritance.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src__utils_map.js.html b/docs/files/src__utils_map.js.html index a0ad211e2..1bb43f7b9 100644 --- a/docs/files/src__utils_map.js.html +++ b/docs/files/src__utils_map.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_animation__module.js.html b/docs/files/src_animation__module.js.html index b06153282..3e72199ba 100644 --- a/docs/files/src_animation__module.js.html +++ b/docs/files/src_animation__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_animation_cameraFlightAnimation.js.html b/docs/files/src_animation_cameraFlightAnimation.js.html index c1c09980d..cc7dc12ec 100644 --- a/docs/files/src_animation_cameraFlightAnimation.js.html +++ b/docs/files/src_animation_cameraFlightAnimation.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_animation_morphTargets.js.html b/docs/files/src_animation_morphTargets.js.html index 8b80a3066..305fd2649 100644 --- a/docs/files/src_animation_morphTargets.js.html +++ b/docs/files/src_animation_morphTargets.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_boundaries__module.js.html b/docs/files/src_boundaries__module.js.html index 24d346dd3..e1f7d4a34 100644 --- a/docs/files/src_boundaries__module.js.html +++ b/docs/files/src_boundaries__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_boundaries_boundary2d.js.html b/docs/files/src_boundaries_boundary2d.js.html index ad5c25f6e..90fd5051c 100644 --- a/docs/files/src_boundaries_boundary2d.js.html +++ b/docs/files/src_boundaries_boundary2d.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_boundaries_boundary3d.js.html b/docs/files/src_boundaries_boundary3d.js.html index 822643afc..af80f1252 100644 --- a/docs/files/src_boundaries_boundary3d.js.html +++ b/docs/files/src_boundaries_boundary3d.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_camera__module.js.html b/docs/files/src_camera__module.js.html index 3f9276362..0cd1b6b2e 100644 --- a/docs/files/src_camera__module.js.html +++ b/docs/files/src_camera__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_camera_camera.js.html b/docs/files/src_camera_camera.js.html index 0e51ff52b..0ae512100 100644 --- a/docs/files/src_camera_camera.js.html +++ b/docs/files/src_camera_camera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_canvas__module.js.html b/docs/files/src_canvas__module.js.html index ac4d0fb8b..21449ecf0 100644 --- a/docs/files/src_canvas__module.js.html +++ b/docs/files/src_canvas__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_canvas_canvas-v2.js.html b/docs/files/src_canvas_canvas-v2.js.html index e51973998..a379d9d49 100644 --- a/docs/files/src_canvas_canvas-v2.js.html +++ b/docs/files/src_canvas_canvas-v2.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_canvas_canvas.js.html b/docs/files/src_canvas_canvas.js.html index 3af72762b..61b9e0fb2 100644 --- a/docs/files/src_canvas_canvas.js.html +++ b/docs/files/src_canvas_canvas.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -396,13 +398,15 @@

    File: src/canvas/canvas.js

    this.contextAttr.alpha = this.transparent; if (this.contextAttr.alpha === undefined || this.contextAttr.alpha === null) { - this.contextAttr.alphs = this.transparent; + this.contextAttr.alpha = this.transparent; } if (this.contextAttr.preserveDrawingBuffer === undefined || this.contextAttr.preserveDrawingBuffer === null) { this.contextAttr.preserveDrawingBuffer = false; } + this.contextAttr.stencil = true; + if (!cfg.canvas) { // Canvas not supplied, create one automatically diff --git a/docs/files/src_canvas_spinner.js.html b/docs/files/src_canvas_spinner.js.html index 60739433a..971025c5e 100644 --- a/docs/files/src_canvas_spinner.js.html +++ b/docs/files/src_canvas_spinner.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_clipping__module.js.html b/docs/files/src_clipping__module.js.html index 44ddcab70..2a3a36aa5 100644 --- a/docs/files/src_clipping__module.js.html +++ b/docs/files/src_clipping__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_clipping_clip.js.html b/docs/files/src_clipping_clip.js.html index 9d1a03a99..8aa473ba8 100644 --- a/docs/files/src_clipping_clip.js.html +++ b/docs/files/src_clipping_clip.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_clipping_clips.js.html b/docs/files/src_clipping_clips.js.html index 56c8b634e..e6dd1e871 100644 --- a/docs/files/src_clipping_clips.js.html +++ b/docs/files/src_clipping_clips.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_component.js.html b/docs/files/src_component.js.html index a602deb0f..e5ff096b7 100644 --- a/docs/files/src_component.js.html +++ b/docs/files/src_component.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_configs__module.js.html b/docs/files/src_configs__module.js.html index 65905faf1..e5b3ab909 100644 --- a/docs/files/src_configs__module.js.html +++ b/docs/files/src_configs__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_configs_configs.js.html b/docs/files/src_configs_configs.js.html index 601e3d3fc..a2853e7eb 100644 --- a/docs/files/src_configs_configs.js.html +++ b/docs/files/src_configs_configs.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls__module.js.html b/docs/files/src_controls__module.js.html index 93d5db456..ce8c39759 100644 --- a/docs/files/src_controls__module.js.html +++ b/docs/files/src_controls__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_cameraControl.js.html b/docs/files/src_controls_cameraControl.js.html index ebcd5cde4..09033668f 100644 --- a/docs/files/src_controls_cameraControl.js.html +++ b/docs/files/src_controls_cameraControl.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -417,6 +419,8 @@

    File: src/controls/cameraControl.js

    var aabb = worldBoundary.aabb; var sphere = worldBoundary.sphere; + e.entity.modes.outline = true; + this._boundaryHelper.geometry.aabb = aabb; // this._boundaryHelper.visibility.visible = true; diff --git a/docs/files/src_controls_cameraController.js.html b/docs/files/src_controls_cameraController.js.html index f9407f204..c1dd9f6cf 100644 --- a/docs/files/src_controls_cameraController.js.html +++ b/docs/files/src_controls_cameraController.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_keyboardAxisCamera.js.html b/docs/files/src_controls_keyboardAxisCamera.js.html index f7c5ca46d..b4d1fea2f 100644 --- a/docs/files/src_controls_keyboardAxisCamera.js.html +++ b/docs/files/src_controls_keyboardAxisCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_keyboardPanCamera.js.html b/docs/files/src_controls_keyboardPanCamera.js.html index 8ab7196db..1e24b13fe 100644 --- a/docs/files/src_controls_keyboardPanCamera.js.html +++ b/docs/files/src_controls_keyboardPanCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_keyboardRotateCamera.js.html b/docs/files/src_controls_keyboardRotateCamera.js.html index 6bad5d394..a241fb992 100644 --- a/docs/files/src_controls_keyboardRotateCamera.js.html +++ b/docs/files/src_controls_keyboardRotateCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_keyboardZoomCamera.js.html b/docs/files/src_controls_keyboardZoomCamera.js.html index 3c175bb2b..0657ae64d 100644 --- a/docs/files/src_controls_keyboardZoomCamera.js.html +++ b/docs/files/src_controls_keyboardZoomCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_mousePanCamera.js.html b/docs/files/src_controls_mousePanCamera.js.html index 3eca26c39..32bc2a068 100644 --- a/docs/files/src_controls_mousePanCamera.js.html +++ b/docs/files/src_controls_mousePanCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_mousePickEntity.js.html b/docs/files/src_controls_mousePickEntity.js.html index abf89bccc..90cdf3423 100644 --- a/docs/files/src_controls_mousePickEntity.js.html +++ b/docs/files/src_controls_mousePickEntity.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_mouseRotateCamera.js.html b/docs/files/src_controls_mouseRotateCamera.js.html index f0c3416ee..3682df496 100644 --- a/docs/files/src_controls_mouseRotateCamera.js.html +++ b/docs/files/src_controls_mouseRotateCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_controls_mouseZoomCamera.js.html b/docs/files/src_controls_mouseZoomCamera.js.html index 8b239a905..9923154cd 100644 --- a/docs/files/src_controls_mouseZoomCamera.js.html +++ b/docs/files/src_controls_mouseZoomCamera.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_culling__module.js.html b/docs/files/src_culling__module.js.html index de0608bbc..fab4b7969 100644 --- a/docs/files/src_culling__module.js.html +++ b/docs/files/src_culling__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_culling_cull.js.html b/docs/files/src_culling_cull.js.html index b12a96e8b..9f0dcab2f 100644 --- a/docs/files/src_culling_cull.js.html +++ b/docs/files/src_culling_cull.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_culling_visibility.js.html b/docs/files/src_culling_visibility.js.html index d9f12d133..77caf43d5 100644 --- a/docs/files/src_culling_visibility.js.html +++ b/docs/files/src_culling_visibility.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_entities__module.js.html b/docs/files/src_entities__module.js.html index 846ea13be..cfaa3f031 100644 --- a/docs/files/src_entities__module.js.html +++ b/docs/files/src_entities__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_entities_entity.js.html b/docs/files/src_entities_entity.js.html index 4d048925a..142d66db8 100644 --- a/docs/files/src_entities_entity.js.html +++ b/docs/files/src_entities_entity.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -361,6 +363,8 @@

    File: src/entities/entity.js

    {{#crossLink "Scene/transform:property"}}transform{{/crossLink}} (which is an identity matrix which performs no transformation). @param [cfg.viewport] {String|Viewport} ID or instance of a {{#crossLink "Viewport"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink "Scene"}}Scene{{/crossLink}}'s default instance, {{#crossLink "Scene/viewport:property"}}{{/crossLink}}, which is automatically resizes to the canvas. + @param [cfg.outline] {String|Outline} ID or instance of a {{#crossLink "Outline"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink "Scene"}}Scene{{/crossLink}}'s default instance, + {{#crossLink "Scene/outline:property"}}{{/crossLink}}. @param [cfg.loading] {Boolean} Flag which indicates that this Entity is freshly loaded. This will increment the {{#crossLink "Spinner/processes:property"}}Spinner processes{{/crossLink}} count, and then when this Entity is first rendered, will decrement the count again. @@ -412,6 +416,7 @@

    File: src/entities/entity.js

    this.billboard = cfg.billboard; this.stationary = cfg.stationary; this.viewport = cfg.viewport; + this.outline = cfg.outline; // Cached boundary for each coordinate space // The Entity's Geometry component caches the Local-space boundary @@ -1236,6 +1241,41 @@

    File: src/entities/entity.js

    } }, + /** + * The {{#crossLink "Outline"}}Outline{{/crossLink}} attached to this Entity. + * + * Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent + * {{#crossLink "Scene"}}Scene{{/crossLink}}'s default {{#crossLink "Scene/outline:property"}}Outline{{/crossLink}} when set to + * a null or undefined value. + * + * Fires an {{#crossLink "Entity/outline:event"}}{{/crossLink}} event on change. + * + * @property outline + * @type Outline + */ + outline: { + + set: function (value) { + + /** + * Fired whenever this Entity's {{#crossLink "Entity/Outline:property"}}{{/crossLink}} property changes. + * + * @event Outline + * @param value The property's new value + */ + this._attach({ + name: "outline", + type: "xeogl.Outline", + component: value, + sceneDefault: true + }); + }, + + get: function () { + return this._attached.outline; + } + }, + /** * Local-space 3D boundary of this Entity. * @@ -1649,6 +1689,7 @@

    File: src/entities/entity.js

    attached.billboard._compile(); attached.stationary._compile(); attached.viewport._compile(); + attached.outline._compile(); // (Re)build this Entity in the renderer; for each Entity in teh scene graph, // there is an "object" in the renderer, that has the same ID as the entity @@ -1701,7 +1742,8 @@

    File: src/entities/entity.js

    transform: attached.transform.id, billboard: attached.billboard.id, stationary: attached.stationary.id, - viewport: attached.viewport.id + viewport: attached.viewport.id, + outline: attached.outline.id }; }, diff --git a/docs/files/src_geometry__module.js.html b/docs/files/src_geometry__module.js.html index 7755f8476..11253e003 100644 --- a/docs/files/src_geometry__module.js.html +++ b/docs/files/src_geometry__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_aabbGeometry.js.html b/docs/files/src_geometry_aabbGeometry.js.html index acf5da11e..764d0d495 100644 --- a/docs/files/src_geometry_aabbGeometry.js.html +++ b/docs/files/src_geometry_aabbGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_boundingSphereGeometry.js.html b/docs/files/src_geometry_boundingSphereGeometry.js.html index 67a356cf7..e9e14ce89 100644 --- a/docs/files/src_geometry_boundingSphereGeometry.js.html +++ b/docs/files/src_geometry_boundingSphereGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_boxGeometry.js.html b/docs/files/src_geometry_boxGeometry.js.html index 96c95669a..908c7839e 100644 --- a/docs/files/src_geometry_boxGeometry.js.html +++ b/docs/files/src_geometry_boxGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_cylinderGeometry.js.html b/docs/files/src_geometry_cylinderGeometry.js.html index 44de8950b..ac03cc7c7 100644 --- a/docs/files/src_geometry_cylinderGeometry.js.html +++ b/docs/files/src_geometry_cylinderGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_geometry.js.html b/docs/files/src_geometry_geometry.js.html index e31dca843..d6028b884 100644 --- a/docs/files/src_geometry_geometry.js.html +++ b/docs/files/src_geometry_geometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_latheGeometry.js.html b/docs/files/src_geometry_latheGeometry.js.html index 609f41aee..69cd8f15d 100644 --- a/docs/files/src_geometry_latheGeometry.js.html +++ b/docs/files/src_geometry_latheGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_obbGeometry.js.html b/docs/files/src_geometry_obbGeometry.js.html index 97e94892b..6ca72de2f 100644 --- a/docs/files/src_geometry_obbGeometry.js.html +++ b/docs/files/src_geometry_obbGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_pathGeometry.js.html b/docs/files/src_geometry_pathGeometry.js.html index 5805d0c42..8d74982ba 100644 --- a/docs/files/src_geometry_pathGeometry.js.html +++ b/docs/files/src_geometry_pathGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_planeGeometry.js.html b/docs/files/src_geometry_planeGeometry.js.html index 0f6ee6394..b8953e306 100644 --- a/docs/files/src_geometry_planeGeometry.js.html +++ b/docs/files/src_geometry_planeGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_sphereGeometry.js.html b/docs/files/src_geometry_sphereGeometry.js.html index ee9c52168..792fefc67 100644 --- a/docs/files/src_geometry_sphereGeometry.js.html +++ b/docs/files/src_geometry_sphereGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_geometry_torusGeometry.js.html b/docs/files/src_geometry_torusGeometry.js.html index c31a14186..86753fc04 100644 --- a/docs/files/src_geometry_torusGeometry.js.html +++ b/docs/files/src_geometry_torusGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_input__module.js.html b/docs/files/src_input__module.js.html index 14a640679..8f179adc1 100644 --- a/docs/files/src_input__module.js.html +++ b/docs/files/src_input__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_input_input.js.html b/docs/files/src_input_input.js.html index 71ae7e2b0..6ac263e88 100644 --- a/docs/files/src_input_input.js.html +++ b/docs/files/src_input_input.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting__module.js.html b/docs/files/src_lighting__module.js.html index 4ee32396a..66a7dfafe 100644 --- a/docs/files/src_lighting__module.js.html +++ b/docs/files/src_lighting__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_ambientLight.js.html b/docs/files/src_lighting_ambientLight.js.html index 14f943379..b015b17d9 100644 --- a/docs/files/src_lighting_ambientLight.js.html +++ b/docs/files/src_lighting_ambientLight.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_cubeTexture.js.html b/docs/files/src_lighting_cubeTexture.js.html index 3bc180c7c..db9c91442 100644 --- a/docs/files/src_lighting_cubeTexture.js.html +++ b/docs/files/src_lighting_cubeTexture.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_dirLight.js.html b/docs/files/src_lighting_dirLight.js.html index 6d86471d7..32b905962 100644 --- a/docs/files/src_lighting_dirLight.js.html +++ b/docs/files/src_lighting_dirLight.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_fog.js.html b/docs/files/src_lighting_fog.js.html index 8b7d156d9..a13e09e05 100644 --- a/docs/files/src_lighting_fog.js.html +++ b/docs/files/src_lighting_fog.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_lights.js.html b/docs/files/src_lighting_lights.js.html index c60ec882b..267d0aedb 100644 --- a/docs/files/src_lighting_lights.js.html +++ b/docs/files/src_lighting_lights.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_pointLight.js.html b/docs/files/src_lighting_pointLight.js.html index 12af54061..f30981218 100644 --- a/docs/files/src_lighting_pointLight.js.html +++ b/docs/files/src_lighting_pointLight.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_shadow.js.html b/docs/files/src_lighting_shadow.js.html index dd3a39bd3..6e2315587 100644 --- a/docs/files/src_lighting_shadow.js.html +++ b/docs/files/src_lighting_shadow.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_lighting_spotLight.js.html b/docs/files/src_lighting_spotLight.js.html index abd21e031..a2820a828 100644 --- a/docs/files/src_lighting_spotLight.js.html +++ b/docs/files/src_lighting_spotLight.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials__module.js.html b/docs/files/src_materials__module.js.html index 70d72409e..cae32d2d8 100644 --- a/docs/files/src_materials__module.js.html +++ b/docs/files/src_materials__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials_fresnel.js.html b/docs/files/src_materials_fresnel.js.html index b03e8e79b..16538939f 100644 --- a/docs/files/src_materials_fresnel.js.html +++ b/docs/files/src_materials_fresnel.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials_material.js.html b/docs/files/src_materials_material.js.html index b4816a6b2..d814c59dd 100644 --- a/docs/files/src_materials_material.js.html +++ b/docs/files/src_materials_material.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials_metallicMaterial.js.html b/docs/files/src_materials_metallicMaterial.js.html index 05f9392c5..c3d4efec1 100644 --- a/docs/files/src_materials_metallicMaterial.js.html +++ b/docs/files/src_materials_metallicMaterial.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials_phongMaterial.js.html b/docs/files/src_materials_phongMaterial.js.html index b1d617793..10024f840 100644 --- a/docs/files/src_materials_phongMaterial.js.html +++ b/docs/files/src_materials_phongMaterial.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials_specularMaterial.js.html b/docs/files/src_materials_specularMaterial.js.html index 00eca4cc3..8e7dbdcb7 100644 --- a/docs/files/src_materials_specularMaterial.js.html +++ b/docs/files/src_materials_specularMaterial.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_materials_texture.js.html b/docs/files/src_materials_texture.js.html index ccad2128b..81b3b8a27 100644 --- a/docs/files/src_materials_texture.js.html +++ b/docs/files/src_materials_texture.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math__module.js.html b/docs/files/src_math__module.js.html index c0dba31b6..26da8440e 100644 --- a/docs/files/src_math__module.js.html +++ b/docs/files/src_math__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math_math.js.html b/docs/files/src_math_math.js.html index 27c6e9385..55267e100 100644 --- a/docs/files/src_math_math.js.html +++ b/docs/files/src_math_math.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math_mathBoundaries.js.html b/docs/files/src_math_mathBoundaries.js.html index a06736e53..188686f6b 100644 --- a/docs/files/src_math_mathBoundaries.js.html +++ b/docs/files/src_math_mathBoundaries.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math_mathCurves.js.html b/docs/files/src_math_mathCurves.js.html index dc671124b..e2504b112 100644 --- a/docs/files/src_math_mathCurves.js.html +++ b/docs/files/src_math_mathCurves.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math_mathGeometry.js.html b/docs/files/src_math_mathGeometry.js.html index ab9fd1b3d..cbcb036bf 100644 --- a/docs/files/src_math_mathGeometry.js.html +++ b/docs/files/src_math_mathGeometry.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math_mathGeometryBuild.js.html b/docs/files/src_math_mathGeometryBuild.js.html index 9dcd68750..b211e1692 100644 --- a/docs/files/src_math_mathGeometryBuild.js.html +++ b/docs/files/src_math_mathGeometryBuild.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_math_mathRays.js.html b/docs/files/src_math_mathRays.js.html index 686fd7ce2..c29619e5c 100644 --- a/docs/files/src_math_mathRays.js.html +++ b/docs/files/src_math_mathRays.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_models__module.js.html b/docs/files/src_models__module.js.html index da53fdfc8..72674c0aa 100644 --- a/docs/files/src_models__module.js.html +++ b/docs/files/src_models__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_models_gltfModel.js.html b/docs/files/src_models_gltfModel.js.html index a3d667055..111cd217e 100644 --- a/docs/files/src_models_gltfModel.js.html +++ b/docs/files/src_models_gltfModel.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_models_gltf_glTFLoader.js.html b/docs/files/src_models_gltf_glTFLoader.js.html index aaa91bff3..9521d6071 100644 --- a/docs/files/src_models_gltf_glTFLoader.js.html +++ b/docs/files/src_models_gltf_glTFLoader.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_models_gltf_glTFLoaderUtils.js.html b/docs/files/src_models_gltf_glTFLoaderUtils.js.html index 9fa587f2c..3fbe42d56 100644 --- a/docs/files/src_models_gltf_glTFLoaderUtils.js.html +++ b/docs/files/src_models_gltf_glTFLoaderUtils.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_models_model.js.html b/docs/files/src_models_model.js.html index 16e9b8903..fb3715b21 100644 --- a/docs/files/src_models_model.js.html +++ b/docs/files/src_models_model.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_outline__module.js.html b/docs/files/src_outline__module.js.html new file mode 100644 index 000000000..45db31a09 --- /dev/null +++ b/docs/files/src_outline__module.js.html @@ -0,0 +1,233 @@ + + + + + src/outline/_module.js - xeogl + + + + + + + + + +
    +
    +
    + +

    xeogl / API Docs

    + +
    +
    + API Docs for: 1.0.0 +
    +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    File: src/outline/_module.js

    + +
    +
    +/**
    + * An outline rendering effect for emphasis.
    + *
    + * @module xeogl
    + * @submodule outline
    + */
    +    
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src_outline_outline.js.html b/docs/files/src_outline_outline.js.html new file mode 100644 index 000000000..7e1e22467 --- /dev/null +++ b/docs/files/src_outline_outline.js.html @@ -0,0 +1,404 @@ + + + + + src/outline/outline.js - xeogl + + + + + + + + + +
    +
    +
    + +

    xeogl / API Docs

    + +
    +
    + API Docs for: 1.0.0 +
    +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    File: src/outline/outline.js

    + +
    +
    +/**
    + A **Outline** renders an outline around attached {{#crossLink "Entity"}}Entities{{/crossLink}}.
    +
    + ## Overview
    +
    + TODO
    +
    + ## Usage
    +
    + ````javascript
    +
    + var outline = new xeogl.Outline({
    +    thickness: 15,      // Default
    +    color: [1,0,0]      // Default
    + });
    +
    + new xeogl.Entity({
    +     geometry: new xeogl.TorusGeometry(),
    +     outline: outline,
    +     modes: new xeogl.Modes({
    +        outline: false  // Hide the outline (default)
    +     });
    + });
    +
    + new xeogl.Entity({
    +     geometry: new xeogl.BoxGeometry(),
    +     outline: outline,
    +     modes: new xeogl.Modes({
    +        outline: true  // Show the outline
    +     });
    + });
    + ````
    +
    + @class Outline
    + @module xeogl
    + @submodule outline
    + @constructor
    + @param [scene] {Scene} Parent {{#crossLink "Scene"}}Scene{{/crossLink}}, creates this Outline within the
    + default {{#crossLink "Scene"}}Scene{{/crossLink}} when omitted.
    + @param [cfg] {*} Outline configuration
    + @param [cfg.id] {String} Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}}, generated automatically when omitted.
    + @param [cfg.meta] {String:Object} Optional map of user-defined metadata to attach to this Outline.
    + @param [cfg.thickness=15] {Number} Thickness of the outline in pixels.
    + @param [cfg.color=[1,1,0]] {Float32Array} The RGB outline color.
    + @extends Component
    + */
    +(function () {
    +
    +    "use strict";
    +
    +    xeogl.Outline = xeogl.Component.extend({
    +
    +        type: "xeogl.Outline",
    +
    +        _init: function (cfg) {
    +
    +            this._state = new xeogl.renderer.Outline({
    +                thickness: 15,
    +                color: xeogl.math.vec3([1.0, 1.0, 0.0])
    +            });
    +
    +            this.thickness = cfg.thickness;
    +            this.color = cfg.color;
    +        },
    +
    +        _props: {
    +
    +            /**
    +             * The Outline's thickness in pixels.
    +             *
    +             * Fires a {{#crossLink "Outline/thickness:event"}}{{/crossLink}} event on change.
    +             *
    +             * @property thickness
    +             * @default 15
    +             * @type Number
    +             */
    +            thickness: {
    +
    +                set: function (value) {
    +
    +                    // TODO: Only accept rendering thickness in range [0...MAX_thickness]
    +
    +                    value = value || 15;
    +
    +                    value = Math.round(value);
    +
    +
    +                    if (value === this._state.thickness) {
    +                        return;
    +                    }
    +
    +                    this._state.thickness = value;
    +
    +                    this._renderer.imageDirty = true;
    +
    +                    /**
    +                     * Fired whenever this Outline's  {{#crossLink "Outline/thickness:property"}}{{/crossLink}} property changes.
    +                     *
    +                     * @event thickness
    +                     * @param value The property's new value
    +                     */
    +                    this.fire("thickness", this._state.thickness);
    +                },
    +
    +                get: function () {
    +                    return this._state.thickness;
    +                }
    +            },
    +
    +            /**
    +             The Outline's RGB color.
    +
    +             Fires a {{#crossLink "Outline/color:event"}}{{/crossLink}} event on change.
    +
    +             @property color
    +             @default [1.0, 1.0, 0.0]
    +             @type Float32Array
    +             */
    +            color: {
    +
    +                set: function (value) {
    +
    +                    var color = this._state.color;
    +
    +                    if (!color) {
    +                        color = this._state.color = new Float32Array(3);
    +
    +                    } else if (value && color[0] === value[0] && color[1] === value[1] && color[2] === value[2]) {
    +                        return;
    +                    }
    +
    +                    if (value) {
    +                        color[0] = value[0];
    +                        color[1] = value[1];
    +                        color[2] = value[2];
    +
    +                    } else {
    +                        color[0] = 1;
    +                        color[1] = 1;
    +                        color[2] = 0;
    +                    }
    +
    +                    this._renderer.imageDirty = true;
    +
    +                    /**
    +                     * Fired whenever this Outline's {{#crossLink "Outline/color:property"}}{{/crossLink}} property changes.
    +                     *
    +                     * @event color
    +                     * @param value {Float32Array} The property's new value
    +                     */
    +                    this.fire("color", this._state.color);
    +                },
    +
    +                get: function () {
    +                    return this._state.color;
    +                }
    +            }
    +        },
    +
    +        _compile: function () {
    +            this._renderer.outline = this._state;
    +        },
    +
    +        _getJSON: function () {
    +            return {
    +                thickness: this._state.thickness,
    +                color: xeogl.math.vecToArray(this._state.color)
    +            };
    +        },
    +
    +        _destroy: function () {
    +            this._state.destroy();
    +        }
    +    });
    +
    +})();
    +
    +    
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/files/src_rendering__module.js.html b/docs/files/src_rendering__module.js.html index 8597b22e2..0e70d9210 100644 --- a/docs/files/src_rendering__module.js.html +++ b/docs/files/src_rendering__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_colorBuf.js.html b/docs/files/src_rendering_colorBuf.js.html index 96a7089ba..4a0db2b27 100644 --- a/docs/files/src_rendering_colorBuf.js.html +++ b/docs/files/src_rendering_colorBuf.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_colorTarget.js.html b/docs/files/src_rendering_colorTarget.js.html index 1c0fb48c6..69d31d668 100644 --- a/docs/files/src_rendering_colorTarget.js.html +++ b/docs/files/src_rendering_colorTarget.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_depthBuf.js.html b/docs/files/src_rendering_depthBuf.js.html index 74bf8aabd..3d07ba2e4 100644 --- a/docs/files/src_rendering_depthBuf.js.html +++ b/docs/files/src_rendering_depthBuf.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_depthTarget.js.html b/docs/files/src_rendering_depthTarget.js.html index ee0e64297..f00f17d14 100644 --- a/docs/files/src_rendering_depthTarget.js.html +++ b/docs/files/src_rendering_depthTarget.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_layer.js.html b/docs/files/src_rendering_layer.js.html index b20da8709..a55fd52b4 100644 --- a/docs/files/src_rendering_layer.js.html +++ b/docs/files/src_rendering_layer.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_modes.js.html b/docs/files/src_rendering_modes.js.html index f56ad25a7..54119469e 100644 --- a/docs/files/src_rendering_modes.js.html +++ b/docs/files/src_rendering_modes.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -230,7 +232,8 @@

    File: src/rendering/modes.js

    clippable true, // Enable effect of xeogl.Clip components transparent : false, // Disable transparency backfaces : true, // Render backfaces - frontface : "ccw" + frontface : "ccw", // Front faces have counter-clockwise vertex winding + outline: false // Don't outline for emphasis }); var boxGeometry = new xeogl.BoxGeometry(); @@ -275,6 +278,7 @@

    File: src/rendering/modes.js

    {{#crossLink "Entity"}}Entities{{/crossLink}} are things like helpers or indicators that should not be included in boundary calculations. @param [cfg.castShadow=true] {Boolean} Whether attached {{#crossLink "Entity"}}Entities{{/crossLink}} cast shadows. @param [cfg.receiveShadow=true] {Boolean} Whether attached {{#crossLink "Entity"}}Entities{{/crossLink}} receive shadows. + @param [cfg.outline=false] {Boolean} Whether an outline is drawn around the attached {{#crossLink "Entity"}}Entities{{/crossLink}}. @extends Component */ (function () { @@ -296,6 +300,7 @@

    File: src/rendering/modes.js

    collidable: null, castShadow: null, receiveShadow: null, + outline: null, hash: "" }); @@ -307,6 +312,7 @@

    File: src/rendering/modes.js

    this.collidable = cfg.collidable; this.castShadow = cfg.castShadow; this.receiveShadow = cfg.receiveShadow; + this.outline = cfg.outline; }, _props: { @@ -417,7 +423,7 @@

    File: src/rendering/modes.js

    this._state.transparent = value; - this._renderer.stateOrderDirty = true; + this._renderer.imageDirty = true; /** Fired whenever this Modes' {{#crossLink "Modes/transparent:property"}}{{/crossLink}} property changes. @@ -630,6 +636,43 @@

    File: src/rendering/modes.js

    get: function () { return this._state.receiveShadow; } + }, + + /** + Whether an outline is drawn around attached {{#crossLink "Entity"}}Entities{{/crossLink}}. + + Fires a {{#crossLink "Modes/outline:event"}}{{/crossLink}} event on change. + + @property outline + @default false + @type Boolean + */ + outline: { + + set: function (value) { + + value = !!value; + + if (value === this._state.outline) { + return; + } + + this._state.outline = value; + + this._renderer.imageDirty = true; + + /** + Fired whenever this Modes' {{#crossLink "Modes/outline:property"}}{{/crossLink}} property changes. + + @event outline + @param value The property's new value + */ + this.fire("outline", this._state.outline); + }, + + get: function () { + return this._state.outline; + } } }, @@ -646,7 +689,8 @@

    File: src/rendering/modes.js

    frontface: this._state.frontface, collidable: this._state.collidable, castShadow: this._state.castShadow, - receiveShadow: this._state.receiveShadow + receiveShadow: this._state.receiveShadow, + outline: this._state.outline }; }, diff --git a/docs/files/src_rendering_stage.js.html b/docs/files/src_rendering_stage.js.html index e4d8df38a..13f5a38ca 100644 --- a/docs/files/src_rendering_stage.js.html +++ b/docs/files/src_rendering_stage.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_rendering_viewport.js.html b/docs/files/src_rendering_viewport.js.html index 4b09e0b5c..659afe6aa 100644 --- a/docs/files/src_rendering_viewport.js.html +++ b/docs/files/src_rendering_viewport.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_scene.js.html b/docs/files/src_scene.js.html index b1ed66971..bd483c3a9 100644 --- a/docs/files/src_scene.js.html +++ b/docs/files/src_scene.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -592,6 +594,7 @@

    File: src/scene.js

    dummy = this.stage; dummy = this.transform; dummy = this.viewport; + dummy = this.outline; }, // Called by each component that is created with this Scene as parent. @@ -1518,6 +1521,32 @@

    File: src/scene.js

    } }, + /** + * The default {{#crossLink "Outline"}}{{/crossLink}} provided by this Scene. + * + * This {{#crossLink "Outline"}}{{/crossLink}} has + * an {{#crossLink "Component/id:property"}}id{{/crossLink}} equal to "default.outline", + * a {{#crossLink "Outline/color:property"}}color{{/crossLink}} set to ````[1,1,0]```` + * a {{#crossLink "Outline/thickness:property"}}thickness{{/crossLink}} set to ````15````. + * + * {{#crossLink "Entity"}}Entities{{/crossLink}} within this Scene are attached to this + * {{#crossLink "Outline"}}{{/crossLink}} by default. + * + * @property outline + * @final + * @type Outline + */ + outline: { + get: function () { + return this.components["default.outline"] || + new xeogl.Outline(this, { + id: "default.outline", + thickness: 15, + color: [1,1,0] + }); + } + }, + /** * The World-space 3D boundary of this Scene. * diff --git a/docs/files/src_shaders__module.js.html b/docs/files/src_shaders__module.js.html index 428c700a4..991bcfad5 100644 --- a/docs/files/src_shaders__module.js.html +++ b/docs/files/src_shaders__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_shaders_shader.js.html b/docs/files/src_shaders_shader.js.html index 0adfb01e1..39ec16136 100644 --- a/docs/files/src_shaders_shader.js.html +++ b/docs/files/src_shaders_shader.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_shaders_shaderParams.js.html b/docs/files/src_shaders_shaderParams.js.html index 3d4175d59..55ecb4187 100644 --- a/docs/files/src_shaders_shaderParams.js.html +++ b/docs/files/src_shaders_shaderParams.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms__module.js.html b/docs/files/src_transforms__module.js.html index fb96c140a..4d6519e17 100644 --- a/docs/files/src_transforms__module.js.html +++ b/docs/files/src_transforms__module.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_billboard.js.html b/docs/files/src_transforms_billboard.js.html index 7f3e4635d..f6017f1a7 100644 --- a/docs/files/src_transforms_billboard.js.html +++ b/docs/files/src_transforms_billboard.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_frustum.js.html b/docs/files/src_transforms_frustum.js.html index d3f189366..8a32de0ff 100644 --- a/docs/files/src_transforms_frustum.js.html +++ b/docs/files/src_transforms_frustum.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_lookat.js.html b/docs/files/src_transforms_lookat.js.html index 35c11d0e5..55bea6fae 100644 --- a/docs/files/src_transforms_lookat.js.html +++ b/docs/files/src_transforms_lookat.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_ortho.js.html b/docs/files/src_transforms_ortho.js.html index 47148ab77..e4dc7d94a 100644 --- a/docs/files/src_transforms_ortho.js.html +++ b/docs/files/src_transforms_ortho.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_perspective.js.html b/docs/files/src_transforms_perspective.js.html index 3d5f9efd7..30d8c29f6 100644 --- a/docs/files/src_transforms_perspective.js.html +++ b/docs/files/src_transforms_perspective.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_quaternion.js.html b/docs/files/src_transforms_quaternion.js.html index 5860b3a8d..35ea1ffec 100644 --- a/docs/files/src_transforms_quaternion.js.html +++ b/docs/files/src_transforms_quaternion.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_rotate.js.html b/docs/files/src_transforms_rotate.js.html index e82e5ae6f..821f0cf14 100644 --- a/docs/files/src_transforms_rotate.js.html +++ b/docs/files/src_transforms_rotate.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_scale.js.html b/docs/files/src_transforms_scale.js.html index 6f42b3653..fc7b9cc83 100644 --- a/docs/files/src_transforms_scale.js.html +++ b/docs/files/src_transforms_scale.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_stationary.js.html b/docs/files/src_transforms_stationary.js.html index b0c6045c8..e9731f1fe 100644 --- a/docs/files/src_transforms_stationary.js.html +++ b/docs/files/src_transforms_stationary.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_transform.js.html b/docs/files/src_transforms_transform.js.html index 81962fdad..cba2406bb 100644 --- a/docs/files/src_transforms_transform.js.html +++ b/docs/files/src_transforms_transform.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_transforms_translate.js.html b/docs/files/src_transforms_translate.js.html index f890d9629..d8cdb3517 100644 --- a/docs/files/src_transforms_translate.js.html +++ b/docs/files/src_transforms_translate.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/files/src_xeogl.js.html b/docs/files/src_xeogl.js.html index d203a3f10..20549dcaa 100644 --- a/docs/files/src_xeogl.js.html +++ b/docs/files/src_xeogl.js.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/index.html b/docs/index.html index 999e95520..f00ee852b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/animation.html b/docs/modules/animation.html index 859285ed7..c189ad820 100644 --- a/docs/modules/animation.html +++ b/docs/modules/animation.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/annotations.html b/docs/modules/annotations.html index 8fa1e9a6a..48806f078 100644 --- a/docs/modules/annotations.html +++ b/docs/modules/annotations.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/boundaries.html b/docs/modules/boundaries.html index 305e3f3f7..5fde6b0db 100644 --- a/docs/modules/boundaries.html +++ b/docs/modules/boundaries.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/camera.html b/docs/modules/camera.html index 475f6b072..017a9f491 100644 --- a/docs/modules/camera.html +++ b/docs/modules/camera.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/canvas.html b/docs/modules/canvas.html index 516832088..24c4705e4 100644 --- a/docs/modules/canvas.html +++ b/docs/modules/canvas.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/clipping.html b/docs/modules/clipping.html index cddae38d3..e048ece94 100644 --- a/docs/modules/clipping.html +++ b/docs/modules/clipping.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/configs.html b/docs/modules/configs.html index d5f6b002c..4a1efea23 100644 --- a/docs/modules/configs.html +++ b/docs/modules/configs.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/controls.html b/docs/modules/controls.html index ff343fff8..b10f44802 100644 --- a/docs/modules/controls.html +++ b/docs/modules/controls.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/culling.html b/docs/modules/culling.html index 5791236eb..ca3a4515f 100644 --- a/docs/modules/culling.html +++ b/docs/modules/culling.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/curves.html b/docs/modules/curves.html index a22af8cea..3f29cbf8c 100644 --- a/docs/modules/curves.html +++ b/docs/modules/curves.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/effects.html b/docs/modules/effects.html index c04f1b255..ab2003fab 100644 --- a/docs/modules/effects.html +++ b/docs/modules/effects.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/entities.html b/docs/modules/entities.html index a4e255442..975f6a37a 100644 --- a/docs/modules/entities.html +++ b/docs/modules/entities.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/generation.html b/docs/modules/generation.html index 409efeb41..0ea64afcd 100644 --- a/docs/modules/generation.html +++ b/docs/modules/generation.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/geometry.html b/docs/modules/geometry.html index 24e8f3aae..0b4c85b37 100644 --- a/docs/modules/geometry.html +++ b/docs/modules/geometry.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/helpers.html b/docs/modules/helpers.html index ecf29b6d2..3cc6b5a0e 100644 --- a/docs/modules/helpers.html +++ b/docs/modules/helpers.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/input.html b/docs/modules/input.html index b59a8d50e..8dc55fb0d 100644 --- a/docs/modules/input.html +++ b/docs/modules/input.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/interaction.html b/docs/modules/interaction.html index 9344766a2..316948e5d 100644 --- a/docs/modules/interaction.html +++ b/docs/modules/interaction.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/lighting.html b/docs/modules/lighting.html index 28902949e..212d3cca8 100644 --- a/docs/modules/lighting.html +++ b/docs/modules/lighting.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/marking.html b/docs/modules/marking.html index 50c591176..e50aad91e 100644 --- a/docs/modules/marking.html +++ b/docs/modules/marking.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/materials.html b/docs/modules/materials.html index ac693aa9c..415340dad 100644 --- a/docs/modules/materials.html +++ b/docs/modules/materials.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/math.html b/docs/modules/math.html index 156e990a4..a4675e94a 100644 --- a/docs/modules/math.html +++ b/docs/modules/math.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/models.html b/docs/modules/models.html index d315f464c..b7d116068 100644 --- a/docs/modules/models.html +++ b/docs/modules/models.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/outline.html b/docs/modules/outline.html new file mode 100644 index 000000000..35c0531ce --- /dev/null +++ b/docs/modules/outline.html @@ -0,0 +1,254 @@ + + + + + outline - xeogl + + + + + + + + + +
    +
    +
    + +

    xeogl / API Docs

    + +
    +
    + API Docs for: 1.0.0 +
    +
    +
    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    outline Module

    +
    + + +
    + Defined in: src/outline/outline.js:1 +
    + +
    + + +
    +

    An outline rendering effect for emphasis.

    + +
    + + +
    +
    +

    This module provides the following classes:

    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + diff --git a/docs/modules/rendering.html b/docs/modules/rendering.html index 6e33d50cd..be5f69876 100644 --- a/docs/modules/rendering.html +++ b/docs/modules/rendering.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/shaders.html b/docs/modules/shaders.html index a4b6064b6..438e3cada 100644 --- a/docs/modules/shaders.html +++ b/docs/modules/shaders.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/skyboxes.html b/docs/modules/skyboxes.html index d79d74f95..370fefbf3 100644 --- a/docs/modules/skyboxes.html +++ b/docs/modules/skyboxes.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/stories.html b/docs/modules/stories.html index e8ab65998..e9a7c3e13 100644 --- a/docs/modules/stories.html +++ b/docs/modules/stories.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/transforms.html b/docs/modules/transforms.html index 5cefd5158..573d9d9d4 100644 --- a/docs/modules/transforms.html +++ b/docs/modules/transforms.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/docs/modules/xeogl.html b/docs/modules/xeogl.html index 133e0cf5b..3392ea940 100644 --- a/docs/modules/xeogl.html +++ b/docs/modules/xeogl.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • @@ -493,6 +495,11 @@

    xeogl Module

    Ortho
  • +
  • + + Outline + +
  • Path @@ -898,6 +905,15 @@

    xeogl Module

    Models are units of xeogl content.
  • +
  • + + outline + + +
    + An outline rendering effect for emphasis. +
    +
  • rendering diff --git a/docs/modules/zspace.html b/docs/modules/zspace.html index ee1c1d33f..2d897b7c6 100644 --- a/docs/modules/zspace.html +++ b/docs/modules/zspace.html @@ -95,6 +95,7 @@

    xeogl / API D
  • OBBGeometry
  • OBJGeometry
  • Ortho
  • +
  • Outline
  • Path
  • PathGeometry
  • Perspective
  • @@ -161,6 +162,7 @@

    xeogl / API D
  • materials
  • math
  • models
  • +
  • outline
  • rendering
  • shaders
  • skyboxes
  • diff --git a/examples/js/utils/gltfExplorer.js b/examples/js/utils/gltfExplorer.js index 566aa7096..a7409edbb 100644 --- a/examples/js/utils/gltfExplorer.js +++ b/examples/js/utils/gltfExplorer.js @@ -11,6 +11,10 @@ var gltfExplorer = function (menuId, files) { var file = files[0]; + var outline = xeogl.scene.outline; + outline.color = [1.0,1.0,0.0]; + outline.thickness = 8; + xeogl.scene.lights.lightMap = new xeogl.CubeTexture({ src: [ "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PX.png", @@ -52,29 +56,11 @@ var gltfExplorer = function (menuId, files) { var cameraFlight = new xeogl.CameraFlightAnimation(); model.scene.on("tick", function () { - model.scene.camera.view.rotateEyeY(-0.1); + //model.scene.camera.view.rotateEyeY(-0.1); }); window.flyTo = (function () { - var boundaryHelper = new xeogl.Entity({ - geometry: {type: "xeogl.OBBGeometry"}, - material: { - type: "xeogl.PhongMaterial", - diffuse: [0, 0, 0], - ambient: [0, 0, 0], - specular: [0, 0, 0], - emissive: [1.0, 1.0, 0.5], - lineWidth: 3 - }, - visibility: { - visible: false - }, - modes: { - collidable: false - } - }); - var lastEntity; return function (id) { @@ -83,8 +69,8 @@ var gltfExplorer = function (menuId, files) { cameraFlight.flyTo(); if (lastEntity) { lastEntity.modes.transparent = true; + lastEntity.modes.outline = false; lastEntity = null; - boundaryHelper.visibility.visible = false; } return; } @@ -95,12 +81,11 @@ var gltfExplorer = function (menuId, files) { if (lastEntity) { lastEntity.modes.transparent = true; + lastEntity.modes.outline = false; } entity.modes.transparent = false; - - boundaryHelper.geometry.obb = entity.worldBoundary.obb; - boundaryHelper.visibility.visible = true; + entity.modes.outline = true; cameraFlight.flyTo({ aabb: entity.worldBoundary.aabb, diff --git a/examples/js/utils/materialGallery.js b/examples/js/utils/materialGallery.js index 5a06942b2..e86e7c7ec 100644 --- a/examples/js/utils/materialGallery.js +++ b/examples/js/utils/materialGallery.js @@ -169,15 +169,15 @@ function materialGallery(menuId, cfg) { }); window.flyTo = function (id) { - var entity = xeogl.scene.entities[id]; - if (entity) { - cameraFlight.flyTo({ - worldBoundary: entity.worldBoundary, - fit: true, - fitFOV: 35 - }); - } - }; + var entity = xeogl.scene.entities[id]; + if (entity) { + cameraFlight.flyTo({ + worldBoundary: entity.worldBoundary, + fit: true, + fitFOV: 35 + }); + } + }; //--------------------------------------------------- // Create a zSpace effect and stylus control diff --git a/src/_renderer/chunks/clipsChunk.js b/src/_renderer/chunks/clipsChunk.js index 65f4974eb..2eb7bef1b 100644 --- a/src/_renderer/chunks/clipsChunk.js +++ b/src/_renderer/chunks/clipsChunk.js @@ -74,6 +74,10 @@ } } } + }, + + outline: function(frameCtx) { + this.drawPick(frameCtx); } }); diff --git a/src/_renderer/chunks/drawChunk.js b/src/_renderer/chunks/drawChunk.js index 574b862c5..ca8d14219 100644 --- a/src/_renderer/chunks/drawChunk.js +++ b/src/_renderer/chunks/drawChunk.js @@ -69,6 +69,10 @@ if (pickPositions) { gl.drawArrays(state.primitive, 0, pickPositions.numItems / 3); } + }, + + outline: function(frameCtx) { + this.draw(frameCtx); } }); diff --git a/src/_renderer/chunks/geometryChunk.js b/src/_renderer/chunks/geometryChunk.js index b74091a80..f6c9e973b 100644 --- a/src/_renderer/chunks/geometryChunk.js +++ b/src/_renderer/chunks/geometryChunk.js @@ -26,6 +26,10 @@ var pickPrimitive = this.program.pickPrimitive; this._aPositionPickPrimitive = pickPrimitive.getAttribute("position"); this._aColorPickPrimitive = pickPrimitive.getAttribute("color"); + + var outline = this.program.outline; + this._aPositionOutline = outline.getAttribute("position"); + this._aNormalOutline = outline.getAttribute("normal"); }, draw: function (frameCtx) { @@ -109,6 +113,26 @@ if (this._aColorPickPrimitive) { this._aColorPickPrimitive.bindFloatArrayBuffer(state.getPickColors()); } + }, + + outline: function (frameCtx) { + + var state = this.state; + + if (this._aPositionOutline) { + this._aPositionOutline.bindFloatArrayBuffer(state.positions); + frameCtx.bindArray++; + } + + if (this._aNormalOutline) { + this._aNormalOutline.bindFloatArrayBuffer(state.normals); + frameCtx.bindArray++; + } + + if (state.indices) { + state.indices.bind(); + frameCtx.bindArray++; + } } }); diff --git a/src/_renderer/chunks/modelTransformChunk.js b/src/_renderer/chunks/modelTransformChunk.js index 7cc751262..f43feddbb 100644 --- a/src/_renderer/chunks/modelTransformChunk.js +++ b/src/_renderer/chunks/modelTransformChunk.js @@ -12,6 +12,7 @@ this._uModelMatrixShadow = this.program.shadow.getUniform("modelMatrix"); this._uModelMatrixPickObject = this.program.pickObject.getUniform("modelMatrix"); this._uModelMatrixPickPrimitive = this.program.pickPrimitive.getUniform("modelMatrix"); + this._uModelMatrixOutline = this.program.outline.getUniform("modelMatrix"); }, draw: function () { @@ -39,6 +40,12 @@ if (this._uModelMatrixPickPrimitive) { this._uModelMatrixPickPrimitive.setValue(this.state.getMatrix()); } + }, + + outline: function () { + if (this._uModelMatrixOutline) { + this._uModelMatrixOutline.setValue(this.state.getMatrix()); + } } }); diff --git a/src/_renderer/chunks/modesChunk.js b/src/_renderer/chunks/modesChunk.js index 84975292a..0c56a4fd0 100644 --- a/src/_renderer/chunks/modesChunk.js +++ b/src/_renderer/chunks/modesChunk.js @@ -39,29 +39,6 @@ } frameCtx.frontface = frontface; } - - var transparent = state.transparent; - - if (frameCtx.transparent !== transparent) { - if (!frameCtx.pick) { - if (transparent) { - - // Entering a transparency bin - - gl.enable(gl.BLEND); - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - frameCtx.blendEnabled = true; - } else { - - // Leaving a transparency bin - - gl.disable(gl.BLEND); - frameCtx.blendEnabled = false; - } - } - frameCtx.transparent = transparent; - } }, shadow: function (frameCtx) { diff --git a/src/_renderer/chunks/outlineChunk.js b/src/_renderer/chunks/outlineChunk.js new file mode 100644 index 000000000..d8ec3dc6e --- /dev/null +++ b/src/_renderer/chunks/outlineChunk.js @@ -0,0 +1,31 @@ +(function () { + + "use strict"; + + xeogl.renderer.ChunkFactory.createChunkType({ + + type: "outline", + + build: function () { + + var outline = this.program.outline; + + this._uColor = outline.getUniform("color"); + this._uThickness = outline.getUniform("thickness"); + }, + + outline: function (frameCtx) { + + var state = this.state; + + if (this._uColor) { + this._uColor.setValue(state.color); + } + + if (this._uThickness) { + this._uThickness.setValue(state.thickness); + } + } + }); + +})(); diff --git a/src/_renderer/chunks/programChunk.js b/src/_renderer/chunks/programChunk.js index 1dbe15ad5..d23afe61e 100644 --- a/src/_renderer/chunks/programChunk.js +++ b/src/_renderer/chunks/programChunk.js @@ -30,6 +30,10 @@ pickPrimitive: function () { this.program.pickPrimitive.bind(); + }, + + outline: function () { + this.program.outline.bind(); } }); })(); diff --git a/src/_renderer/chunks/projTransformChunk.js b/src/_renderer/chunks/projTransformChunk.js index e0d173a5f..80dd19064 100644 --- a/src/_renderer/chunks/projTransformChunk.js +++ b/src/_renderer/chunks/projTransformChunk.js @@ -11,6 +11,7 @@ this._uProjMatrixShadow = this.program.shadow.getUniform("shadowProjMatrix"); this._uProjMatrixPickObject = this.program.pickObject.getUniform("projMatrix"); this._uProjMatrixPickPrimitive = this.program.pickPrimitive.getUniform("projMatrix"); + this._uProjMatrixOutline = this.program.outline.getUniform("projMatrix"); }, draw: function () { @@ -35,6 +36,12 @@ if (this._uProjMatrixPickPrimitive) { this._uProjMatrixPickPrimitive.setValue(frameCtx.pickProjMatrix || this.state.getMatrix()); } + }, + + outline: function (frameCtx) { + if (this._uProjMatrixOutline) { + this._uProjMatrixOutline.setValue(this.state.getMatrix()); + } } }); diff --git a/src/_renderer/chunks/viewTransformChunk.js b/src/_renderer/chunks/viewTransformChunk.js index 4292109c9..c473d076a 100644 --- a/src/_renderer/chunks/viewTransformChunk.js +++ b/src/_renderer/chunks/viewTransformChunk.js @@ -12,6 +12,7 @@ this._uViewMatrixShadow = this.program.pickObject.getUniform("shadowViewMatrix"); this._uViewMatrixPickObject = this.program.pickObject.getUniform("viewMatrix"); this._uViewMatrixPickPrimitive = this.program.pickPrimitive.getUniform("viewMatrix"); + this._uViewMatrixOutline = this.program.outline.getUniform("viewMatrix"); }, draw: function () { @@ -42,6 +43,12 @@ if (this._uViewMatrixPickPrimitive) { this._uViewMatrixPickPrimitive.setValue(frameCtx.pickViewMatrix || this.state.getMatrix()); } + }, + + outline: function () { + if (this._uViewMatrixOutline) { + this._uViewMatrixOutline.setValue(this.state.getMatrix()); + } } }); diff --git a/src/_renderer/chunks/viewportChunk.js b/src/_renderer/chunks/viewportChunk.js index 0fb63e6f6..6f26f7143 100644 --- a/src/_renderer/chunks/viewportChunk.js +++ b/src/_renderer/chunks/viewportChunk.js @@ -19,18 +19,19 @@ }, shadow: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); }, pickObject: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); }, pickPrimitive: function () { - var boundary = this.state.boundary; - this.program.gl.viewport(boundary[0], boundary[1], boundary[2], boundary[3]); + this.draw(); + }, + + outline: function() { + this.draw(); } }); diff --git a/src/_renderer/program.js b/src/_renderer/program.js index ce3822b98..f388e38df 100644 --- a/src/_renderer/program.js +++ b/src/_renderer/program.js @@ -52,6 +52,12 @@ */ this.pickPrimitive = null; + /** + * The outline program + * @type webgl.Program + */ + this.outline = null; + /** * The count of display objects using this program * @type Number @@ -110,6 +116,7 @@ this.shadow = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexShadow, this.source.fragmentShadow); this.pickObject = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexPickObject, this.source.fragmentPickObject); this.pickPrimitive = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexPickPrimitive, this.source.fragmentPickPrimitive); + this.outline = new xeogl.renderer.webgl.Program(this.stats, gl, this.source.vertexOutline, this.source.fragmentOutline); if (!this.draw.allocated) { this.errorLog = ["Draw program failed to allocate"].concat(this.draw.errorLog); @@ -131,6 +138,11 @@ return; } + if (!this.outline.allocated) { + this.errorLog = ["Outline effect program failed to allocate"].concat(this.outline.errorLog); + return; + } + this.allocated = true; if (!this.draw.compiled) { @@ -153,6 +165,11 @@ return; } + if (!this.outline.compiled) { + this.errorLog = ["Outline effect program failed to compile"].concat(this.outline.errorLog); + return; + } + this.compiled = true; if (!this.draw.linked) { @@ -175,6 +192,11 @@ return; } + if (!this.outline.linked) { + this.errorLog = ["Outline effect program failed to link"].concat(this.outline.errorLog); + return; + } + this.linked = true; if (!this.draw.validated) { @@ -197,7 +219,33 @@ return; } + if (!this.outline.validated) { + this.errorLog = ["Outline effect program failed to validate"].concat(this.outline.errorLog); + return; + } + this.validated = true; }; + /** + * Destroys this program. + */ + xeogl.renderer.Program.prototype.destroy = function() { + if (this.draw) { + this.draw.destroy(); + } + if (this.shadow) { + this.shadow.destroy(); + } + if (this.pickObject) { + this.pickObject.destroy(); + } + if (this.pickPrimitive) { + this.pickPrimitive.destroy(); + } + if (this.outline) { + this.outline.destroy(); + } + }; + })(); diff --git a/src/_renderer/programFactory.js b/src/_renderer/programFactory.js index 37e6eeddb..1608d3331 100644 --- a/src/_renderer/programFactory.js +++ b/src/_renderer/programFactory.js @@ -59,15 +59,12 @@ var program = programState.program; - program.draw.destroy(); - program.shadow.destroy(); - program.pickObject.destroy(); - program.pickPrimitive.destroy(); - xeogl.renderer.ProgramSourceFactory.putSource(program.hash); delete this._programStates[program.hash]; + program.destroy(); + this.stats.memory.programs--; } }; diff --git a/src/_renderer/programSource.js b/src/_renderer/programSource.js index 418aa66a9..9d48c761d 100644 --- a/src/_renderer/programSource.js +++ b/src/_renderer/programSource.js @@ -14,12 +14,15 @@ * @param {String} fragmentDraw Fragment shader source for drawing. * @param {String} vertexShadow Vertex shader source for drawing the shadow buffer. * @param {String} fragmentShadow Fragment shader source for drawing the shadow buffer. + * @param {String} vertexOutline Vertex shader source for drawing outlines. + * @param {String} fragmentOutline Fragment shader source for drawing outlines. */ xeogl.renderer.ProgramSource = function (hash, vertexPickObject, fragmentPickObject, vertexPickPrimitive, fragmentPickPrimitive, vertexDraw, fragmentDraw, - vertexShadow, fragmentShadow) { + vertexShadow, fragmentShadow, + vertexOutline, fragmentOutline) { /** * Hash code identifying the capabilities of the {@link xeogl.renderer.Program} that is compiled from this source @@ -75,6 +78,18 @@ */ this.fragmentShadow = fragmentShadow; + /** + * Vertex shader source for rendering outlines. + * @type {Array of String} + */ + this.vertexOutline = vertexOutline; + + /** + * Fragment shader source for rendering outlines. + * @type {Array of String} + */ + this.fragmentOutline = fragmentOutline; + /** * Count of {@link xeogl.renderer.Program}s compiled from this program source code * @type Number diff --git a/src/_renderer/programSourceFactory.js b/src/_renderer/programSourceFactory.js index fa9778919..ff2cb02a0 100644 --- a/src/_renderer/programSourceFactory.js +++ b/src/_renderer/programSourceFactory.js @@ -32,6 +32,8 @@ var fragmentPickPrimSrc; var vertexShadowSrc; var fragmentShadowSrc; + var vertexOutlineSrc; + var fragmentOutlineSrc; /** * Get source code for a program to render the given states. @@ -71,7 +73,9 @@ vertexDraw(), fragmentDraw(), vertexShadow(), - fragmentShadow() + fragmentShadow(), + vertexOutline(), + fragmentOutline() ); cache[hash] = source; @@ -257,6 +261,75 @@ return fragmentShadowSrc = end(); } + function vertexOutline() { + begin(); + add("attribute vec4 position;"); + add("uniform mat4 modelMatrix;"); + add("uniform mat4 viewMatrix;"); + add("uniform mat4 projMatrix;"); + add("uniform float thickness;"); + + if (normals) { + add("attribute vec3 normal;"); + } + + if (states.billboard.active) { + add("void billboard(inout mat4 mat) {"); + add(" mat[0][0] = 1.0;"); + add(" mat[0][1] = 0.0;"); + add(" mat[0][2] = 0.0;"); + if (states.billboard.spherical) { + add(" mat[1][0] = 0.0;"); + add(" mat[1][1] = 1.0;"); + add(" mat[1][2] = 0.0;"); + } + add(" mat[2][0] = 0.0;"); + add(" mat[2][1] = 0.0;"); + add(" mat[2][2] =1.0;"); + add("}"); + } + + add("void main(void) {"); + + add("mat4 viewMatrix2 = viewMatrix;"); + add("mat4 modelMatrix2 = modelMatrix;"); + + if (states.stationary.active) { + add("viewMatrix2[3][0] = viewMatrix2[3][1] = viewMatrix2[3][2] = 0.0;") + } + + if (states.billboard.active) { + add("billboard(modelMatrix2);"); + add("billboard(viewMatrix2);"); + } + + // Displacement + + if (normals) { + add("vec4 projPos = projMatrix * viewMatrix2 * modelMatrix2 * vec4(position.xyz, 1.0); "); + add(" vec3 offset = (normalize(normal) * (thickness * 0.0005 * (projPos.z/1.0)));"); + } else { + add(" vec3 offset = vec3(0.0, 0.0, 0.0);"); + } + + add("vec4 worldVertex = modelMatrix * vec4(position.xyz + offset, 1.0); "); + + add(" gl_Position = projMatrix * (viewMatrix * worldVertex);"); + add("}"); + return vertexOutlineSrc = end(); + } + + function fragmentOutline() { + begin(); + add("precision " + getFSFloatPrecision(states.gl) + " float;"); + add("uniform vec3 color;"); + add("void main(void) {"); + add(" gl_FragColor = vec4(color, 1.0);"); + add("}"); + + return fragmentOutlineSrc = end(); + } + function vertexDraw() { var vertex = states.shader.vertex; @@ -1023,7 +1096,8 @@ } if (light.type === "dir" && light.space === "view") { add("uniform vec3 lightDir" + i + ";"); - } if (light.type === "point" && light.space === "view") { + } + if (light.type === "point" && light.space === "view") { add("uniform vec3 lightPos" + i + ";"); } else { add("varying vec4 vViewLightReverseDirAndDist" + i + ";"); diff --git a/src/_renderer/renderer.js b/src/_renderer/renderer.js index 887480836..b34eca1d1 100644 --- a/src/_renderer/renderer.js +++ b/src/_renderer/renderer.js @@ -257,6 +257,14 @@ */ this.viewport = null; + /** + Outline state. + @property outline + @type {renderer.Outline} + */ + this.outline = null; + + //----------------- Renderer dirty flags ------------------------------- /** @@ -337,6 +345,7 @@ object.stationary = this.stationary; object.viewport = this.viewport; object.lights = this.lights; + object.outline = this.outline; // Build hash of the object's state configuration. This is used // to hash the object's shader so that it may be reused by other @@ -408,8 +417,9 @@ this._setChunk(object, 10, this.material.type, this.material); // Supports different material systems this._setChunk(object, 11, "clips", this.clips); this._setChunk(object, 12, "viewport", this.viewport); - this._setChunk(object, 13, "geometry", this.geometry); - this._setChunk(object, 14, "draw", this.geometry, true); // Must be last + this._setChunk(object, 13, "outline", this.outline); + this._setChunk(object, 14, "geometry", this.geometry); + this._setChunk(object, 15, "draw", this.geometry, true); // Must be last // Ambient light is global across everything in display, and // can never be disabled, so grab it now because we want to @@ -606,8 +616,7 @@ object.sortKey = -1; } else { object.sortKey = - ((object.stage.priority + 1) * 10000000000000000) - + ((object.modes.transparent ? 2 : 1) * 100000000000000) + ((object.stage.priority + 1) * 100000000000000) + ((object.layer.priority + 1) * 10000000000000) + ((object.program.id + 1) * 100000000) + ((object.material.id + 1) * 10000) @@ -670,9 +679,9 @@ if (shadowObjectLists.hasOwnProperty(lightId)) { shadowObjectList = shadowObjectLists[lightId]; light = shadowObjectList.light; - // if (light.shadowDirty) { - this._renderShadowMap(light, shadowObjectList.objects); - // } + // if (light.shadowDirty) { + this._renderShadowMap(light, shadowObjectList.objects); + // } } } }; @@ -755,125 +764,226 @@ renderBuf.unbind(); }; - xeogl.renderer.Renderer.prototype._renderObjectList = function (params) { + xeogl.renderer.Renderer.prototype._renderObjectList = (function () { - var gl = this.gl; + var outlinedObjects = []; + var lastChunkId = new Int32Array(30); - var ambient = this._ambient; - var ambientColor; - if (ambient) { - var color = ambient.color; - var intensity = ambient.intensity; - this.ambientColor[0] = color[0] * intensity; - this.ambientColor[1] = color[1] * intensity; - this.ambientColor[2] = color[2] * intensity; - } else { - this.ambientColor[0] = 0; - this.ambientColor[1] = 0; - this.ambientColor[2] = 0; + var transparentObjects = []; + var numTransparentObjects = 0; + + function clearStateTracking() { + for (var i = 0; i < 20; i++) { + lastChunkId[i] = -9999999999; + } } - var frameCtx = this._frameCtx; + function drawObject(frameCtx, object) { + var chunks = object.chunks; + var chunk; + for (var i = 0, len = chunks.length; i < len; i++) { + chunk = chunks[i]; + if (chunk) { + if (chunk.draw && (chunk.unique || lastChunkId[i] !== chunk.id)) { + chunk.draw(frameCtx); + lastChunkId[i] = chunk.id; + } + } + } + } - frameCtx.renderTarget = null; - frameCtx.renderBuf = null; - frameCtx.depthbufEnabled = null; - frameCtx.clearDepth = null; - frameCtx.depthFunc = gl.LESS; - frameCtx.blendEnabled = false; - frameCtx.backfaces = true; - frameCtx.frontface = true; // true == "ccw" else "cw" - frameCtx.textureUnit = 0; - frameCtx.transparent = false; // True while rendering transparency bin - frameCtx.ambientColor = this.ambientColor; - frameCtx.drawElements = 0; - frameCtx.useProgram = 0; - frameCtx.bindTexture = 0; - frameCtx.bindArray = 0; - frameCtx.pass = params.pass; - frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer; - frameCtx.pickViewMatrix = params.pickViewMatrix; - frameCtx.pickProjMatrix = params.pickProjMatrix; - frameCtx.pickIndex = 0; + function drawObjectOutline(frameCtx, object) { + var chunks = object.chunks; + var chunk; + for (var i = 0, len = chunks.length; i < len; i++) { + chunk = chunks[i]; + if (chunk) { + if (chunk.outline && (chunk.unique || lastChunkId[i] !== chunk.id)) { + chunk.outline(frameCtx); + lastChunkId[i] = chunk.id; + } + } + } + } - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + return function (params) { - if (this.transparent) { // Canvas is transparent - gl.clearColor(0, 0, 0, 0); - } else { - gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0); - } + var gl = this.gl; - gl.enable(gl.DEPTH_TEST); - gl.frontFace(gl.CCW); - gl.disable(gl.CULL_FACE); - gl.disable(gl.BLEND); + var ambient = this._ambient; + if (ambient) { + var color = ambient.color; + var intensity = ambient.intensity; + this.ambientColor[0] = color[0] * intensity; + this.ambientColor[1] = color[1] * intensity; + this.ambientColor[2] = color[2] * intensity; + } else { + this.ambientColor[0] = 0; + this.ambientColor[1] = 0; + this.ambientColor[2] = 0; + } - var i; - var len; - var object; - var j; - var lenj; - var chunks; - var chunk; + var frameCtx = this._frameCtx; + + frameCtx.renderTarget = null; + frameCtx.renderBuf = null; + frameCtx.depthbufEnabled = null; + frameCtx.clearDepth = null; + frameCtx.depthFunc = gl.LESS; + frameCtx.blendEnabled = false; + frameCtx.backfaces = true; + frameCtx.frontface = true; // true == "ccw" else "cw" + frameCtx.textureUnit = 0; + frameCtx.transparent = false; // True while rendering transparency bin + frameCtx.ambientColor = this.ambientColor; + frameCtx.drawElements = 0; + frameCtx.useProgram = 0; + frameCtx.bindTexture = 0; + frameCtx.bindArray = 0; + frameCtx.pass = params.pass; + frameCtx.bindOutputFramebuffer = this.bindOutputFramebuffer; + frameCtx.pickViewMatrix = params.pickViewMatrix; + frameCtx.pickProjMatrix = params.pickProjMatrix; + frameCtx.pickIndex = 0; + + gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + + if (this.transparent) { // Canvas is transparent + gl.clearColor(0, 0, 0, 0); + } else { + gl.clearColor(this.ambientColor[0], this.ambientColor[1], this.ambientColor[2], 1.0); + } - var lastChunkId = this._lastChunkId = this._lastChunkId || new Int32Array(30); - for (i = 0; i < 20; i++) { - lastChunkId[i] = -9999999999999; - } + gl.enable(gl.DEPTH_TEST); + gl.frontFace(gl.CCW); + gl.enable(gl.CULL_FACE); + gl.depthMask(true); - var startTime = (new Date()).getTime(); + var i; + var len; + var object; - if (this.bindOutputFramebuffer) { - this.bindOutputFramebuffer(params.pass); - } + var startTime = (new Date()).getTime(); - if (params.clear) { - gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); - } + if (this.bindOutputFramebuffer) { + this.bindOutputFramebuffer(params.pass); + } - for (i = 0, len = this._objectListLen; i < len; i++) { - object = this._objectList[i]; - if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) { - continue; + if (params.clear) { + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); } - chunks = object.chunks; - for (j = 0, lenj = chunks.length; j < lenj; j++) { - chunk = chunks[j]; - if (chunk) { - if (chunk.draw && (chunk.unique || lastChunkId[j] !== chunk.id)) { - chunk.draw(frameCtx); - lastChunkId[j] = chunk.id; + + // Render opaque, non-outlined objects + + var numOutlinedObjects = 0; + + numTransparentObjects = 0; + + clearStateTracking(); + + for (i = 0, len = this._objectListLen; i < len; i++) { + object = this._objectList[i]; + if (!object.compiled || object.cull.culled === true || object.visibility.visible === false) { + continue; + } + if (object.modes.transparent) { + transparentObjects[numTransparentObjects++] = object; + continue; + } + if (object.modes.outline) { + outlinedObjects[numOutlinedObjects++] = object; + continue; + } + drawObject(frameCtx, object); + } + + // Render opaque outlined objects + + if (numOutlinedObjects > 0) { + + // Render objects + + gl.enable(gl.STENCIL_TEST); + gl.stencilFunc(gl.ALWAYS, 1, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE); + gl.stencilMask(1); + gl.clearStencil(0); + gl.clear(gl.STENCIL_BUFFER_BIT); + + clearStateTracking(); + + for (i = 0; i < numOutlinedObjects; i++) { + drawObject(frameCtx, outlinedObjects[i]); + } + + // Render outlines + + gl.stencilFunc(gl.EQUAL, 0, 1); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + gl.stencilMask(0x00); + gl.disable(gl.CULL_FACE); // Need both faces for better corners with face-aligned normals + + clearStateTracking(); + + for (i = 0; i < numOutlinedObjects; i++) { + drawObjectOutline(frameCtx, outlinedObjects[i]); + } + + gl.disable(gl.STENCIL_TEST); + } + + // Draw transparent objects + + if (numTransparentObjects > 0) { + + gl.enable(gl.CULL_FACE); + gl.enable(gl.BLEND); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + + numOutlinedObjects = 0; + + clearStateTracking(); + + for (i = 0; i < numTransparentObjects; i++) { + object = transparentObjects[i]; + if (object.modes.outline) { + outlinedObjects[numOutlinedObjects++] = object; // Build outlined list + continue; } + drawObject(frameCtx, object); } + + // Transparent outlined objects are not supported yet + + gl.disable(gl.BLEND); } - } - var endTime = Date.now(); - var frameStats = this.stats.frame; + var endTime = Date.now(); + var frameStats = this.stats.frame; - frameStats.renderTime = (endTime - startTime) / 1000.0; - frameStats.drawElements = frameCtx.drawElements; - frameStats.useProgram = frameCtx.useProgram; - frameStats.bindTexture = frameCtx.bindTexture; - frameStats.bindArray = frameCtx.bindArray; + frameStats.renderTime = (endTime - startTime) / 1000.0; + frameStats.drawElements = frameCtx.drawElements; + frameStats.useProgram = frameCtx.useProgram; + frameStats.bindTexture = frameCtx.bindTexture; + frameStats.bindArray = frameCtx.bindArray; - if (frameCtx.renderBuf) { - frameCtx.renderBuf.unbind(); - } + if (frameCtx.renderBuf) { + frameCtx.renderBuf.unbind(); + } - var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); + var numTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); - for (var ii = 0; ii < numTextureUnits; ii++) { - gl.activeTexture(gl.TEXTURE0 + ii); - gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); - gl.bindTexture(gl.TEXTURE_2D, null); - } + for (var ii = 0; ii < numTextureUnits; ii++) { + gl.activeTexture(gl.TEXTURE0 + ii); + gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); + gl.bindTexture(gl.TEXTURE_2D, null); + } - if (this.unbindOutputFramebuffer) { - this.unbindOutputFramebuffer(params.pass); - } - }; + if (this.unbindOutputFramebuffer) { + this.unbindOutputFramebuffer(params.pass); + } + }; + })(); /** * Attempts to pick an object. diff --git a/src/_renderer/states.js b/src/_renderer/states.js index 22d604ca5..3009f5991 100644 --- a/src/_renderer/states.js +++ b/src/_renderer/states.js @@ -435,5 +435,22 @@ xeogl.renderer.Viewport = xeogl.renderer.State.extend({ _ids: new xeogl.utils.Map({}) }); + + /** + + Outline state. + + renderer.Outline + @module xeogl + + @constructor + @param cfg {*} Configs + @param [cfg.thickness=15] {Number} Thickness of the outline in pixels. + @param [cfg.color=[1,0,0]] {Array of Number} The outline color, + @extends renderer.State + */ + xeogl.renderer.Outline = xeogl.renderer.State.extend({ + _ids: new xeogl.utils.Map({}) + }); })(); diff --git a/src/canvas/canvas.js b/src/canvas/canvas.js index e3eda38a7..48ea08bd3 100644 --- a/src/canvas/canvas.js +++ b/src/canvas/canvas.js @@ -189,13 +189,15 @@ this.contextAttr.alpha = this.transparent; if (this.contextAttr.alpha === undefined || this.contextAttr.alpha === null) { - this.contextAttr.alphs = this.transparent; + this.contextAttr.alpha = this.transparent; } if (this.contextAttr.preserveDrawingBuffer === undefined || this.contextAttr.preserveDrawingBuffer === null) { this.contextAttr.preserveDrawingBuffer = false; } + this.contextAttr.stencil = true; + if (!cfg.canvas) { // Canvas not supplied, create one automatically diff --git a/src/entities/entity.js b/src/entities/entity.js index 4aea7e37c..e05f229c6 100644 --- a/src/entities/entity.js +++ b/src/entities/entity.js @@ -154,6 +154,8 @@ {{#crossLink "Scene/transform:property"}}transform{{/crossLink}} (which is an identity matrix which performs no transformation). @param [cfg.viewport] {String|Viewport} ID or instance of a {{#crossLink "Viewport"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink "Scene"}}Scene{{/crossLink}}'s default instance, {{#crossLink "Scene/viewport:property"}}{{/crossLink}}, which is automatically resizes to the canvas. + @param [cfg.outline] {String|Outline} ID or instance of a {{#crossLink "Outline"}}{{/crossLink}} attached to this Entity. Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent {{#crossLink "Scene"}}Scene{{/crossLink}}'s default instance, + {{#crossLink "Scene/outline:property"}}{{/crossLink}}. @param [cfg.loading] {Boolean} Flag which indicates that this Entity is freshly loaded. This will increment the {{#crossLink "Spinner/processes:property"}}Spinner processes{{/crossLink}} count, and then when this Entity is first rendered, will decrement the count again. @@ -205,6 +207,7 @@ this.billboard = cfg.billboard; this.stationary = cfg.stationary; this.viewport = cfg.viewport; + this.outline = cfg.outline; // Cached boundary for each coordinate space // The Entity's Geometry component caches the Local-space boundary @@ -1029,6 +1032,41 @@ } }, + /** + * The {{#crossLink "Outline"}}Outline{{/crossLink}} attached to this Entity. + * + * Must be within the same {{#crossLink "Scene"}}Scene{{/crossLink}} as this Entity. Defaults to the parent + * {{#crossLink "Scene"}}Scene{{/crossLink}}'s default {{#crossLink "Scene/outline:property"}}Outline{{/crossLink}} when set to + * a null or undefined value. + * + * Fires an {{#crossLink "Entity/outline:event"}}{{/crossLink}} event on change. + * + * @property outline + * @type Outline + */ + outline: { + + set: function (value) { + + /** + * Fired whenever this Entity's {{#crossLink "Entity/Outline:property"}}{{/crossLink}} property changes. + * + * @event Outline + * @param value The property's new value + */ + this._attach({ + name: "outline", + type: "xeogl.Outline", + component: value, + sceneDefault: true + }); + }, + + get: function () { + return this._attached.outline; + } + }, + /** * Local-space 3D boundary of this Entity. * @@ -1442,6 +1480,7 @@ attached.billboard._compile(); attached.stationary._compile(); attached.viewport._compile(); + attached.outline._compile(); // (Re)build this Entity in the renderer; for each Entity in teh scene graph, // there is an "object" in the renderer, that has the same ID as the entity @@ -1494,7 +1533,8 @@ transform: attached.transform.id, billboard: attached.billboard.id, stationary: attached.stationary.id, - viewport: attached.viewport.id + viewport: attached.viewport.id, + outline: attached.outline.id }; }, diff --git a/src/outline/_module.js b/src/outline/_module.js new file mode 100644 index 000000000..b2958d821 --- /dev/null +++ b/src/outline/_module.js @@ -0,0 +1,6 @@ +/** + * An outline rendering effect for emphasis. + * + * @module xeogl + * @submodule outline + */ \ No newline at end of file diff --git a/src/outline/outline.js b/src/outline/outline.js new file mode 100644 index 000000000..14e791bfc --- /dev/null +++ b/src/outline/outline.js @@ -0,0 +1,176 @@ +/** + A **Outline** renders an outline around attached {{#crossLink "Entity"}}Entities{{/crossLink}}. + + ## Overview + + TODO + + ## Usage + + ````javascript + + var outline = new xeogl.Outline({ + thickness: 15, // Default + color: [1,0,0] // Default + }); + + new xeogl.Entity({ + geometry: new xeogl.TorusGeometry(), + outline: outline, + modes: new xeogl.Modes({ + outline: false // Hide the outline (default) + }); + }); + + new xeogl.Entity({ + geometry: new xeogl.BoxGeometry(), + outline: outline, + modes: new xeogl.Modes({ + outline: true // Show the outline + }); + }); + ```` + + @class Outline + @module xeogl + @submodule outline + @constructor + @param [scene] {Scene} Parent {{#crossLink "Scene"}}Scene{{/crossLink}}, creates this Outline within the + default {{#crossLink "Scene"}}Scene{{/crossLink}} when omitted. + @param [cfg] {*} Outline configuration + @param [cfg.id] {String} Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}}, generated automatically when omitted. + @param [cfg.meta] {String:Object} Optional map of user-defined metadata to attach to this Outline. + @param [cfg.thickness=15] {Number} Thickness of the outline in pixels. + @param [cfg.color=[1,1,0]] {Float32Array} The RGB outline color. + @extends Component + */ +(function () { + + "use strict"; + + xeogl.Outline = xeogl.Component.extend({ + + type: "xeogl.Outline", + + _init: function (cfg) { + + this._state = new xeogl.renderer.Outline({ + thickness: 15, + color: xeogl.math.vec3([1.0, 1.0, 0.0]) + }); + + this.thickness = cfg.thickness; + this.color = cfg.color; + }, + + _props: { + + /** + * The Outline's thickness in pixels. + * + * Fires a {{#crossLink "Outline/thickness:event"}}{{/crossLink}} event on change. + * + * @property thickness + * @default 15 + * @type Number + */ + thickness: { + + set: function (value) { + + // TODO: Only accept rendering thickness in range [0...MAX_thickness] + + value = value || 15; + + value = Math.round(value); + + + if (value === this._state.thickness) { + return; + } + + this._state.thickness = value; + + this._renderer.imageDirty = true; + + /** + * Fired whenever this Outline's {{#crossLink "Outline/thickness:property"}}{{/crossLink}} property changes. + * + * @event thickness + * @param value The property's new value + */ + this.fire("thickness", this._state.thickness); + }, + + get: function () { + return this._state.thickness; + } + }, + + /** + The Outline's RGB color. + + Fires a {{#crossLink "Outline/color:event"}}{{/crossLink}} event on change. + + @property color + @default [1.0, 1.0, 0.0] + @type Float32Array + */ + color: { + + set: function (value) { + + var color = this._state.color; + + if (!color) { + color = this._state.color = new Float32Array(3); + + } else if (value && color[0] === value[0] && color[1] === value[1] && color[2] === value[2]) { + return; + } + + if (value) { + color[0] = value[0]; + color[1] = value[1]; + color[2] = value[2]; + + } else { + color[0] = 1; + color[1] = 1; + color[2] = 0; + } + + this._renderer.imageDirty = true; + + /** + * Fired whenever this Outline's {{#crossLink "Outline/color:property"}}{{/crossLink}} property changes. + * + * @event color + * @param value {Float32Array} The property's new value + */ + this.fire("color", this._state.color); + }, + + get: function () { + return this._state.color; + } + } + }, + + _compile: function () { + this._renderer.outline = this._state; + }, + + _getJSON: function () { + return { + thickness: this._state.thickness, + color: xeogl.math.vecToArray(this._state.color) + }; + }, + + _destroy: function () { + this._state.destroy(); + } + }); + +})(); diff --git a/src/rendering/modes.js b/src/rendering/modes.js index 91931cc7f..9f87e3816 100644 --- a/src/rendering/modes.js +++ b/src/rendering/modes.js @@ -23,7 +23,8 @@ clippable true, // Enable effect of xeogl.Clip components transparent : false, // Disable transparency backfaces : true, // Render backfaces - frontface : "ccw" + frontface : "ccw", // Front faces have counter-clockwise vertex winding + outline: false // Don't outline for emphasis }); var boxGeometry = new xeogl.BoxGeometry(); @@ -68,6 +69,7 @@ {{#crossLink "Entity"}}Entities{{/crossLink}} are things like helpers or indicators that should not be included in boundary calculations. @param [cfg.castShadow=true] {Boolean} Whether attached {{#crossLink "Entity"}}Entities{{/crossLink}} cast shadows. @param [cfg.receiveShadow=true] {Boolean} Whether attached {{#crossLink "Entity"}}Entities{{/crossLink}} receive shadows. + @param [cfg.outline=false] {Boolean} Whether an outline is drawn around the attached {{#crossLink "Entity"}}Entities{{/crossLink}}. @extends Component */ (function () { @@ -89,6 +91,7 @@ collidable: null, castShadow: null, receiveShadow: null, + outline: null, hash: "" }); @@ -100,6 +103,7 @@ this.collidable = cfg.collidable; this.castShadow = cfg.castShadow; this.receiveShadow = cfg.receiveShadow; + this.outline = cfg.outline; }, _props: { @@ -210,7 +214,7 @@ this._state.transparent = value; - this._renderer.stateOrderDirty = true; + this._renderer.imageDirty = true; /** Fired whenever this Modes' {{#crossLink "Modes/transparent:property"}}{{/crossLink}} property changes. @@ -423,6 +427,43 @@ get: function () { return this._state.receiveShadow; } + }, + + /** + Whether an outline is drawn around attached {{#crossLink "Entity"}}Entities{{/crossLink}}. + + Fires a {{#crossLink "Modes/outline:event"}}{{/crossLink}} event on change. + + @property outline + @default false + @type Boolean + */ + outline: { + + set: function (value) { + + value = !!value; + + if (value === this._state.outline) { + return; + } + + this._state.outline = value; + + this._renderer.imageDirty = true; + + /** + Fired whenever this Modes' {{#crossLink "Modes/outline:property"}}{{/crossLink}} property changes. + + @event outline + @param value The property's new value + */ + this.fire("outline", this._state.outline); + }, + + get: function () { + return this._state.outline; + } } }, @@ -439,7 +480,8 @@ frontface: this._state.frontface, collidable: this._state.collidable, castShadow: this._state.castShadow, - receiveShadow: this._state.receiveShadow + receiveShadow: this._state.receiveShadow, + outline: this._state.outline }; }, diff --git a/src/scene.js b/src/scene.js index 390ae2d56..1eea8a991 100644 --- a/src/scene.js +++ b/src/scene.js @@ -385,6 +385,7 @@ dummy = this.stage; dummy = this.transform; dummy = this.viewport; + dummy = this.outline; }, // Called by each component that is created with this Scene as parent. @@ -1311,6 +1312,32 @@ } }, + /** + * The default {{#crossLink "Outline"}}{{/crossLink}} provided by this Scene. + * + * This {{#crossLink "Outline"}}{{/crossLink}} has + * an {{#crossLink "Component/id:property"}}id{{/crossLink}} equal to "default.outline", + * a {{#crossLink "Outline/color:property"}}color{{/crossLink}} set to ````[1,1,0]```` + * a {{#crossLink "Outline/thickness:property"}}thickness{{/crossLink}} set to ````15````. + * + * {{#crossLink "Entity"}}Entities{{/crossLink}} within this Scene are attached to this + * {{#crossLink "Outline"}}{{/crossLink}} by default. + * + * @property outline + * @final + * @type Outline + */ + outline: { + get: function () { + return this.components["default.outline"] || + new xeogl.Outline(this, { + id: "default.outline", + thickness: 15, + color: [1,1,0] + }); + } + }, + /** * The World-space 3D boundary of this Scene. *