repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
pissang/claygl
src/GeometryBase.js
function (idx, out) { if (idx < this.triangleCount && idx >= 0) { if (!out) { out = []; } var indices = this.indices; out[0] = indices[idx * 3]; out[1] = indices[idx * 3 + 1]; out[2] = indices[idx * 3 + 2]; retur...
javascript
function (idx, out) { if (idx < this.triangleCount && idx >= 0) { if (!out) { out = []; } var indices = this.indices; out[0] = indices[idx * 3]; out[1] = indices[idx * 3 + 1]; out[2] = indices[idx * 3 + 2]; retur...
[ "function", "(", "idx", ",", "out", ")", "{", "if", "(", "idx", "<", "this", ".", "triangleCount", "&&", "idx", ">=", "0", ")", "{", "if", "(", "!", "out", ")", "{", "out", "=", "[", "]", ";", "}", "var", "indices", "=", "this", ".", "indices...
Get indices of triangle at given index. @param {number} idx @param {Array.<number>} out @return {Array.<number>}
[ "Get", "indices", "of", "triangle", "at", "given", "index", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/GeometryBase.js#L357-L368
train
pissang/claygl
src/GeometryBase.js
function (idx, arr) { var indices = this.indices; indices[idx * 3] = arr[0]; indices[idx * 3 + 1] = arr[1]; indices[idx * 3 + 2] = arr[2]; }
javascript
function (idx, arr) { var indices = this.indices; indices[idx * 3] = arr[0]; indices[idx * 3 + 1] = arr[1]; indices[idx * 3 + 2] = arr[2]; }
[ "function", "(", "idx", ",", "arr", ")", "{", "var", "indices", "=", "this", ".", "indices", ";", "indices", "[", "idx", "*", "3", "]", "=", "arr", "[", "0", "]", ";", "indices", "[", "idx", "*", "3", "+", "1", "]", "=", "arr", "[", "1", "]...
Set indices of triangle at given index. @param {number} idx @param {Array.<number>} arr
[ "Set", "indices", "of", "triangle", "at", "given", "index", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/GeometryBase.js#L375-L380
train
pissang/claygl
src/GeometryBase.js
function (array) { var value; var ArrayConstructor = this.vertexCount > 0xffff ? vendor.Uint32Array : vendor.Uint16Array; // Convert 2d array to flat if (array[0] && (array[0].length)) { var n = 0; var size = 3; value = new ArrayConstructo...
javascript
function (array) { var value; var ArrayConstructor = this.vertexCount > 0xffff ? vendor.Uint32Array : vendor.Uint16Array; // Convert 2d array to flat if (array[0] && (array[0].length)) { var n = 0; var size = 3; value = new ArrayConstructo...
[ "function", "(", "array", ")", "{", "var", "value", ";", "var", "ArrayConstructor", "=", "this", ".", "vertexCount", ">", "0xffff", "?", "vendor", ".", "Uint32Array", ":", "vendor", ".", "Uint16Array", ";", "// Convert 2d array to flat", "if", "(", "array", ...
Initialize indices from an array. @param {Array} array
[ "Initialize", "indices", "from", "an", "array", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/GeometryBase.js#L390-L411
train
pissang/claygl
src/GeometryBase.js
function () { var enabledAttributes = this._enabledAttributes; var attributeList = this._attributeList; // Cache if (enabledAttributes) { return enabledAttributes; } var result = []; var nVertex = this.vertexCount; for (var i = 0; i < attribu...
javascript
function () { var enabledAttributes = this._enabledAttributes; var attributeList = this._attributeList; // Cache if (enabledAttributes) { return enabledAttributes; } var result = []; var nVertex = this.vertexCount; for (var i = 0; i < attribu...
[ "function", "(", ")", "{", "var", "enabledAttributes", "=", "this", ".", "_enabledAttributes", ";", "var", "attributeList", "=", "this", ".", "_attributeList", ";", "// Cache", "if", "(", "enabledAttributes", ")", "{", "return", "enabledAttributes", ";", "}", ...
Get enabled attributes name list Attribute which has the same vertex number with position is treated as a enabled attribute @return {string[]}
[ "Get", "enabled", "attributes", "name", "list", "Attribute", "which", "has", "the", "same", "vertex", "number", "with", "position", "is", "treated", "as", "a", "enabled", "attribute" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/GeometryBase.js#L457-L481
train
pissang/claygl
src/GeometryBase.js
function (renderer) { var cache = this._cache; cache.use(renderer.__uid__); var chunks = cache.get('chunks'); if (chunks) { for (var c = 0; c < chunks.length; c++) { var chunk = chunks[c]; for (var k = 0; k < chunk.attributeBuffers.length; k...
javascript
function (renderer) { var cache = this._cache; cache.use(renderer.__uid__); var chunks = cache.get('chunks'); if (chunks) { for (var c = 0; c < chunks.length; c++) { var chunk = chunks[c]; for (var k = 0; k < chunk.attributeBuffers.length; k...
[ "function", "(", "renderer", ")", "{", "var", "cache", "=", "this", ".", "_cache", ";", "cache", ".", "use", "(", "renderer", ".", "__uid__", ")", ";", "var", "chunks", "=", "cache", ".", "get", "(", "'chunks'", ")", ";", "if", "(", "chunks", ")", ...
Dispose geometry data in GL context. @param {clay.Renderer} renderer
[ "Dispose", "geometry", "data", "in", "GL", "context", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/GeometryBase.js#L579-L610
train
pissang/claygl
dist/claygl.es.js
function (globalEasing) { var self = this; var clipCount = 0; var oneTrackDone = function() { clipCount--; if (clipCount === 0) { self._doneCallback(); } }; var lastClip; for (var propName in this._tracks) { ...
javascript
function (globalEasing) { var self = this; var clipCount = 0; var oneTrackDone = function() { clipCount--; if (clipCount === 0) { self._doneCallback(); } }; var lastClip; for (var propName in this._tracks) { ...
[ "function", "(", "globalEasing", ")", "{", "var", "self", "=", "this", ";", "var", "clipCount", "=", "0", ";", "var", "oneTrackDone", "=", "function", "(", ")", "{", "clipCount", "--", ";", "if", "(", "clipCount", "===", "0", ")", "{", "self", ".", ...
Start the animation @param {string|Function} easing @return {clay.animation.Animator} @memberOf clay.animation.Animator.prototype
[ "Start", "the", "animation" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L1064-L1111
train
pissang/claygl
dist/claygl.es.js
function () { for (var i = 0; i < this._clipList.length; i++) { var clip = this._clipList[i]; this.animation.removeClip(clip); } this._clipList = []; }
javascript
function () { for (var i = 0; i < this._clipList.length; i++) { var clip = this._clipList[i]; this.animation.removeClip(clip); } this._clipList = []; }
[ "function", "(", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "_clipList", ".", "length", ";", "i", "++", ")", "{", "var", "clip", "=", "this", ".", "_clipList", "[", "i", "]", ";", "this", ".", "animation", ".", "r...
Stop the animation @memberOf clay.animation.Animator.prototype
[ "Stop", "the", "animation" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L1117-L1123
train
pissang/claygl
dist/claygl.es.js
vec3lerp
function vec3lerp(out, a, b, t, oa, ob) { var ax = a[oa]; var ay = a[oa + 1]; var az = a[oa + 2]; out[0] = ax + t * (b[ob] - ax); out[1] = ay + t * (b[ob + 1] - ay); out[2] = az + t * (b[ob + 2] - az); return out; }
javascript
function vec3lerp(out, a, b, t, oa, ob) { var ax = a[oa]; var ay = a[oa + 1]; var az = a[oa + 2]; out[0] = ax + t * (b[ob] - ax); out[1] = ay + t * (b[ob + 1] - ay); out[2] = az + t * (b[ob + 2] - az); return out; }
[ "function", "vec3lerp", "(", "out", ",", "a", ",", "b", ",", "t", ",", "oa", ",", "ob", ")", "{", "var", "ax", "=", "a", "[", "oa", "]", ";", "var", "ay", "=", "a", "[", "oa", "+", "1", "]", ";", "var", "az", "=", "a", "[", "oa", "+", ...
Sampler clip is especially for the animation sampler in glTF Use Typed Array can reduce a lot of heap memory lerp function with offset in large array
[ "Sampler", "clip", "is", "especially", "for", "the", "animation", "sampler", "in", "glTF", "Use", "Typed", "Array", "can", "reduce", "a", "lot", "of", "heap", "memory", "lerp", "function", "with", "offset", "in", "large", "array" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5168-L5177
train
pissang/claygl
dist/claygl.es.js
function (opts) { opts = opts || {}; this.name = opts.name || ''; /** * @param {clay.Node} */ this.target = opts.target || null; /** * @type {Array} */ this.position = vec3.create(); /** * Rotation is represented by a quaternion * @type {Array} */ this...
javascript
function (opts) { opts = opts || {}; this.name = opts.name || ''; /** * @param {clay.Node} */ this.target = opts.target || null; /** * @type {Array} */ this.position = vec3.create(); /** * Rotation is represented by a quaternion * @type {Array} */ this...
[ "function", "(", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "this", ".", "name", "=", "opts", ".", "name", "||", "''", ";", "/**\n * @param {clay.Node}\n */", "this", ".", "target", "=", "opts", ".", "target", "||", "null", ";"...
SamplerTrack manages `position`, `rotation`, `scale` tracks in animation of single scene node. @constructor @alias clay.animation.SamplerTrack @param {Object} [opts] @param {string} [opts.name] Track name @param {clay.Node} [opts.target] Target node's transform will updated automatically
[ "SamplerTrack", "manages", "position", "rotation", "scale", "tracks", "in", "animation", "of", "single", "scene", "node", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5229-L5260
train
pissang/claygl
dist/claygl.es.js
derive
function derive(makeDefaultOpt, initialize/*optional*/, proto/*optional*/) { if (typeof initialize == 'object') { proto = initialize; initialize = null; } var _super = this; var propList; if (!(makeDefaultOpt instanceof Function)) { // Optimize the property iterate if it h...
javascript
function derive(makeDefaultOpt, initialize/*optional*/, proto/*optional*/) { if (typeof initialize == 'object') { proto = initialize; initialize = null; } var _super = this; var propList; if (!(makeDefaultOpt instanceof Function)) { // Optimize the property iterate if it h...
[ "function", "derive", "(", "makeDefaultOpt", ",", "initialize", "/*optional*/", ",", "proto", "/*optional*/", ")", "{", "if", "(", "typeof", "initialize", "==", "'object'", ")", "{", "proto", "=", "initialize", ";", "initialize", "=", "null", ";", "}", "var"...
Extend a sub class from base class @param {object|Function} makeDefaultOpt default option of this sub class, method of the sub can use this.xxx to access this option @param {Function} [initialize] Initialize after the sub class is instantiated @param {Object} [proto] Prototype methods/properties of the sub class @membe...
[ "Extend", "a", "sub", "class", "from", "base", "class" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5556-L5623
train
pissang/claygl
dist/claygl.es.js
function(name, action, context) { if (!name || !action) { return; } var handlers = this.__handlers__ || (this.__handlers__={}); if (!handlers[name]) { handlers[name] = []; } else { if (this.has(name, action)) { return; ...
javascript
function(name, action, context) { if (!name || !action) { return; } var handlers = this.__handlers__ || (this.__handlers__={}); if (!handlers[name]) { handlers[name] = []; } else { if (this.has(name, action)) { return; ...
[ "function", "(", "name", ",", "action", ",", "context", ")", "{", "if", "(", "!", "name", "||", "!", "action", ")", "{", "return", ";", "}", "var", "handlers", "=", "this", ".", "__handlers__", "||", "(", "this", ".", "__handlers__", "=", "{", "}",...
Register event handler @param {string} name @param {Function} action @param {Object} [context] @chainable
[ "Register", "event", "handler" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5719-L5736
train
pissang/claygl
dist/claygl.es.js
function(name, action, context) { if (!name || !action) { return; } var self = this; function wrapper() { self.off(name, wrapper); action.apply(this, arguments); } return this.on(name, wrapper, context); }
javascript
function(name, action, context) { if (!name || !action) { return; } var self = this; function wrapper() { self.off(name, wrapper); action.apply(this, arguments); } return this.on(name, wrapper, context); }
[ "function", "(", "name", ",", "action", ",", "context", ")", "{", "if", "(", "!", "name", "||", "!", "action", ")", "{", "return", ";", "}", "var", "self", "=", "this", ";", "function", "wrapper", "(", ")", "{", "self", ".", "off", "(", "name", ...
Register event, event will only be triggered once and then removed @param {string} name @param {Function} action @param {Object} [context] @chainable
[ "Register", "event", "event", "will", "only", "be", "triggered", "once", "and", "then", "removed" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5745-L5755
train
pissang/claygl
dist/claygl.es.js
function(name, action) { var handlers = this.__handlers__; if (! handlers || ! handlers[name]) { return false; } var hdls = handlers[name]; for (var i = 0; i < hdls.length; i++) { if (hdls[i].action === action) { return true; ...
javascript
function(name, action) { var handlers = this.__handlers__; if (! handlers || ! handlers[name]) { return false; } var hdls = handlers[name]; for (var i = 0; i < hdls.length; i++) { if (hdls[i].action === action) { return true; ...
[ "function", "(", "name", ",", "action", ")", "{", "var", "handlers", "=", "this", ".", "__handlers__", ";", "if", "(", "!", "handlers", "||", "!", "handlers", "[", "name", "]", ")", "{", "return", "false", ";", "}", "var", "hdls", "=", "handlers", ...
If registered the event handler @param {string} name @param {Function} action @return {boolean}
[ "If", "registered", "the", "event", "handler" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5841-L5854
train
pissang/claygl
dist/claygl.es.js
function (path, basePath) { if (!basePath || path.match(/^\//)) { return path; } var pathParts = path.split('/'); var basePathParts = basePath.split('/'); var item = pathParts[0]; while(item === '.' || item === '..') { if (item === '..') { ...
javascript
function (path, basePath) { if (!basePath || path.match(/^\//)) { return path; } var pathParts = path.split('/'); var basePathParts = basePath.split('/'); var item = pathParts[0]; while(item === '.' || item === '..') { if (item === '..') { ...
[ "function", "(", "path", ",", "basePath", ")", "{", "if", "(", "!", "basePath", "||", "path", ".", "match", "(", "/", "^\\/", "/", ")", ")", "{", "return", "path", ";", "}", "var", "pathParts", "=", "path", ".", "split", "(", "'/'", ")", ";", "...
Relative path to absolute path @param {string} path @param {string} basePath @return {string} @memberOf clay.core.util
[ "Relative", "path", "to", "absolute", "path" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5883-L5899
train
pissang/claygl
dist/claygl.es.js
function (target, source) { if (source) { for (var propName in source) { if (target[propName] === undefined) { target[propName] = source[propName]; } } } return target; }
javascript
function (target, source) { if (source) { for (var propName in source) { if (target[propName] === undefined) { target[propName] = source[propName]; } } } return target; }
[ "function", "(", "target", ",", "source", ")", "{", "if", "(", "source", ")", "{", "for", "(", "var", "propName", "in", "source", ")", "{", "if", "(", "target", "[", "propName", "]", "===", "undefined", ")", "{", "target", "[", "propName", "]", "="...
Extend properties to target if not exist. @param {Object} target @param {Object} source @return {Object} @memberOf clay.core.util
[ "Extend", "properties", "to", "target", "if", "not", "exist", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L5926-L5935
train
pissang/claygl
dist/claygl.es.js
function () { var self = this; this._running = true; this._time = Date.now(); this._pausedTime = 0; var requestAnimationFrame = vendor.requestAnimationFrame; function step() { if (self._running) { requestAnimationFrame(step); ...
javascript
function () { var self = this; this._running = true; this._time = Date.now(); this._pausedTime = 0; var requestAnimationFrame = vendor.requestAnimationFrame; function step() { if (self._running) { requestAnimationFrame(step); ...
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "this", ".", "_running", "=", "true", ";", "this", ".", "_time", "=", "Date", ".", "now", "(", ")", ";", "this", ".", "_pausedTime", "=", "0", ";", "var", "requestAnimationFrame", "=", "ve...
Start running animation
[ "Start", "running", "animation" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L6330-L6353
train
pissang/claygl
dist/claygl.es.js
function (target, options) { options = options || {}; var animator = new Animator( target, options.loop, options.getter, options.setter, options.interpolater ); animator.animation = this; return animator; }
javascript
function (target, options) { options = options || {}; var animator = new Animator( target, options.loop, options.getter, options.setter, options.interpolater ); animator.animation = this; return animator; }
[ "function", "(", "target", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "var", "animator", "=", "new", "Animator", "(", "target", ",", "options", ".", "loop", ",", "options", ".", "getter", ",", "options", ".", "setter", ...
Create an animator @param {Object} target @param {Object} [options] @param {boolean} [options.loop] @param {Function} [options.getter] @param {Function} [options.setter] @param {Function} [options.interpolater] @return {clay.animation.Animator}
[ "Create", "an", "animator" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L6397-L6408
train
pissang/claygl
dist/claygl.es.js
function (symbol, value) { if (value === undefined) { console.warn('Uniform value "' + symbol + '" is undefined'); } var uniform = this.uniforms[symbol]; if (uniform) { if (typeof value === 'string') { // Try to parse as a color. Invalid color str...
javascript
function (symbol, value) { if (value === undefined) { console.warn('Uniform value "' + symbol + '" is undefined'); } var uniform = this.uniforms[symbol]; if (uniform) { if (typeof value === 'string') { // Try to parse as a color. Invalid color str...
[ "function", "(", "symbol", ",", "value", ")", "{", "if", "(", "value", "===", "undefined", ")", "{", "console", ".", "warn", "(", "'Uniform value \"'", "+", "symbol", "+", "'\" is undefined'", ")", ";", "}", "var", "uniform", "=", "this", ".", "uniforms"...
Set material uniform @example mat.setUniform('color', [1, 1, 1, 1]); @param {string} symbol @param {number|array|clay.Texture|ArrayBufferView} value
[ "Set", "material", "uniform" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L8133-L8156
train
pissang/claygl
dist/claygl.es.js
function (symbol, value) { if (typeof(symbol) === 'object') { for (var key in symbol) { var val = symbol[key]; this.setUniform(key, val); } } else { this.setUniform(symbol, value); } }
javascript
function (symbol, value) { if (typeof(symbol) === 'object') { for (var key in symbol) { var val = symbol[key]; this.setUniform(key, val); } } else { this.setUniform(symbol, value); } }
[ "function", "(", "symbol", ",", "value", ")", "{", "if", "(", "typeof", "(", "symbol", ")", "===", "'object'", ")", "{", "for", "(", "var", "key", "in", "symbol", ")", "{", "var", "val", "=", "symbol", "[", "key", "]", ";", "this", ".", "setUnifo...
Alias of setUniform and setUniforms @param {object|string} symbol @param {number|array|clay.Texture|ArrayBufferView} [value]
[ "Alias", "of", "setUniform", "and", "setUniforms" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L8188-L8198
train
pissang/claygl
dist/claygl.es.js
function(shader, keepStatus) { var originalUniforms = this.uniforms; // Ignore if uniform can use in shader. this.uniforms = shader.createUniforms(); this.shader = shader; var uniforms = this.uniforms; this._enabledUniforms = Object.keys(uniforms); // Make sure ...
javascript
function(shader, keepStatus) { var originalUniforms = this.uniforms; // Ignore if uniform can use in shader. this.uniforms = shader.createUniforms(); this.shader = shader; var uniforms = this.uniforms; this._enabledUniforms = Object.keys(uniforms); // Make sure ...
[ "function", "(", "shader", ",", "keepStatus", ")", "{", "var", "originalUniforms", "=", "this", ".", "uniforms", ";", "// Ignore if uniform can use in shader.", "this", ".", "uniforms", "=", "shader", ".", "createUniforms", "(", ")", ";", "this", ".", "shader", ...
Attach a shader instance @param {clay.Shader} shader @param {boolean} keepStatus If try to keep uniform and texture
[ "Attach", "a", "shader", "instance" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L8215-L8260
train
pissang/claygl
dist/claygl.es.js
function () { var material = new this.constructor({ name: this.name, shader: this.shader }); for (var symbol in this.uniforms) { material.uniforms[symbol].value = this.uniforms[symbol].value; } material.depthTest = this.depthTest; mater...
javascript
function () { var material = new this.constructor({ name: this.name, shader: this.shader }); for (var symbol in this.uniforms) { material.uniforms[symbol].value = this.uniforms[symbol].value; } material.depthTest = this.depthTest; mater...
[ "function", "(", ")", "{", "var", "material", "=", "new", "this", ".", "constructor", "(", "{", "name", ":", "this", ".", "name", ",", "shader", ":", "this", ".", "shader", "}", ")", ";", "for", "(", "var", "symbol", "in", "this", ".", "uniforms", ...
Clone a new material and keep uniforms, shader will not be cloned @return {clay.Material}
[ "Clone", "a", "new", "material", "and", "keep", "uniforms", "shader", "will", "not", "be", "cloned" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L8266-L8285
train
pissang/claygl
dist/claygl.es.js
function () { var enabledTextures = []; var textureStatus = this._textureStatus; for (var symbol in textureStatus) { if (textureStatus[symbol].enabled) { enabledTextures.push(symbol); } } return enabledTextures; }
javascript
function () { var enabledTextures = []; var textureStatus = this._textureStatus; for (var symbol in textureStatus) { if (textureStatus[symbol].enabled) { enabledTextures.push(symbol); } } return enabledTextures; }
[ "function", "(", ")", "{", "var", "enabledTextures", "=", "[", "]", ";", "var", "textureStatus", "=", "this", ".", "_textureStatus", ";", "for", "(", "var", "symbol", "in", "textureStatus", ")", "{", "if", "(", "textureStatus", "[", "symbol", "]", ".", ...
Get all enabled textures @return {string[]}
[ "Get", "all", "enabled", "textures" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L8459-L8468
train
pissang/claygl
dist/claygl.es.js
checkShaderErrorMsg
function checkShaderErrorMsg(_gl, shader, shaderString) { if (!_gl.getShaderParameter(shader, _gl.COMPILE_STATUS)) { return [_gl.getShaderInfoLog(shader), addLineNumbers(shaderString)].join('\n'); } }
javascript
function checkShaderErrorMsg(_gl, shader, shaderString) { if (!_gl.getShaderParameter(shader, _gl.COMPILE_STATUS)) { return [_gl.getShaderInfoLog(shader), addLineNumbers(shaderString)].join('\n'); } }
[ "function", "checkShaderErrorMsg", "(", "_gl", ",", "shader", ",", "shaderString", ")", "{", "if", "(", "!", "_gl", ".", "getShaderParameter", "(", "shader", ",", "_gl", ".", "COMPILE_STATUS", ")", ")", "{", "return", "[", "_gl", ".", "getShaderInfoLog", "...
Return true or error msg if error happened
[ "Return", "true", "or", "error", "msg", "if", "error", "happened" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L8508-L8512
train
pissang/claygl
dist/claygl.es.js
function () { var uniforms = {}; for (var symbol in this.uniformTemplates){ var uniformTpl = this.uniformTemplates[symbol]; uniforms[symbol] = { type: uniformTpl.type, value: uniformTpl.value() }; } return uniforms; ...
javascript
function () { var uniforms = {}; for (var symbol in this.uniformTemplates){ var uniformTpl = this.uniformTemplates[symbol]; uniforms[symbol] = { type: uniformTpl.type, value: uniformTpl.value() }; } return uniforms; ...
[ "function", "(", ")", "{", "var", "uniforms", "=", "{", "}", ";", "for", "(", "var", "symbol", "in", "this", ".", "uniformTemplates", ")", "{", "var", "uniformTpl", "=", "this", ".", "uniformTemplates", "[", "symbol", "]", ";", "uniforms", "[", "symbol...
Create a new uniform instance for material
[ "Create", "a", "new", "uniform", "instance", "for", "material" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L9386-L9398
train
pissang/claygl
dist/claygl.es.js
function () { var code = shaderCodeCache[this._shaderID]; var shader = new Shader(code.vertex, code.fragment); return shader; }
javascript
function () { var code = shaderCodeCache[this._shaderID]; var shader = new Shader(code.vertex, code.fragment); return shader; }
[ "function", "(", ")", "{", "var", "code", "=", "shaderCodeCache", "[", "this", ".", "_shaderID", "]", ";", "var", "shader", "=", "new", "Shader", "(", "code", ".", "vertex", ",", "code", ".", "fragment", ")", ";", "return", "shader", ";", "}" ]
Clone a new shader @return {clay.Shader}
[ "Clone", "a", "new", "shader" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L9577-L9581
train
pissang/claygl
dist/claygl.es.js
function () { if (this._clearStack.length > 0) { var opt = this._clearStack.pop(); this.clearColor = opt.clearColor; this.clearBit = opt.clearBit; } }
javascript
function () { if (this._clearStack.length > 0) { var opt = this._clearStack.pop(); this.clearColor = opt.clearColor; this.clearBit = opt.clearBit; } }
[ "function", "(", ")", "{", "if", "(", "this", ".", "_clearStack", ".", "length", ">", "0", ")", "{", "var", "opt", "=", "this", ".", "_clearStack", ".", "pop", "(", ")", ";", "this", ".", "clearColor", "=", "opt", ".", "clearColor", ";", "this", ...
Pop clear from stack, restore in the renderer
[ "Pop", "clear", "from", "stack", "restore", "in", "the", "renderer" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L11011-L11017
train
pissang/claygl
dist/claygl.es.js
function(root, disposeGeometry, disposeTexture) { // Dettached from parent if (root.getParent()) { root.getParent().remove(root); } var disposedMap = {}; root.traverse(function(node) { var material = node.material; if (node.geometry && disposeG...
javascript
function(root, disposeGeometry, disposeTexture) { // Dettached from parent if (root.getParent()) { root.getParent().remove(root); } var disposedMap = {}; root.traverse(function(node) { var material = node.material; if (node.geometry && disposeG...
[ "function", "(", "root", ",", "disposeGeometry", ",", "disposeTexture", ")", "{", "// Dettached from parent", "if", "(", "root", ".", "getParent", "(", ")", ")", "{", "root", ".", "getParent", "(", ")", ".", "remove", "(", "root", ")", ";", "}", "var", ...
Dispose given node, including all geometries, textures and shaders attached on it or its descendant @param {clay.Node} node @param {boolean} [disposeGeometry=false] If dispose the geometries used in the descendant mesh @param {boolean} [disposeTexture=false] If dispose the textures used in the descendant mesh
[ "Dispose", "given", "node", "including", "all", "geometries", "textures", "and", "shaders", "attached", "on", "it", "or", "its", "descendant" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L11816-L11854
train
pissang/claygl
dist/claygl.es.js
function (m) { var v = this.array; m = m.array; // Perspective projection if (m[15] === 0) { var w = -1 / v[2]; v[0] = m[0] * v[0] * w; v[1] = m[5] * v[1] * w; v[2] = (m[10] * v[2] + m[14]) * w; } else { v[0] = ...
javascript
function (m) { var v = this.array; m = m.array; // Perspective projection if (m[15] === 0) { var w = -1 / v[2]; v[0] = m[0] * v[0] * w; v[1] = m[5] * v[1] * w; v[2] = (m[10] * v[2] + m[14]) * w; } else { v[0] = ...
[ "function", "(", "m", ")", "{", "var", "v", "=", "this", ".", "array", ";", "m", "=", "m", ".", "array", ";", "// Perspective projection", "if", "(", "m", "[", "15", "]", "===", "0", ")", "{", "var", "w", "=", "-", "1", "/", "v", "[", "2", ...
Trasnform self into projection space with m @param {clay.Matrix4} m @return {clay.Vector3}
[ "Trasnform", "self", "into", "projection", "space", "with", "m" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L12390-L12409
train
pissang/claygl
dist/claygl.es.js
function (x, y, z, w) { this.array[0] = x; this.array[1] = y; this.array[2] = z; this.array[3] = w; this._dirty = true; return this; }
javascript
function (x, y, z, w) { this.array[0] = x; this.array[1] = y; this.array[2] = z; this.array[3] = w; this._dirty = true; return this; }
[ "function", "(", "x", ",", "y", ",", "z", ",", "w", ")", "{", "this", ".", "array", "[", "0", "]", "=", "x", ";", "this", ".", "array", "[", "1", "]", "=", "y", ";", "this", ".", "array", "[", "2", "]", "=", "z", ";", "this", ".", "arra...
Set x, y and z components @param {number} x @param {number} y @param {number} z @param {number} w @return {clay.Quaternion}
[ "Set", "x", "y", "and", "z", "components" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L13079-L13086
train
pissang/claygl
dist/claygl.es.js
function (arr) { this.array[0] = arr[0]; this.array[1] = arr[1]; this.array[2] = arr[2]; this.array[3] = arr[3]; this._dirty = true; return this; }
javascript
function (arr) { this.array[0] = arr[0]; this.array[1] = arr[1]; this.array[2] = arr[2]; this.array[3] = arr[3]; this._dirty = true; return this; }
[ "function", "(", "arr", ")", "{", "this", ".", "array", "[", "0", "]", "=", "arr", "[", "0", "]", ";", "this", ".", "array", "[", "1", "]", "=", "arr", "[", "1", "]", ";", "this", ".", "array", "[", "2", "]", "=", "arr", "[", "2", "]", ...
Set x, y, z and w components from array @param {Float32Array|number[]} arr @return {clay.Quaternion}
[ "Set", "x", "y", "z", "and", "w", "components", "from", "array" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L13093-L13101
train
pissang/claygl
dist/claygl.es.js
function (view, right, up) { quat.setAxes(this.array, view.array, right.array, up.array); this._dirty = true; return this; }
javascript
function (view, right, up) { quat.setAxes(this.array, view.array, right.array, up.array); this._dirty = true; return this; }
[ "function", "(", "view", ",", "right", ",", "up", ")", "{", "quat", ".", "setAxes", "(", "this", ".", "array", ",", "view", ".", "array", ",", "right", ".", "array", ",", "up", ".", "array", ")", ";", "this", ".", "_dirty", "=", "true", ";", "r...
Sets self with values corresponding to the given axes @param {clay.Vector3} view @param {clay.Vector3} right @param {clay.Vector3} up @return {clay.Quaternion}
[ "Sets", "self", "with", "values", "corresponding", "to", "the", "given", "axes" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L13326-L13330
train
pissang/claygl
dist/claygl.es.js
function (arr) { for (var i = 0; i < this.array.length; i++) { this.array[i] = arr[i]; } this._dirty = true; return this; }
javascript
function (arr) { for (var i = 0; i < this.array.length; i++) { this.array[i] = arr[i]; } this._dirty = true; return this; }
[ "function", "(", "arr", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "array", ".", "length", ";", "i", "++", ")", "{", "this", ".", "array", "[", "i", "]", "=", "arr", "[", "i", "]", ";", "}", "this", ".", "_dir...
Set components from array @param {Float32Array|number[]} arr
[ "Set", "components", "from", "array" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L13816-L13822
train
pissang/claygl
dist/claygl.es.js
function(q, v) { mat4.fromRotationTranslation(this.array, q.array, v.array); this._dirty = true; return this; }
javascript
function(q, v) { mat4.fromRotationTranslation(this.array, q.array, v.array); this._dirty = true; return this; }
[ "function", "(", "q", ",", "v", ")", "{", "mat4", ".", "fromRotationTranslation", "(", "this", ".", "array", ",", "q", ".", "array", ",", "v", ".", "array", ")", ";", "this", ".", "_dirty", "=", "true", ";", "return", "this", ";", "}" ]
Set from a quaternion rotation and a vector translation @param {clay.Quaternion} q @param {clay.Vector3} v @return {clay.Matrix4}
[ "Set", "from", "a", "quaternion", "rotation", "and", "a", "vector", "translation" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L13877-L13881
train
pissang/claygl
dist/claygl.es.js
function(rad, axis) { mat4.rotate(this.array, this.array, rad, axis.array); this._dirty = true; return this; }
javascript
function(rad, axis) { mat4.rotate(this.array, this.array, rad, axis.array); this._dirty = true; return this; }
[ "function", "(", "rad", ",", "axis", ")", "{", "mat4", ".", "rotate", "(", "this", ".", "array", ",", "this", ".", "array", ",", "rad", ",", "axis", ".", "array", ")", ";", "this", ".", "_dirty", "=", "true", ";", "return", "this", ";", "}" ]
Rotate self by rad about axis. Equal to right-multiply a rotaion matrix @param {number} rad @param {clay.Vector3} axis @return {clay.Matrix4}
[ "Rotate", "self", "by", "rad", "about", "axis", ".", "Equal", "to", "right", "-", "multiply", "a", "rotaion", "matrix" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14023-L14027
train
pissang/claygl
dist/claygl.es.js
function (min, max) { /** * Minimum coords of bounding box * @type {clay.Vector3} */ this.min = min || new Vector3(Infinity, Infinity, Infinity); /** * Maximum coords of bounding box * @type {clay.Vector3} */ this.max = max || new Vector3(-Infinity, -Infinity, -Infinity);...
javascript
function (min, max) { /** * Minimum coords of bounding box * @type {clay.Vector3} */ this.min = min || new Vector3(Infinity, Infinity, Infinity); /** * Maximum coords of bounding box * @type {clay.Vector3} */ this.max = max || new Vector3(-Infinity, -Infinity, -Infinity);...
[ "function", "(", "min", ",", "max", ")", "{", "/**\n * Minimum coords of bounding box\n * @type {clay.Vector3}\n */", "this", ".", "min", "=", "min", "||", "new", "Vector3", "(", "Infinity", ",", "Infinity", ",", "Infinity", ")", ";", "/**\n * Maximum ...
Axis aligned bounding box @constructor @alias clay.BoundingBox @param {clay.Vector3} [min] @param {clay.Vector3} [max]
[ "Axis", "aligned", "bounding", "box" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14504-L14519
train
pissang/claygl
dist/claygl.es.js
function (vertices) { if (vertices.length > 0) { var min = this.min; var max = this.max; var minArr = min.array; var maxArr = max.array; vec3Copy(minArr, vertices[0]); vec3Copy(maxArr, vertices[0]); for (var i = 1; i < vertices....
javascript
function (vertices) { if (vertices.length > 0) { var min = this.min; var max = this.max; var minArr = min.array; var maxArr = max.array; vec3Copy(minArr, vertices[0]); vec3Copy(maxArr, vertices[0]); for (var i = 1; i < vertices....
[ "function", "(", "vertices", ")", "{", "if", "(", "vertices", ".", "length", ">", "0", ")", "{", "var", "min", "=", "this", ".", "min", ";", "var", "max", "=", "this", ".", "max", ";", "var", "minArr", "=", "min", ".", "array", ";", "var", "max...
Update min and max coords from a vertices array @param {array} vertices
[ "Update", "min", "and", "max", "coords", "from", "a", "vertices", "array" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14528-L14550
train
pissang/claygl
dist/claygl.es.js
function (bbox) { var min = this.min; var max = this.max; vec3.min(min.array, min.array, bbox.min.array); vec3.max(max.array, max.array, bbox.max.array); min._dirty = true; max._dirty = true; return this; }
javascript
function (bbox) { var min = this.min; var max = this.max; vec3.min(min.array, min.array, bbox.min.array); vec3.max(max.array, max.array, bbox.max.array); min._dirty = true; max._dirty = true; return this; }
[ "function", "(", "bbox", ")", "{", "var", "min", "=", "this", ".", "min", ";", "var", "max", "=", "this", ".", "max", ";", "vec3", ".", "min", "(", "min", ".", "array", ",", "min", ".", "array", ",", "bbox", ".", "min", ".", "array", ")", ";"...
Union operation with another bounding box @param {clay.BoundingBox} bbox
[ "Union", "operation", "with", "another", "bounding", "box" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14556-L14564
train
pissang/claygl
dist/claygl.es.js
function (bbox) { var _min = this.min.array; var _max = this.max.array; var _min2 = bbox.min.array; var _max2 = bbox.max.array; return ! (_min[0] > _max2[0] || _min[1] > _max2[1] || _min[2] > _max2[2] || _max[0] < _min2[0] || _max[1] < _min2[1] || _max[2] < _min2[2]...
javascript
function (bbox) { var _min = this.min.array; var _max = this.max.array; var _min2 = bbox.min.array; var _max2 = bbox.max.array; return ! (_min[0] > _max2[0] || _min[1] > _max2[1] || _min[2] > _max2[2] || _max[0] < _min2[0] || _max[1] < _min2[1] || _max[2] < _min2[2]...
[ "function", "(", "bbox", ")", "{", "var", "_min", "=", "this", ".", "min", ".", "array", ";", "var", "_max", "=", "this", ".", "max", ".", "array", ";", "var", "_min2", "=", "bbox", ".", "min", ".", "array", ";", "var", "_max2", "=", "bbox", "....
If intersect with another bounding box @param {clay.BoundingBox} bbox @return {boolean}
[ "If", "intersect", "with", "another", "bounding", "box" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14585-L14594
train
pissang/claygl
dist/claygl.es.js
function (p) { var _min = this.min.array; var _max = this.max.array; var _p = p.array; return _min[0] <= _p[0] && _min[1] <= _p[1] && _min[2] <= _p[2] && _max[0] >= _p[0] && _max[1] >= _p[1] && _max[2] >= _p[2]; }
javascript
function (p) { var _min = this.min.array; var _max = this.max.array; var _p = p.array; return _min[0] <= _p[0] && _min[1] <= _p[1] && _min[2] <= _p[2] && _max[0] >= _p[0] && _max[1] >= _p[1] && _max[2] >= _p[2]; }
[ "function", "(", "p", ")", "{", "var", "_min", "=", "this", ".", "min", ".", "array", ";", "var", "_max", "=", "this", ".", "max", ".", "array", ";", "var", "_p", "=", "p", ".", "array", ";", "return", "_min", "[", "0", "]", "<=", "_p", "[", ...
If contain point entirely @param {clay.Vector3} point @return {boolean}
[ "If", "contain", "point", "entirely" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14618-L14626
train
pissang/claygl
dist/claygl.es.js
function () { var _min = this.min.array; var _max = this.max.array; return isFinite(_min[0]) && isFinite(_min[1]) && isFinite(_min[2]) && isFinite(_max[0]) && isFinite(_max[1]) && isFinite(_max[2]); }
javascript
function () { var _min = this.min.array; var _max = this.max.array; return isFinite(_min[0]) && isFinite(_min[1]) && isFinite(_min[2]) && isFinite(_max[0]) && isFinite(_max[1]) && isFinite(_max[2]); }
[ "function", "(", ")", "{", "var", "_min", "=", "this", ".", "min", ".", "array", ";", "var", "_max", "=", "this", ".", "max", ".", "array", ";", "return", "isFinite", "(", "_min", "[", "0", "]", ")", "&&", "isFinite", "(", "_min", "[", "1", "]"...
If bounding box is finite
[ "If", "bounding", "box", "is", "finite" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14631-L14636
train
pissang/claygl
dist/claygl.es.js
function (matrix) { var min = this.min.array; var max = this.max.array; var m = matrix.array; // min in min z var v10 = min[0]; var v11 = min[1]; var v12 = min[2]; // max in min z var v20 = max[0]; var v21 = max[1]; var v22 = min[2...
javascript
function (matrix) { var min = this.min.array; var max = this.max.array; var m = matrix.array; // min in min z var v10 = min[0]; var v11 = min[1]; var v12 = min[2]; // max in min z var v20 = max[0]; var v21 = max[1]; var v22 = min[2...
[ "function", "(", "matrix", ")", "{", "var", "min", "=", "this", ".", "min", ".", "array", ";", "var", "max", "=", "this", ".", "max", ".", "array", ";", "var", "m", "=", "matrix", ".", "array", ";", "// min in min z", "var", "v10", "=", "min", "[...
Apply a projection matrix to the bounding box @param {clay.Matrix4} matrix
[ "Apply", "a", "projection", "matrix", "to", "the", "bounding", "box" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14696-L14740
train
pissang/claygl
dist/claygl.es.js
function (bbox) { var min = this.min; var max = this.max; vec3Copy(min.array, bbox.min.array); vec3Copy(max.array, bbox.max.array); min._dirty = true; max._dirty = true; return this; }
javascript
function (bbox) { var min = this.min; var max = this.max; vec3Copy(min.array, bbox.min.array); vec3Copy(max.array, bbox.max.array); min._dirty = true; max._dirty = true; return this; }
[ "function", "(", "bbox", ")", "{", "var", "min", "=", "this", ".", "min", ";", "var", "max", "=", "this", ".", "max", ";", "vec3Copy", "(", "min", ".", "array", ",", "bbox", ".", "min", ".", "array", ")", ";", "vec3Copy", "(", "max", ".", "arra...
Copy values from another bounding box @param {clay.BoundingBox} bbox
[ "Copy", "values", "from", "another", "bounding", "box" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14779-L14787
train
pissang/claygl
dist/claygl.es.js
function (name) { var scene = this._scene; if (scene) { var nodeRepository = scene._nodeRepository; delete nodeRepository[this.name]; nodeRepository[name] = this; } this.name = name; }
javascript
function (name) { var scene = this._scene; if (scene) { var nodeRepository = scene._nodeRepository; delete nodeRepository[this.name]; nodeRepository[name] = this; } this.name = name; }
[ "function", "(", "name", ")", "{", "var", "scene", "=", "this", ".", "_scene", ";", "if", "(", "scene", ")", "{", "var", "nodeRepository", "=", "scene", ".", "_nodeRepository", ";", "delete", "nodeRepository", "[", "this", ".", "name", "]", ";", "nodeR...
Set the name of the scene node @param {string} name
[ "Set", "the", "name", "of", "the", "scene", "node" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14932-L14940
train
pissang/claygl
dist/claygl.es.js
function (node) { var originalParent = node._parent; if (originalParent === this) { return; } if (originalParent) { originalParent.remove(node); } node._parent = this; this._children.push(node); var scene = this._scene; if ...
javascript
function (node) { var originalParent = node._parent; if (originalParent === this) { return; } if (originalParent) { originalParent.remove(node); } node._parent = this; this._children.push(node); var scene = this._scene; if ...
[ "function", "(", "node", ")", "{", "var", "originalParent", "=", "node", ".", "_parent", ";", "if", "(", "originalParent", "===", "this", ")", "{", "return", ";", "}", "if", "(", "originalParent", ")", "{", "originalParent", ".", "remove", "(", "node", ...
Add a child node @param {clay.Node} node
[ "Add", "a", "child", "node" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14946-L14964
train
pissang/claygl
dist/claygl.es.js
function (node) { var children = this._children; var idx = children.indexOf(node); if (idx < 0) { return; } children.splice(idx, 1); node._parent = null; if (this._scene) { node.traverse(this._removeSelfFromScene, this); } }
javascript
function (node) { var children = this._children; var idx = children.indexOf(node); if (idx < 0) { return; } children.splice(idx, 1); node._parent = null; if (this._scene) { node.traverse(this._removeSelfFromScene, this); } }
[ "function", "(", "node", ")", "{", "var", "children", "=", "this", ".", "_children", ";", "var", "idx", "=", "children", ".", "indexOf", "(", "node", ")", ";", "if", "(", "idx", "<", "0", ")", "{", "return", ";", "}", "children", ".", "splice", "...
Remove the given child scene node @param {clay.Node} node
[ "Remove", "the", "given", "child", "scene", "node" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14970-L14983
train
pissang/claygl
dist/claygl.es.js
function () { var children = this._children; for (var idx = 0; idx < children.length; idx++) { children[idx]._parent = null; if (this._scene) { children[idx].traverse(this._removeSelfFromScene, this); } } this._children = []; }
javascript
function () { var children = this._children; for (var idx = 0; idx < children.length; idx++) { children[idx]._parent = null; if (this._scene) { children[idx].traverse(this._removeSelfFromScene, this); } } this._children = []; }
[ "function", "(", ")", "{", "var", "children", "=", "this", ".", "_children", ";", "for", "(", "var", "idx", "=", "0", ";", "idx", "<", "children", ".", "length", ";", "idx", "++", ")", "{", "children", "[", "idx", "]", ".", "_parent", "=", "null"...
Remove all children
[ "Remove", "all", "children" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L14988-L15000
train
pissang/claygl
dist/claygl.es.js
function (node) { var parent = node._parent; while(parent) { if (parent === this) { return true; } parent = parent._parent; } return false; }
javascript
function (node) { var parent = node._parent; while(parent) { if (parent === this) { return true; } parent = parent._parent; } return false; }
[ "function", "(", "node", ")", "{", "var", "parent", "=", "node", ".", "_parent", ";", "while", "(", "parent", ")", "{", "if", "(", "parent", "===", "this", ")", "{", "return", "true", ";", "}", "parent", "=", "parent", ".", "_parent", ";", "}", "...
Return true if it is ancestor of the given scene node @param {clay.Node} node
[ "Return", "true", "if", "it", "is", "ancestor", "of", "the", "given", "scene", "node" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15032-L15041
train
pissang/claygl
dist/claygl.es.js
function (name) { var children = this._children; for (var i = 0; i < children.length; i++) { if (children[i].name === name) { return children[i]; } } }
javascript
function (name) { var children = this._children; for (var i = 0; i < children.length; i++) { if (children[i].name === name) { return children[i]; } } }
[ "function", "(", "name", ")", "{", "var", "children", "=", "this", ".", "_children", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "children", "[", "i", "]", ".", "name", ...
Get first child with the given name @param {string} name @return {clay.Node}
[ "Get", "first", "child", "with", "the", "given", "name" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15065-L15072
train
pissang/claygl
dist/claygl.es.js
function (name) { var children = this._children; for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.name === name) { return child; } else { var res = child.getDescendantByName(name); if (res) ...
javascript
function (name) { var children = this._children; for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.name === name) { return child; } else { var res = child.getDescendantByName(name); if (res) ...
[ "function", "(", "name", ")", "{", "var", "children", "=", "this", ".", "_children", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "var", "child", "=", "children", "[", "i", "]", ";",...
Get first descendant have the given name @param {string} name @return {clay.Node}
[ "Get", "first", "descendant", "have", "the", "given", "name" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15079-L15092
train
pissang/claygl
dist/claygl.es.js
function (path) { if (!path) { return; } // TODO Name have slash ? var pathArr = path.split('/'); var current = this; for (var i = 0; i < pathArr.length; i++) { var name = pathArr[i]; // Skip empty if (!name) { ...
javascript
function (path) { if (!path) { return; } // TODO Name have slash ? var pathArr = path.split('/'); var current = this; for (var i = 0; i < pathArr.length; i++) { var name = pathArr[i]; // Skip empty if (!name) { ...
[ "function", "(", "path", ")", "{", "if", "(", "!", "path", ")", "{", "return", ";", "}", "// TODO Name have slash ?", "var", "pathArr", "=", "path", ".", "split", "(", "'/'", ")", ";", "var", "current", "=", "this", ";", "for", "(", "var", "i", "="...
Query descendant node by path @param {string} path @return {clay.Node} @example node.queryNode('root/parent/child');
[ "Query", "descendant", "node", "by", "path" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15101-L15131
train
pissang/claygl
dist/claygl.es.js
function (callback, context) { callback.call(context, this); var _children = this._children; for(var i = 0, len = _children.length; i < len; i++) { _children[i].traverse(callback, context); } }
javascript
function (callback, context) { callback.call(context, this); var _children = this._children; for(var i = 0, len = _children.length; i < len; i++) { _children[i].traverse(callback, context); } }
[ "function", "(", "callback", ",", "context", ")", "{", "callback", ".", "call", "(", "context", ",", "this", ")", ";", "var", "_children", "=", "this", ".", "_children", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "_children", ".", "len...
Depth first traverse all its descendant scene nodes. **WARN** Don't do `add`, `remove` operation in the callback during traverse. @param {Function} callback @param {Node} [context]
[ "Depth", "first", "traverse", "all", "its", "descendant", "scene", "nodes", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15165-L15171
train
pissang/claygl
dist/claygl.es.js
function (callback, context) { var _children = this._children; for(var i = 0, len = _children.length; i < len; i++) { var child = _children[i]; callback.call(context, child, i); } }
javascript
function (callback, context) { var _children = this._children; for(var i = 0, len = _children.length; i < len; i++) { var child = _children[i]; callback.call(context, child, i); } }
[ "function", "(", "callback", ",", "context", ")", "{", "var", "_children", "=", "this", ".", "_children", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "_children", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", ...
Traverse all children nodes. **WARN** DON'T do `add`, `remove` operation in the callback during iteration. @param {Function} callback @param {Node} [context]
[ "Traverse", "all", "children", "nodes", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15181-L15187
train
pissang/claygl
dist/claygl.es.js
function (keepScale) { var scale = !keepScale ? this.scale: null; this.localTransform.decomposeMatrix(scale, this.rotation, this.position); }
javascript
function (keepScale) { var scale = !keepScale ? this.scale: null; this.localTransform.decomposeMatrix(scale, this.rotation, this.position); }
[ "function", "(", "keepScale", ")", "{", "var", "scale", "=", "!", "keepScale", "?", "this", ".", "scale", ":", "null", ";", "this", ".", "localTransform", ".", "decomposeMatrix", "(", "scale", ",", "this", ".", "rotation", ",", "this", ".", "position", ...
Decompose the local transform to SRT
[ "Decompose", "the", "local", "transform", "to", "SRT" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15201-L15204
train
pissang/claygl
dist/claygl.es.js
function () { var position = this.position; var rotation = this.rotation; var scale = this.scale; if (this.transformNeedsUpdate()) { var m = this.localTransform.array; // Transform order, scale->rotation->position mat4.fromRotationTranslation(m, rota...
javascript
function () { var position = this.position; var rotation = this.rotation; var scale = this.scale; if (this.transformNeedsUpdate()) { var m = this.localTransform.array; // Transform order, scale->rotation->position mat4.fromRotationTranslation(m, rota...
[ "function", "(", ")", "{", "var", "position", "=", "this", ".", "position", ";", "var", "rotation", "=", "this", ".", "rotation", ";", "var", "scale", "=", "this", ".", "scale", ";", "if", "(", "this", ".", "transformNeedsUpdate", "(", ")", ")", "{",...
Update local transform from SRT Notice that local transform will not be updated if _dirty mark of position, rotation, scale is all false
[ "Update", "local", "transform", "from", "SRT", "Notice", "that", "local", "transform", "will", "not", "be", "updated", "if", "_dirty", "mark", "of", "position", "rotation", "scale", "is", "all", "false" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15248-L15267
train
pissang/claygl
dist/claygl.es.js
function () { var localTransform = this.localTransform.array; var worldTransform = this.worldTransform.array; if (this._parent) { mat4.multiplyAffine( worldTransform, this._parent.worldTransform.array, localTransform ); ...
javascript
function () { var localTransform = this.localTransform.array; var worldTransform = this.worldTransform.array; if (this._parent) { mat4.multiplyAffine( worldTransform, this._parent.worldTransform.array, localTransform ); ...
[ "function", "(", ")", "{", "var", "localTransform", "=", "this", ".", "localTransform", ".", "array", ";", "var", "worldTransform", "=", "this", ".", "worldTransform", ".", "array", ";", "if", "(", "this", ".", "_parent", ")", "{", "mat4", ".", "multiply...
Update world transform, assume its parent world transform have been updated @private
[ "Update", "world", "transform", "assume", "its", "parent", "world", "transform", "have", "been", "updated" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15273-L15286
train
pissang/claygl
dist/claygl.es.js
function () { // Find the root node which transform needs update; var rootNodeIsDirty = this; while (rootNodeIsDirty && rootNodeIsDirty.getParent() && rootNodeIsDirty.getParent().transformNeedsUpdate() ) { rootNodeIsDirty = rootNodeIsDirty.getParent(); } ...
javascript
function () { // Find the root node which transform needs update; var rootNodeIsDirty = this; while (rootNodeIsDirty && rootNodeIsDirty.getParent() && rootNodeIsDirty.getParent().transformNeedsUpdate() ) { rootNodeIsDirty = rootNodeIsDirty.getParent(); } ...
[ "function", "(", ")", "{", "// Find the root node which transform needs update;", "var", "rootNodeIsDirty", "=", "this", ";", "while", "(", "rootNodeIsDirty", "&&", "rootNodeIsDirty", ".", "getParent", "(", ")", "&&", "rootNodeIsDirty", ".", "getParent", "(", ")", "...
Update world transform before whole scene is updated.
[ "Update", "world", "transform", "before", "whole", "scene", "is", "updated", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15291-L15300
train
pissang/claygl
dist/claygl.es.js
function (forceUpdateWorld) { if (this.autoUpdateLocalTransform) { this.updateLocalTransform(); } else { // Transform is manually setted forceUpdateWorld = true; } if (forceUpdateWorld || this._needsUpdateWorldTransform) { this._up...
javascript
function (forceUpdateWorld) { if (this.autoUpdateLocalTransform) { this.updateLocalTransform(); } else { // Transform is manually setted forceUpdateWorld = true; } if (forceUpdateWorld || this._needsUpdateWorldTransform) { this._up...
[ "function", "(", "forceUpdateWorld", ")", "{", "if", "(", "this", ".", "autoUpdateLocalTransform", ")", "{", "this", ".", "updateLocalTransform", "(", ")", ";", "}", "else", "{", "// Transform is manually setted", "forceUpdateWorld", "=", "true", ";", "}", "if",...
Update local transform and world transform recursively @param {boolean} forceUpdateWorld
[ "Update", "local", "transform", "and", "world", "transform", "recursively" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15306-L15325
train
pissang/claygl
dist/claygl.es.js
function (out) { // PENDING if (this.transformNeedsUpdate()) { this.updateWorldTransform(); } var m = this.worldTransform.array; if (out) { var arr = out.array; arr[0] = m[12]; arr[1] = m[13]; arr[2] = m[14]; ...
javascript
function (out) { // PENDING if (this.transformNeedsUpdate()) { this.updateWorldTransform(); } var m = this.worldTransform.array; if (out) { var arr = out.array; arr[0] = m[12]; arr[1] = m[13]; arr[2] = m[14]; ...
[ "function", "(", "out", ")", "{", "// PENDING", "if", "(", "this", ".", "transformNeedsUpdate", "(", ")", ")", "{", "this", ".", "updateWorldTransform", "(", ")", ";", "}", "var", "m", "=", "this", ".", "worldTransform", ".", "array", ";", "if", "(", ...
Get world position, extracted from world transform @param {clay.Vector3} [out] @return {clay.Vector3}
[ "Get", "world", "position", "extracted", "from", "world", "transform" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15370-L15386
train
pissang/claygl
dist/claygl.es.js
function () { var node = new this.constructor(); var children = this._children; node.setName(this.name); node.position.copy(this.position); node.rotation.copy(this.rotation); node.scale.copy(this.scale); for (var i = 0; i < children.length; i++) { n...
javascript
function () { var node = new this.constructor(); var children = this._children; node.setName(this.name); node.position.copy(this.position); node.rotation.copy(this.rotation); node.scale.copy(this.scale); for (var i = 0; i < children.length; i++) { n...
[ "function", "(", ")", "{", "var", "node", "=", "new", "this", ".", "constructor", "(", ")", ";", "var", "children", "=", "this", ".", "_children", ";", "node", ".", "setName", "(", "this", ".", "name", ")", ";", "node", ".", "position", ".", "copy"...
Clone a new node @return {Node}
[ "Clone", "a", "new", "node" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15392-L15407
train
pissang/claygl
dist/claygl.es.js
function(point, out) { if (!out) { out = new Vector3(); } var d = this.distanceToPoint(point); vec3.scaleAndAdd(out.array, point.array, this.normal.array, -d); out._dirty = true; return out; }
javascript
function(point, out) { if (!out) { out = new Vector3(); } var d = this.distanceToPoint(point); vec3.scaleAndAdd(out.array, point.array, this.normal.array, -d); out._dirty = true; return out; }
[ "function", "(", "point", ",", "out", ")", "{", "if", "(", "!", "out", ")", "{", "out", "=", "new", "Vector3", "(", ")", ";", "}", "var", "d", "=", "this", ".", "distanceToPoint", "(", "point", ")", ";", "vec3", ".", "scaleAndAdd", "(", "out", ...
Calculate the projection point on the plane @param {clay.Vector3} point @param {clay.Vector3} out @return {clay.Vector3}
[ "Calculate", "the", "projection", "point", "on", "the", "plane" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15609-L15617
train
pissang/claygl
dist/claygl.es.js
function() { var invLen = 1 / vec3.len(this.normal.array); vec3.scale(this.normal.array, invLen); this.distance *= invLen; }
javascript
function() { var invLen = 1 / vec3.len(this.normal.array); vec3.scale(this.normal.array, invLen); this.distance *= invLen; }
[ "function", "(", ")", "{", "var", "invLen", "=", "1", "/", "vec3", ".", "len", "(", "this", ".", "normal", ".", "array", ")", ";", "vec3", ".", "scale", "(", "this", ".", "normal", ".", "array", ",", "invLen", ")", ";", "this", ".", "distance", ...
Normalize the plane's normal and calculate the distance
[ "Normalize", "the", "plane", "s", "normal", "and", "calculate", "the", "distance" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15622-L15626
train
pissang/claygl
dist/claygl.es.js
function(frustum) { // Check if all coords of frustum is on plane all under plane var coords = frustum.vertices; var normal = this.normal.array; var onPlane = vec3.dot(coords[0].array, normal) > this.distance; for (var i = 1; i < 8; i++) { if ((vec3.dot(coords[i].arra...
javascript
function(frustum) { // Check if all coords of frustum is on plane all under plane var coords = frustum.vertices; var normal = this.normal.array; var onPlane = vec3.dot(coords[0].array, normal) > this.distance; for (var i = 1; i < 8; i++) { if ((vec3.dot(coords[i].arra...
[ "function", "(", "frustum", ")", "{", "// Check if all coords of frustum is on plane all under plane", "var", "coords", "=", "frustum", ".", "vertices", ";", "var", "normal", "=", "this", ".", "normal", ".", "array", ";", "var", "onPlane", "=", "vec3", ".", "dot...
If the plane intersect a frustum @param {clay.Frustum} Frustum @return {boolean}
[ "If", "the", "plane", "intersect", "a", "frustum" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15633-L15643
train
pissang/claygl
dist/claygl.es.js
function(plane) { vec3.copy(this.normal.array, plane.normal.array); this.normal._dirty = true; this.distance = plane.distance; }
javascript
function(plane) { vec3.copy(this.normal.array, plane.normal.array); this.normal._dirty = true; this.distance = plane.distance; }
[ "function", "(", "plane", ")", "{", "vec3", ".", "copy", "(", "this", ".", "normal", ".", "array", ",", "plane", ".", "normal", ".", "array", ")", ";", "this", ".", "normal", ".", "_dirty", "=", "true", ";", "this", ".", "distance", "=", "plane", ...
Copy from another plane @param {clay.Vector3} plane
[ "Copy", "from", "another", "plane" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15714-L15718
train
pissang/claygl
dist/claygl.es.js
function (plane) { // Distance to plane var d = vec3.dot(plane.normal.array, this.direction.array); vec3.scaleAndAdd(this.direction.array, this.direction.array, plane.normal.array, -d * 2); this.direction._dirty = true; }
javascript
function (plane) { // Distance to plane var d = vec3.dot(plane.normal.array, this.direction.array); vec3.scaleAndAdd(this.direction.array, this.direction.array, plane.normal.array, -d * 2); this.direction._dirty = true; }
[ "function", "(", "plane", ")", "{", "// Distance to plane", "var", "d", "=", "vec3", ".", "dot", "(", "plane", ".", "normal", ".", "array", ",", "this", ".", "direction", ".", "array", ")", ";", "vec3", ".", "scaleAndAdd", "(", "this", ".", "direction"...
Mirror the ray against plane @param {clay.Plane} plane
[ "Mirror", "the", "ray", "against", "plane" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L15963-L15968
train
pissang/claygl
dist/claygl.es.js
function (matrix) { Vector3.add(this.direction, this.direction, this.origin); Vector3.transformMat4(this.origin, this.origin, matrix); Vector3.transformMat4(this.direction, this.direction, matrix); Vector3.sub(this.direction, this.direction, this.origin); Vector3.normalize(this....
javascript
function (matrix) { Vector3.add(this.direction, this.direction, this.origin); Vector3.transformMat4(this.origin, this.origin, matrix); Vector3.transformMat4(this.direction, this.direction, matrix); Vector3.sub(this.direction, this.direction, this.origin); Vector3.normalize(this....
[ "function", "(", "matrix", ")", "{", "Vector3", ".", "add", "(", "this", ".", "direction", ",", "this", ".", "direction", ",", "this", ".", "origin", ")", ";", "Vector3", ".", "transformMat4", "(", "this", ".", "origin", ",", "this", ".", "origin", "...
Apply an affine transform matrix to the ray @return {clay.Matrix4} matrix
[ "Apply", "an", "affine", "transform", "matrix", "to", "the", "ray" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16195-L16202
train
pissang/claygl
dist/claygl.es.js
function (ray) { Vector3.copy(this.origin, ray.origin); Vector3.copy(this.direction, ray.direction); }
javascript
function (ray) { Vector3.copy(this.origin, ray.origin); Vector3.copy(this.direction, ray.direction); }
[ "function", "(", "ray", ")", "{", "Vector3", ".", "copy", "(", "this", ".", "origin", ",", "ray", ".", "origin", ")", ";", "Vector3", ".", "copy", "(", "this", ".", "direction", ",", "ray", ".", "direction", ")", ";", "}" ]
Copy values from another ray @param {clay.Ray} ray
[ "Copy", "values", "from", "another", "ray" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16208-L16211
train
pissang/claygl
dist/claygl.es.js
function (viewMatrix) { Matrix4.copy(this.viewMatrix, viewMatrix); Matrix4.invert(this.worldTransform, viewMatrix); this.decomposeWorldTransform(); }
javascript
function (viewMatrix) { Matrix4.copy(this.viewMatrix, viewMatrix); Matrix4.invert(this.worldTransform, viewMatrix); this.decomposeWorldTransform(); }
[ "function", "(", "viewMatrix", ")", "{", "Matrix4", ".", "copy", "(", "this", ".", "viewMatrix", ",", "viewMatrix", ")", ";", "Matrix4", ".", "invert", "(", "this", ".", "worldTransform", ",", "viewMatrix", ")", ";", "this", ".", "decomposeWorldTransform", ...
Set camera view matrix
[ "Set", "camera", "view", "matrix" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16273-L16277
train
pissang/claygl
dist/claygl.es.js
function (projectionMatrix) { Matrix4.copy(this.projectionMatrix, projectionMatrix); Matrix4.invert(this.invProjectionMatrix, projectionMatrix); this.decomposeProjectionMatrix(); }
javascript
function (projectionMatrix) { Matrix4.copy(this.projectionMatrix, projectionMatrix); Matrix4.invert(this.invProjectionMatrix, projectionMatrix); this.decomposeProjectionMatrix(); }
[ "function", "(", "projectionMatrix", ")", "{", "Matrix4", ".", "copy", "(", "this", ".", "projectionMatrix", ",", "projectionMatrix", ")", ";", "Matrix4", ".", "invert", "(", "this", ".", "invProjectionMatrix", ",", "projectionMatrix", ")", ";", "this", ".", ...
Set camera projection matrix @param {clay.Matrix4} projectionMatrix
[ "Set", "camera", "projection", "matrix" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16288-L16292
train
pissang/claygl
dist/claygl.es.js
function (node) { if (node instanceof Camera) { if (this._cameraList.length > 0) { console.warn('Found multiple camera in one scene. Use the fist one.'); } this._cameraList.push(node); } else if (node instanceof Light) { this.lights...
javascript
function (node) { if (node instanceof Camera) { if (this._cameraList.length > 0) { console.warn('Found multiple camera in one scene. Use the fist one.'); } this._cameraList.push(node); } else if (node instanceof Light) { this.lights...
[ "function", "(", "node", ")", "{", "if", "(", "node", "instanceof", "Camera", ")", "{", "if", "(", "this", ".", "_cameraList", ".", "length", ">", "0", ")", "{", "console", ".", "warn", "(", "'Found multiple camera in one scene. Use the fist one.'", ")", ";"...
Add node to scene
[ "Add", "node", "to", "scene" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16456-L16469
train
pissang/claygl
dist/claygl.es.js
function (node) { var idx; if (node instanceof Camera) { idx = this._cameraList.indexOf(node); if (idx >= 0) { this._cameraList.splice(idx, 1); } } else if (node instanceof Light) { idx = this.lights.indexOf(node); ...
javascript
function (node) { var idx; if (node instanceof Camera) { idx = this._cameraList.indexOf(node); if (idx >= 0) { this._cameraList.splice(idx, 1); } } else if (node instanceof Light) { idx = this.lights.indexOf(node); ...
[ "function", "(", "node", ")", "{", "var", "idx", ";", "if", "(", "node", "instanceof", "Camera", ")", "{", "idx", "=", "this", ".", "_cameraList", ".", "indexOf", "(", "node", ")", ";", "if", "(", "idx", ">=", "0", ")", "{", "this", ".", "_camera...
Remove node from scene
[ "Remove", "node", "from", "scene" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16472-L16489
train
pissang/claygl
dist/claygl.es.js
function (camera) { var idx = this._cameraList.indexOf(camera); if (idx >= 0) { this._cameraList.splice(idx, 1); } this._cameraList.unshift(camera); }
javascript
function (camera) { var idx = this._cameraList.indexOf(camera); if (idx >= 0) { this._cameraList.splice(idx, 1); } this._cameraList.unshift(camera); }
[ "function", "(", "camera", ")", "{", "var", "idx", "=", "this", ".", "_cameraList", ".", "indexOf", "(", "camera", ")", ";", "if", "(", "idx", ">=", "0", ")", "{", "this", ".", "_cameraList", ".", "splice", "(", "idx", ",", "1", ")", ";", "}", ...
Set main camera of the scene. @param {claygl.Camera} camera
[ "Set", "main", "camera", "of", "the", "scene", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16505-L16511
train
pissang/claygl
dist/claygl.es.js
function (camera, updateSceneBoundingBox) { var id = camera.__uid__; var renderList = this._renderLists.get(id); if (!renderList) { renderList = new RenderList(); this._renderLists.put(id, renderList); } renderList.startCount(); if (updateSceneBou...
javascript
function (camera, updateSceneBoundingBox) { var id = camera.__uid__; var renderList = this._renderLists.get(id); if (!renderList) { renderList = new RenderList(); this._renderLists.put(id, renderList); } renderList.startCount(); if (updateSceneBou...
[ "function", "(", "camera", ",", "updateSceneBoundingBox", ")", "{", "var", "id", "=", "camera", ".", "__uid__", ";", "var", "renderList", "=", "this", ".", "_renderLists", ".", "get", "(", "id", ")", ";", "if", "(", "!", "renderList", ")", "{", "render...
Traverse the scene and add the renderable object to the render list. It needs camera for the frustum culling. @param {clay.Camera} camera @param {boolean} updateSceneBoundingBox @return {clay.Scene.RenderList}
[ "Traverse", "the", "scene", "and", "add", "the", "renderable", "object", "to", "the", "render", "list", ".", "It", "needs", "camera", "for", "the", "frustum", "culling", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16591-L16611
train
pissang/claygl
dist/claygl.es.js
function (lightGroup) { var prevLightNumber = this._previousLightNumber; var currentLightNumber = this._lightNumber; // PENDING Performance for (var type in currentLightNumber[lightGroup]) { if (!prevLightNumber[lightGroup]) { return true; } ...
javascript
function (lightGroup) { var prevLightNumber = this._previousLightNumber; var currentLightNumber = this._lightNumber; // PENDING Performance for (var type in currentLightNumber[lightGroup]) { if (!prevLightNumber[lightGroup]) { return true; } ...
[ "function", "(", "lightGroup", ")", "{", "var", "prevLightNumber", "=", "this", ".", "_previousLightNumber", ";", "var", "currentLightNumber", "=", "this", ".", "_lightNumber", ";", "// PENDING Performance", "for", "(", "var", "type", "in", "currentLightNumber", "...
Determine if light group is different with since last frame Used to determine whether to update shader and scene's uniforms in Renderer.render
[ "Determine", "if", "light", "group", "is", "different", "with", "since", "last", "frame", "Used", "to", "determine", "whether", "to", "update", "shader", "and", "scene", "s", "uniforms", "in", "Renderer", ".", "render" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L16800-L16821
train
pissang/claygl
dist/claygl.es.js
function (name, type, size, semantic) { var attrib = new Attribute$1(name, type, size, semantic); if (this.attributes[name]) { this.removeAttribute(name); } this.attributes[name] = attrib; this._attributeList.push(name); return attrib; }
javascript
function (name, type, size, semantic) { var attrib = new Attribute$1(name, type, size, semantic); if (this.attributes[name]) { this.removeAttribute(name); } this.attributes[name] = attrib; this._attributeList.push(name); return attrib; }
[ "function", "(", "name", ",", "type", ",", "size", ",", "semantic", ")", "{", "var", "attrib", "=", "new", "Attribute$1", "(", "name", ",", "type", ",", "size", ",", "semantic", ")", ";", "if", "(", "this", ".", "attributes", "[", "name", "]", ")",...
Create a new attribute @param {string} name @param {string} type @param {number} size @param {string} [semantic]
[ "Create", "a", "new", "attribute" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L17406-L17414
train
pissang/claygl
dist/claygl.es.js
function () { var bbox = this.boundingBox; if (!bbox) { bbox = this.boundingBox = new BoundingBox(); } var posArr = this.attributes.position.value; if (posArr && posArr.length) { var min = bbox.min; var max = bbox.max; var minArr = ...
javascript
function () { var bbox = this.boundingBox; if (!bbox) { bbox = this.boundingBox = new BoundingBox(); } var posArr = this.attributes.position.value; if (posArr && posArr.length) { var min = bbox.min; var max = bbox.max; var minArr = ...
[ "function", "(", ")", "{", "var", "bbox", "=", "this", ".", "boundingBox", ";", "if", "(", "!", "bbox", ")", "{", "bbox", "=", "this", ".", "boundingBox", "=", "new", "BoundingBox", "(", ")", ";", "}", "var", "posArr", "=", "this", ".", "attributes...
Update boundingBox of Geometry
[ "Update", "boundingBox", "of", "Geometry" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L17778-L17806
train
pissang/claygl
dist/claygl.es.js
function () { if (!this.vertexCount || !this.indices) { return; } if (this.indices.length > 0xffff) { this.indices = new vendor.Uint32Array(this.indices); } var attributes = this.attributes; var indices = this.indices; var attributeNameL...
javascript
function () { if (!this.vertexCount || !this.indices) { return; } if (this.indices.length > 0xffff) { this.indices = new vendor.Uint32Array(this.indices); } var attributes = this.attributes; var indices = this.indices; var attributeNameL...
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "vertexCount", "||", "!", "this", ".", "indices", ")", "{", "return", ";", "}", "if", "(", "this", ".", "indices", ".", "length", ">", "0xffff", ")", "{", "this", ".", "indices", "=", "new",...
Create a unique vertex for each index.
[ "Create", "a", "unique", "vertex", "for", "each", "index", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L18071-L18109
train
pissang/claygl
dist/claygl.es.js
function () { if (!this.vertexCount) { return; } if (!this.isUniqueVertex()) { this.generateUniqueVertex(); } var attributes = this.attributes; var array = attributes.barycentric.value; var indices = this.indices; // Already exist...
javascript
function () { if (!this.vertexCount) { return; } if (!this.isUniqueVertex()) { this.generateUniqueVertex(); } var attributes = this.attributes; var array = attributes.barycentric.value; var indices = this.indices; // Already exist...
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "vertexCount", ")", "{", "return", ";", "}", "if", "(", "!", "this", ".", "isUniqueVertex", "(", ")", ")", "{", "this", ".", "generateUniqueVertex", "(", ")", ";", "}", "var", "attributes", "=...
Generate barycentric coordinates for wireframe draw.
[ "Generate", "barycentric", "coordinates", "for", "wireframe", "draw", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L18114-L18139
train
pissang/claygl
dist/claygl.es.js
function (matrix) { var attributes = this.attributes; var positions = attributes.position.value; var normals = attributes.normal.value; var tangents = attributes.tangent.value; matrix = matrix.array; // Normal Matrix var inverseTransposeMatrix = mat4.create(); ...
javascript
function (matrix) { var attributes = this.attributes; var positions = attributes.position.value; var normals = attributes.normal.value; var tangents = attributes.tangent.value; matrix = matrix.array; // Normal Matrix var inverseTransposeMatrix = mat4.create(); ...
[ "function", "(", "matrix", ")", "{", "var", "attributes", "=", "this", ".", "attributes", ";", "var", "positions", "=", "attributes", ".", "position", ".", "value", ";", "var", "normals", "=", "attributes", ".", "normal", ".", "value", ";", "var", "tange...
Apply transform to geometry attributes. @param {clay.Matrix4} matrix
[ "Apply", "transform", "to", "geometry", "attributes", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L18145-L18171
train
pissang/claygl
dist/claygl.es.js
function() { var heightSegments = this.heightSegments; var widthSegments = this.widthSegments; var attributes = this.attributes; var positions = []; var texcoords = []; var normals = []; var faces = []; for (var y = 0; y <= heightSegments; y++) { ...
javascript
function() { var heightSegments = this.heightSegments; var widthSegments = this.widthSegments; var attributes = this.attributes; var positions = []; var texcoords = []; var normals = []; var faces = []; for (var y = 0; y <= heightSegments; y++) { ...
[ "function", "(", ")", "{", "var", "heightSegments", "=", "this", ".", "heightSegments", ";", "var", "widthSegments", "=", "this", ".", "widthSegments", ";", "var", "attributes", "=", "this", ".", "attributes", ";", "var", "positions", "=", "[", "]", ";", ...
Build plane geometry
[ "Build", "plane", "geometry" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L18247-L18285
train
pissang/claygl
dist/claygl.es.js
function() { var planes = { 'px': createPlane('px', this.depthSegments, this.heightSegments), 'nx': createPlane('nx', this.depthSegments, this.heightSegments), 'py': createPlane('py', this.widthSegments, this.depthSegments), 'ny': createPlane('ny', this.widthSegm...
javascript
function() { var planes = { 'px': createPlane('px', this.depthSegments, this.heightSegments), 'nx': createPlane('nx', this.depthSegments, this.heightSegments), 'py': createPlane('py', this.widthSegments, this.depthSegments), 'ny': createPlane('ny', this.widthSegm...
[ "function", "(", ")", "{", "var", "planes", "=", "{", "'px'", ":", "createPlane", "(", "'px'", ",", "this", ".", "depthSegments", ",", "this", ".", "heightSegments", ")", ",", "'nx'", ":", "createPlane", "(", "'nx'", ",", "this", ".", "depthSegments", ...
Build cube geometry
[ "Build", "cube", "geometry" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L18327-L18377
train
pissang/claygl
dist/claygl.es.js
function (renderer) { var _gl = renderer.gl; _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, this.flipY); _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha); _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, this.unpackAlignment); // Use of none-power of two texture ...
javascript
function (renderer) { var _gl = renderer.gl; _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, this.flipY); _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha); _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, this.unpackAlignment); // Use of none-power of two texture ...
[ "function", "(", "renderer", ")", "{", "var", "_gl", "=", "renderer", ".", "gl", ";", "_gl", ".", "pixelStorei", "(", "_gl", ".", "UNPACK_FLIP_Y_WEBGL", ",", "this", ".", "flipY", ")", ";", "_gl", ".", "pixelStorei", "(", "_gl", ".", "UNPACK_PREMULTIPLY_...
Update the common parameters of texture
[ "Update", "the", "common", "parameters", "of", "texture" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L18816-L18838
train
pissang/claygl
dist/claygl.es.js
function () { if (this.image.px) { return isPowerOfTwo$1(this.image.px.width) && isPowerOfTwo$1(this.image.px.height); } else { return isPowerOfTwo$1(this.width) && isPowerOfTwo$1(this.height); } }
javascript
function () { if (this.image.px) { return isPowerOfTwo$1(this.image.px.width) && isPowerOfTwo$1(this.image.px.height); } else { return isPowerOfTwo$1(this.width) && isPowerOfTwo$1(this.height); } }
[ "function", "(", ")", "{", "if", "(", "this", ".", "image", ".", "px", ")", "{", "return", "isPowerOfTwo$1", "(", "this", ".", "image", ".", "px", ".", "width", ")", "&&", "isPowerOfTwo$1", "(", "this", ".", "image", ".", "px", ".", "height", ")", ...
Overwrite the isPowerOfTwo method
[ "Overwrite", "the", "isPowerOfTwo", "method" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L19498-L19507
train
pissang/claygl
dist/claygl.es.js
function (clip, mapRule) { // Clip have been exists in for (var i = 0; i < this._clips.length; i++) { if (this._clips[i].clip === clip) { return; } } // Map the joint index in skeleton to joint pose index in clip var maps = []; for ...
javascript
function (clip, mapRule) { // Clip have been exists in for (var i = 0; i < this._clips.length; i++) { if (this._clips[i].clip === clip) { return; } } // Map the joint index in skeleton to joint pose index in clip var maps = []; for ...
[ "function", "(", "clip", ",", "mapRule", ")", "{", "// Clip have been exists in", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "_clips", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "_clips", "[", "i", "]", "....
Add a skinning clip and create a map between clip and skeleton @param {clay.animation.SkinningClip} clip @param {Object} [mapRule] Map between joint name in skeleton and joint name in clip
[ "Add", "a", "skinning", "clip", "and", "create", "a", "map", "between", "clip", "and", "skeleton" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L20438-L20472
train
pissang/claygl
dist/claygl.es.js
function (geometry) { var attributes = geometry.attributes; var positionAttr = attributes.position; var jointAttr = attributes.joint; var weightAttr = attributes.weight; var jointsBoundingBoxes = []; for (var i = 0; i < this.joints.length; i++) { jointsBoundi...
javascript
function (geometry) { var attributes = geometry.attributes; var positionAttr = attributes.position; var jointAttr = attributes.joint; var weightAttr = attributes.weight; var jointsBoundingBoxes = []; for (var i = 0; i < this.joints.length; i++) { jointsBoundi...
[ "function", "(", "geometry", ")", "{", "var", "attributes", "=", "geometry", ".", "attributes", ";", "var", "positionAttr", "=", "attributes", ".", "position", ";", "var", "jointAttr", "=", "attributes", ".", "joint", ";", "var", "weightAttr", "=", "attribut...
Update boundingBox of each joint bound to geometry. ASSUME skeleton and geometry joints are matched. @param {clay.Geometry} geometry
[ "Update", "boundingBox", "of", "each", "joint", "bound", "to", "geometry", ".", "ASSUME", "skeleton", "and", "geometry", "joints", "are", "matched", "." ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L20545-L20589
train
pissang/claygl
dist/claygl.es.js
function () { this._setPose(); var jointsBoundingBoxes = this._jointsBoundingBoxes; for (var i = 0; i < this.joints.length; i++) { var joint = this.joints[i]; mat4.multiply( this._skinMatricesSubArrays[i], joint.node.worldTransform.array...
javascript
function () { this._setPose(); var jointsBoundingBoxes = this._jointsBoundingBoxes; for (var i = 0; i < this.joints.length; i++) { var joint = this.joints[i]; mat4.multiply( this._skinMatricesSubArrays[i], joint.node.worldTransform.array...
[ "function", "(", ")", "{", "this", ".", "_setPose", "(", ")", ";", "var", "jointsBoundingBoxes", "=", "this", ".", "_jointsBoundingBoxes", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "joints", ".", "length", ";", "i", "++", "...
Update skinning matrices
[ "Update", "skinning", "matrices" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L20607-L20636
train
pissang/claygl
dist/claygl.es.js
function (buffer) { var header = new Uint32Array(buffer, 0, 4); if (header[0] !== 0x46546C67) { this.trigger('error', 'Invalid glTF binary format: Invalid header'); return; } if (header[0] < 2) { this.trigger('error', 'Only glTF2.0 is supported.'); ...
javascript
function (buffer) { var header = new Uint32Array(buffer, 0, 4); if (header[0] !== 0x46546C67) { this.trigger('error', 'Invalid glTF binary format: Invalid header'); return; } if (header[0] < 2) { this.trigger('error', 'Only glTF2.0 is supported.'); ...
[ "function", "(", "buffer", ")", "{", "var", "header", "=", "new", "Uint32Array", "(", "buffer", ",", "0", ",", "4", ")", ";", "if", "(", "header", "[", "0", "]", "!==", "0x46546C67", ")", "{", "this", ".", "trigger", "(", "'error'", ",", "'Invalid ...
Parse glTF binary @param {ArrayBuffer} buffer @return {clay.loader.GLTF.Result}
[ "Parse", "glTF", "binary" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L21046-L21094
train
pissang/claygl
dist/claygl.es.js
function (path) { if (path && path.match(/^data:(.*?)base64,/)) { return path; } var rootPath = this.bufferRootPath; if (rootPath == null) { rootPath = this.rootPath; } return util$1.relative2absolute(path, rootPath); }
javascript
function (path) { if (path && path.match(/^data:(.*?)base64,/)) { return path; } var rootPath = this.bufferRootPath; if (rootPath == null) { rootPath = this.rootPath; } return util$1.relative2absolute(path, rootPath); }
[ "function", "(", "path", ")", "{", "if", "(", "path", "&&", "path", ".", "match", "(", "/", "^data:(.*?)base64,", "/", ")", ")", "{", "return", "path", ";", "}", "var", "rootPath", "=", "this", ".", "bufferRootPath", ";", "if", "(", "rootPath", "==",...
Binary file path resolver. User can override it @param {string} path
[ "Binary", "file", "path", "resolver", ".", "User", "can", "override", "it" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L21220-L21230
train
pissang/claygl
dist/claygl.es.js
function (path) { if (path && path.match(/^data:(.*?)base64,/)) { return path; } var rootPath = this.textureRootPath; if (rootPath == null) { rootPath = this.rootPath; } return util$1.relative2absolute(path, rootPath); }
javascript
function (path) { if (path && path.match(/^data:(.*?)base64,/)) { return path; } var rootPath = this.textureRootPath; if (rootPath == null) { rootPath = this.rootPath; } return util$1.relative2absolute(path, rootPath); }
[ "function", "(", "path", ")", "{", "if", "(", "path", "&&", "path", ".", "match", "(", "/", "^data:(.*?)base64,", "/", ")", ")", "{", "return", "path", ";", "}", "var", "rootPath", "=", "this", ".", "textureRootPath", ";", "if", "(", "rootPath", "=="...
Texture file path resolver. User can override it @param {string} path
[ "Texture", "file", "path", "resolver", ".", "User", "can", "override", "it" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L21236-L21246
train
pissang/claygl
dist/claygl.es.js
function (renderer) { if (renderer.__currentFrameBuffer) { // Already bound if (renderer.__currentFrameBuffer === this) { return; } console.warn('Renderer already bound with another framebuffer. Unbind it first'); } renderer.__cur...
javascript
function (renderer) { if (renderer.__currentFrameBuffer) { // Already bound if (renderer.__currentFrameBuffer === this) { return; } console.warn('Renderer already bound with another framebuffer. Unbind it first'); } renderer.__cur...
[ "function", "(", "renderer", ")", "{", "if", "(", "renderer", ".", "__currentFrameBuffer", ")", "{", "// Already bound", "if", "(", "renderer", ".", "__currentFrameBuffer", "===", "this", ")", "{", "return", ";", "}", "console", ".", "warn", "(", "'Renderer ...
Bind the framebuffer to given renderer before rendering @param {clay.Renderer} renderer
[ "Bind", "the", "framebuffer", "to", "given", "renderer", "before", "rendering" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L22362-L22440
train
pissang/claygl
dist/claygl.es.js
function (renderer) { // Remove status record on renderer renderer.__currentFrameBuffer = null; var _gl = renderer.gl; _gl.bindFramebuffer(GL_FRAMEBUFFER, null); this._boundRenderer = null; this._cache.use(renderer.__uid__); var viewport = this._cache.get('view...
javascript
function (renderer) { // Remove status record on renderer renderer.__currentFrameBuffer = null; var _gl = renderer.gl; _gl.bindFramebuffer(GL_FRAMEBUFFER, null); this._boundRenderer = null; this._cache.use(renderer.__uid__); var viewport = this._cache.get('view...
[ "function", "(", "renderer", ")", "{", "// Remove status record on renderer", "renderer", ".", "__currentFrameBuffer", "=", "null", ";", "var", "_gl", "=", "renderer", ".", "gl", ";", "_gl", ".", "bindFramebuffer", "(", "GL_FRAMEBUFFER", ",", "null", ")", ";", ...
Unbind the frame buffer after rendering @param {clay.Renderer} renderer
[ "Unbind", "the", "frame", "buffer", "after", "rendering" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L22446-L22463
train
pissang/claygl
dist/claygl.es.js
function (renderer) { var _gl = renderer.gl; for (var attachment in this._textures) { var obj = this._textures[attachment]; if (obj) { var texture = obj.texture; // FIXME some texture format can't generate mipmap if (!texture.NPOT &...
javascript
function (renderer) { var _gl = renderer.gl; for (var attachment in this._textures) { var obj = this._textures[attachment]; if (obj) { var texture = obj.texture; // FIXME some texture format can't generate mipmap if (!texture.NPOT &...
[ "function", "(", "renderer", ")", "{", "var", "_gl", "=", "renderer", ".", "gl", ";", "for", "(", "var", "attachment", "in", "this", ".", "_textures", ")", "{", "var", "obj", "=", "this", ".", "_textures", "[", "attachment", "]", ";", "if", "(", "o...
Because the data of texture is changed over time, Here update the mipmaps of texture each time after rendered;
[ "Because", "the", "data", "of", "texture", "is", "changed", "over", "time", "Here", "update", "the", "mipmaps", "of", "texture", "each", "time", "after", "rendered", ";" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L22467-L22483
train
pissang/claygl
dist/claygl.es.js
function (attachment, target) { // TODO depth extension check ? this._textures[attachment] = null; if (this._boundRenderer) { var cache = this._cache; cache.use(this._boundRenderer.__uid__); this._doDetach(this._boundRenderer.gl, attachment, target); }...
javascript
function (attachment, target) { // TODO depth extension check ? this._textures[attachment] = null; if (this._boundRenderer) { var cache = this._cache; cache.use(this._boundRenderer.__uid__); this._doDetach(this._boundRenderer.gl, attachment, target); }...
[ "function", "(", "attachment", ",", "target", ")", "{", "// TODO depth extension check ?", "this", ".", "_textures", "[", "attachment", "]", "=", "null", ";", "if", "(", "this", ".", "_boundRenderer", ")", "{", "var", "cache", "=", "this", ".", "_cache", "...
Detach a texture @param {number} [attachment=gl.COLOR_ATTACHMENT0] @param {number} [target=gl.TEXTURE_2D]
[ "Detach", "a", "texture" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L22641-L22649
train
pissang/claygl
dist/claygl.es.js
function (scene) { if (this.scene) { this.detachScene(); } scene.skybox = this; this.scene = scene; scene.on('beforerender', this._beforeRenderScene, this); }
javascript
function (scene) { if (this.scene) { this.detachScene(); } scene.skybox = this; this.scene = scene; scene.on('beforerender', this._beforeRenderScene, this); }
[ "function", "(", "scene", ")", "{", "if", "(", "this", ".", "scene", ")", "{", "this", ".", "detachScene", "(", ")", ";", "}", "scene", ".", "skybox", "=", "this", ";", "this", ".", "scene", "=", "scene", ";", "scene", ".", "on", "(", "'beforeren...
Attach the skybox to the scene @param {clay.Scene} scene
[ "Attach", "the", "skybox", "to", "the", "scene" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L22939-L22947
train
pissang/claygl
dist/claygl.es.js
function (envMap) { if (envMap.textureType === 'texture2D') { this.material.define('EQUIRECTANGULAR'); // LINEAR filter can remove the artifacts in pole envMap.minFilter = Texture.LINEAR; } else { this.material.undefine('EQUIRECTANGULAR'); ...
javascript
function (envMap) { if (envMap.textureType === 'texture2D') { this.material.define('EQUIRECTANGULAR'); // LINEAR filter can remove the artifacts in pole envMap.minFilter = Texture.LINEAR; } else { this.material.undefine('EQUIRECTANGULAR'); ...
[ "function", "(", "envMap", ")", "{", "if", "(", "envMap", ".", "textureType", "===", "'texture2D'", ")", "{", "this", ".", "material", ".", "define", "(", "'EQUIRECTANGULAR'", ")", ";", "// LINEAR filter can remove the artifacts in pole", "envMap", ".", "minFilter...
Set environment map @param {clay.TextureCube} envMap
[ "Set", "environment", "map" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L22971-L22981
train
pissang/claygl
dist/claygl.es.js
function (renderer, path, cubeMap, option, onsuccess, onerror) { var self = this; if (typeof(option) === 'function') { onsuccess = option; onerror = onsuccess; option = {}; } else { option = option || {}; } textureUtil.loa...
javascript
function (renderer, path, cubeMap, option, onsuccess, onerror) { var self = this; if (typeof(option) === 'function') { onsuccess = option; onerror = onsuccess; option = {}; } else { option = option || {}; } textureUtil.loa...
[ "function", "(", "renderer", ",", "path", ",", "cubeMap", ",", "option", ",", "onsuccess", ",", "onerror", ")", "{", "var", "self", "=", "this", ";", "if", "(", "typeof", "(", "option", ")", "===", "'function'", ")", "{", "onsuccess", "=", "option", ...
Load a panorama texture and render it to a cube map @param {clay.Renderer} renderer @param {string} path @param {clay.TextureCube} cubeMap @param {object} [option] @param {boolean} [option.encodeRGBM] @param {number} [option.exposure] @param {Function} [onsuccess] @param {Function} [onerror]
[ "Load", "a", "panorama", "texture", "and", "render", "it", "to", "a", "cube", "map" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L23522-L23541
train
pissang/claygl
dist/claygl.es.js
function (renderer, panoramaMap, cubeMap, option) { var environmentMapPass = new EnvironmentMapPass(); var skydome = new Skybox$1({ scene: new Scene() }); skydome.setEnvironmentMap(panoramaMap); option = option || {}; if (option.encodeRGBM) { skyd...
javascript
function (renderer, panoramaMap, cubeMap, option) { var environmentMapPass = new EnvironmentMapPass(); var skydome = new Skybox$1({ scene: new Scene() }); skydome.setEnvironmentMap(panoramaMap); option = option || {}; if (option.encodeRGBM) { skyd...
[ "function", "(", "renderer", ",", "panoramaMap", ",", "cubeMap", ",", "option", ")", "{", "var", "environmentMapPass", "=", "new", "EnvironmentMapPass", "(", ")", ";", "var", "skydome", "=", "new", "Skybox$1", "(", "{", "scene", ":", "new", "Scene", "(", ...
Render a panorama texture to a cube map @param {clay.Renderer} renderer @param {clay.Texture2D} panoramaMap @param {clay.TextureCube} cubeMap @param {Object} option @param {boolean} [option.encodeRGBM]
[ "Render", "a", "panorama", "texture", "to", "a", "cube", "map" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L23551-L23571
train
pissang/claygl
dist/claygl.es.js
function (size, unitSize, color1, color2) { size = size || 512; unitSize = unitSize || 64; color1 = color1 || 'black'; color2 = color2 || 'white'; var repeat = Math.ceil(size / unitSize); var canvas = document.createElement('canvas'); canvas.width = size; ...
javascript
function (size, unitSize, color1, color2) { size = size || 512; unitSize = unitSize || 64; color1 = color1 || 'black'; color2 = color2 || 'white'; var repeat = Math.ceil(size / unitSize); var canvas = document.createElement('canvas'); canvas.width = size; ...
[ "function", "(", "size", ",", "unitSize", ",", "color1", ",", "color2", ")", "{", "size", "=", "size", "||", "512", ";", "unitSize", "=", "unitSize", "||", "64", ";", "color1", "=", "color1", "||", "'black'", ";", "color2", "=", "color2", "||", "'whi...
Create a chessboard texture @param {number} [size] @param {number} [unitSize] @param {string} [color1] @param {string} [color2] @return {clay.Texture2D}
[ "Create", "a", "chessboard", "texture" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L23688-L23719
train
pissang/claygl
dist/claygl.es.js
function (color) { var canvas = document.createElement('canvas'); canvas.width = 1; canvas.height = 1; var ctx = canvas.getContext('2d'); ctx.fillStyle = color; ctx.fillRect(0, 0, 1, 1); var texture = new Texture2D({ image: canvas }); ...
javascript
function (color) { var canvas = document.createElement('canvas'); canvas.width = 1; canvas.height = 1; var ctx = canvas.getContext('2d'); ctx.fillStyle = color; ctx.fillRect(0, 0, 1, 1); var texture = new Texture2D({ image: canvas }); ...
[ "function", "(", "color", ")", "{", "var", "canvas", "=", "document", ".", "createElement", "(", "'canvas'", ")", ";", "canvas", ".", "width", "=", "1", ";", "canvas", ".", "height", "=", "1", ";", "var", "ctx", "=", "canvas", ".", "getContext", "(",...
Create a blank pure color 1x1 texture @param {string} color @return {clay.Texture2D}
[ "Create", "a", "blank", "pure", "color", "1x1", "texture" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L23726-L23739
train
pissang/claygl
dist/claygl.es.js
function (renderer, size) { if (!renderer.getGLExtension('EXT_shader_texture_lod')) { console.warn('Device not support textureCubeLodEXT'); return; } if (!this._brdfLookup) { this._normalDistribution = cubemapUtil.generateNormalDistribution(); this...
javascript
function (renderer, size) { if (!renderer.getGLExtension('EXT_shader_texture_lod')) { console.warn('Device not support textureCubeLodEXT'); return; } if (!this._brdfLookup) { this._normalDistribution = cubemapUtil.generateNormalDistribution(); this...
[ "function", "(", "renderer", ",", "size", ")", "{", "if", "(", "!", "renderer", ".", "getGLExtension", "(", "'EXT_shader_texture_lod'", ")", ")", "{", "console", ".", "warn", "(", "'Device not support textureCubeLodEXT'", ")", ";", "return", ";", "}", "if", ...
Do prefitering the cubemap @param {clay.Renderer} renderer @param {number} [size=32]
[ "Do", "prefitering", "the", "cubemap" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L24048-L24073
train
pissang/claygl
dist/claygl.es.js
function (renderer, scene, sceneCamera, notUpdateScene) { if (!sceneCamera) { sceneCamera = scene.getMainCamera(); } this.trigger('beforerender', this, renderer, scene, sceneCamera); this._renderShadowPass(renderer, scene, sceneCamera, notUpdateScene); this.trigger('a...
javascript
function (renderer, scene, sceneCamera, notUpdateScene) { if (!sceneCamera) { sceneCamera = scene.getMainCamera(); } this.trigger('beforerender', this, renderer, scene, sceneCamera); this._renderShadowPass(renderer, scene, sceneCamera, notUpdateScene); this.trigger('a...
[ "function", "(", "renderer", ",", "scene", ",", "sceneCamera", ",", "notUpdateScene", ")", "{", "if", "(", "!", "sceneCamera", ")", "{", "sceneCamera", "=", "scene", ".", "getMainCamera", "(", ")", ";", "}", "this", ".", "trigger", "(", "'beforerender'", ...
Render scene to shadow textures @param {clay.Renderer} renderer @param {clay.Scene} scene @param {clay.Camera} sceneCamera @param {boolean} [notUpdateScene=false] @memberOf clay.prePass.ShadowMap.prototype
[ "Render", "scene", "to", "shadow", "textures" ]
b157bb50cf8c725fa20f90ebb55481352777f0a7
https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/dist/claygl.es.js#L24395-L24402
train