id int32 0 58k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6,800 | google/marzipano | src/stages/Stage.js | Stage | function Stage(opts) {
this._progressive = !!(opts && opts.progressive);
// The list of layers in display order (background to foreground).
this._layers = [];
// The list of renderers; the i-th renderer is for the i-th layer.
this._renderers = [];
// The lists of tiles to load and render, populated durin... | javascript | function Stage(opts) {
this._progressive = !!(opts && opts.progressive);
// The list of layers in display order (background to foreground).
this._layers = [];
// The list of renderers; the i-th renderer is for the i-th layer.
this._renderers = [];
// The lists of tiles to load and render, populated durin... | [
"function",
"Stage",
"(",
"opts",
")",
"{",
"this",
".",
"_progressive",
"=",
"!",
"!",
"(",
"opts",
"&&",
"opts",
".",
"progressive",
")",
";",
"// The list of layers in display order (background to foreground).",
"this",
".",
"_layers",
"=",
"[",
"]",
";",
"... | Signals that the contents of the stage have been invalidated and must be
rendered again.
This is used by the {@link RenderLoop} implementation.
@event Stage#renderInvalid
@interface Stage
@classdesc
A Stage is a container with the ability to render a stack of
{@link Layer layers}.
This is a superclass containing ... | [
"Signals",
"that",
"the",
"contents",
"of",
"the",
"stage",
"have",
"been",
"invalidated",
"and",
"must",
"be",
"rendered",
"again",
"."
] | e3e21b2c1992708992dfeab5970b0f5a3f8f98e0 | https://github.com/google/marzipano/blob/e3e21b2c1992708992dfeab5970b0f5a3f8f98e0/src/stages/Stage.js#L74-L111 |
6,801 | google/marzipano | demos/transitions/index.js | nextScene | function nextScene() {
switch (currentScene) {
case scene1: return (currentScene = scene2);
case scene2: return (currentScene = scene1);
default: return (currentScene = scene1);
}
} | javascript | function nextScene() {
switch (currentScene) {
case scene1: return (currentScene = scene2);
case scene2: return (currentScene = scene1);
default: return (currentScene = scene1);
}
} | [
"function",
"nextScene",
"(",
")",
"{",
"switch",
"(",
"currentScene",
")",
"{",
"case",
"scene1",
":",
"return",
"(",
"currentScene",
"=",
"scene2",
")",
";",
"case",
"scene2",
":",
"return",
"(",
"currentScene",
"=",
"scene1",
")",
";",
"default",
":",... | Return the next scene to be displayed. | [
"Return",
"the",
"next",
"scene",
"to",
"be",
"displayed",
"."
] | e3e21b2c1992708992dfeab5970b0f5a3f8f98e0 | https://github.com/google/marzipano/blob/e3e21b2c1992708992dfeab5970b0f5a3f8f98e0/demos/transitions/index.js#L65-L71 |
6,802 | google/marzipano | demos/video/index.js | tryStart | function tryStart() {
if (started) {
return;
}
started = true;
var video = document.createElement('video');
video.src = '//www.marzipano.net/media/video/mercedes-f1-1280x640.mp4';
video.crossOrigin = 'anonymous';
video.autoplay = true;
video.loop = true;
// Prevent the video from going full scr... | javascript | function tryStart() {
if (started) {
return;
}
started = true;
var video = document.createElement('video');
video.src = '//www.marzipano.net/media/video/mercedes-f1-1280x640.mp4';
video.crossOrigin = 'anonymous';
video.autoplay = true;
video.loop = true;
// Prevent the video from going full scr... | [
"function",
"tryStart",
"(",
")",
"{",
"if",
"(",
"started",
")",
"{",
"return",
";",
"}",
"started",
"=",
"true",
";",
"var",
"video",
"=",
"document",
".",
"createElement",
"(",
"'video'",
")",
";",
"video",
".",
"src",
"=",
"'//www.marzipano.net/media... | Try to start playback. | [
"Try",
"to",
"start",
"playback",
"."
] | e3e21b2c1992708992dfeab5970b0f5a3f8f98e0 | https://github.com/google/marzipano/blob/e3e21b2c1992708992dfeab5970b0f5a3f8f98e0/demos/video/index.js#L59-L83 |
6,803 | google/marzipano | demos/video/index.js | waitForReadyState | function waitForReadyState(element, readyState, interval, done) {
var timer = setInterval(function() {
if (element.readyState >= readyState) {
clearInterval(timer);
done(null, true);
}
}, interval);
} | javascript | function waitForReadyState(element, readyState, interval, done) {
var timer = setInterval(function() {
if (element.readyState >= readyState) {
clearInterval(timer);
done(null, true);
}
}, interval);
} | [
"function",
"waitForReadyState",
"(",
"element",
",",
"readyState",
",",
"interval",
",",
"done",
")",
"{",
"var",
"timer",
"=",
"setInterval",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"element",
".",
"readyState",
">=",
"readyState",
")",
"{",
"clearInt... | Wait for an element to reach the given readyState by polling. The HTML5 video element exposes a `readystatechange` event that could be listened for instead, but it seems to be unreliable on some browsers. | [
"Wait",
"for",
"an",
"element",
"to",
"reach",
"the",
"given",
"readyState",
"by",
"polling",
".",
"The",
"HTML5",
"video",
"element",
"exposes",
"a",
"readystatechange",
"event",
"that",
"could",
"be",
"listened",
"for",
"instead",
"but",
"it",
"seems",
"to... | e3e21b2c1992708992dfeab5970b0f5a3f8f98e0 | https://github.com/google/marzipano/blob/e3e21b2c1992708992dfeab5970b0f5a3f8f98e0/demos/video/index.js#L88-L95 |
6,804 | google/marzipano | src/util/clearOwnProperties.js | clearOwnProperties | function clearOwnProperties(obj) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
obj[prop] = undefined;
}
}
} | javascript | function clearOwnProperties(obj) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
obj[prop] = undefined;
}
}
} | [
"function",
"clearOwnProperties",
"(",
"obj",
")",
"{",
"for",
"(",
"var",
"prop",
"in",
"obj",
")",
"{",
"if",
"(",
"obj",
".",
"hasOwnProperty",
"(",
"prop",
")",
")",
"{",
"obj",
"[",
"prop",
"]",
"=",
"undefined",
";",
"}",
"}",
"}"
] | Sets an object's own properties to undefined. This may be called by destructors to avoid retaining references and help detect incorrect use of destroyed instances. | [
"Sets",
"an",
"object",
"s",
"own",
"properties",
"to",
"undefined",
".",
"This",
"may",
"be",
"called",
"by",
"destructors",
"to",
"avoid",
"retaining",
"references",
"and",
"help",
"detect",
"incorrect",
"use",
"of",
"destroyed",
"instances",
"."
] | e3e21b2c1992708992dfeab5970b0f5a3f8f98e0 | https://github.com/google/marzipano/blob/e3e21b2c1992708992dfeab5970b0f5a3f8f98e0/src/util/clearOwnProperties.js#L21-L27 |
6,805 | haraka/Haraka | plugins/data.uribl.js | do_replyto_header | function do_replyto_header (cb) {
const replyto = trans.header.get('reply-to');
const rmatch = email_re.exec(replyto);
if (rmatch) {
return plugin.do_lookups(connection, cb, rmatch[1], 'replyto');
}
cb();
} | javascript | function do_replyto_header (cb) {
const replyto = trans.header.get('reply-to');
const rmatch = email_re.exec(replyto);
if (rmatch) {
return plugin.do_lookups(connection, cb, rmatch[1], 'replyto');
}
cb();
} | [
"function",
"do_replyto_header",
"(",
"cb",
")",
"{",
"const",
"replyto",
"=",
"trans",
".",
"header",
".",
"get",
"(",
"'reply-to'",
")",
";",
"const",
"rmatch",
"=",
"email_re",
".",
"exec",
"(",
"replyto",
")",
";",
"if",
"(",
"rmatch",
")",
"{",
... | Reply-To header | [
"Reply",
"-",
"To",
"header"
] | 4aea44d56834a1a4be78c56b646a6c266aa7d7b5 | https://github.com/haraka/Haraka/blob/4aea44d56834a1a4be78c56b646a6c266aa7d7b5/plugins/data.uribl.js#L332-L339 |
6,806 | haraka/Haraka | plugins/data.uribl.js | do_msgid_header | function do_msgid_header (cb) {
const msgid = trans.header.get('message-id');
const mmatch = /@([^>]+)>/.exec(msgid);
if (mmatch) {
return plugin.do_lookups(connection, cb, mmatch[1], 'msgid');
}
cb();
} | javascript | function do_msgid_header (cb) {
const msgid = trans.header.get('message-id');
const mmatch = /@([^>]+)>/.exec(msgid);
if (mmatch) {
return plugin.do_lookups(connection, cb, mmatch[1], 'msgid');
}
cb();
} | [
"function",
"do_msgid_header",
"(",
"cb",
")",
"{",
"const",
"msgid",
"=",
"trans",
".",
"header",
".",
"get",
"(",
"'message-id'",
")",
";",
"const",
"mmatch",
"=",
"/",
"@([^>]+)>",
"/",
".",
"exec",
"(",
"msgid",
")",
";",
"if",
"(",
"mmatch",
")"... | Message-Id header | [
"Message",
"-",
"Id",
"header"
] | 4aea44d56834a1a4be78c56b646a6c266aa7d7b5 | https://github.com/haraka/Haraka/blob/4aea44d56834a1a4be78c56b646a6c266aa7d7b5/plugins/data.uribl.js#L342-L349 |
6,807 | haraka/Haraka | outbound/client_pool.js | get_pool | function get_pool (port, host, local_addr, is_unix_socket, max) {
port = port || 25;
host = host || 'localhost';
const name = `outbound::${port}:${host}:${local_addr}:${cfg.pool_timeout}`;
if (!server.notes.pool) server.notes.pool = {};
if (server.notes.pool[name]) return server.notes.pool[name];
... | javascript | function get_pool (port, host, local_addr, is_unix_socket, max) {
port = port || 25;
host = host || 'localhost';
const name = `outbound::${port}:${host}:${local_addr}:${cfg.pool_timeout}`;
if (!server.notes.pool) server.notes.pool = {};
if (server.notes.pool[name]) return server.notes.pool[name];
... | [
"function",
"get_pool",
"(",
"port",
",",
"host",
",",
"local_addr",
",",
"is_unix_socket",
",",
"max",
")",
"{",
"port",
"=",
"port",
"||",
"25",
";",
"host",
"=",
"host",
"||",
"'localhost'",
";",
"const",
"name",
"=",
"`",
"${",
"port",
"}",
"${",... | Separate pools are kept for each set of server attributes. | [
"Separate",
"pools",
"are",
"kept",
"for",
"each",
"set",
"of",
"server",
"attributes",
"."
] | 4aea44d56834a1a4be78c56b646a6c266aa7d7b5 | https://github.com/haraka/Haraka/blob/4aea44d56834a1a4be78c56b646a6c266aa7d7b5/outbound/client_pool.js#L47-L92 |
6,808 | haraka/Haraka | outbound/hmail.js | sort_mx | function sort_mx (mx_list) {
const sorted = mx_list.sort((a,b) => a.priority - b.priority);
// This isn't a very good shuffle but it'll do for now.
for (let i=0,l=sorted.length-1; i<l; i++) {
if (sorted[i].priority === sorted[i+1].priority) {
if (Math.round(Math.random())) { // 0 or 1
... | javascript | function sort_mx (mx_list) {
const sorted = mx_list.sort((a,b) => a.priority - b.priority);
// This isn't a very good shuffle but it'll do for now.
for (let i=0,l=sorted.length-1; i<l; i++) {
if (sorted[i].priority === sorted[i+1].priority) {
if (Math.round(Math.random())) { // 0 or 1
... | [
"function",
"sort_mx",
"(",
"mx_list",
")",
"{",
"const",
"sorted",
"=",
"mx_list",
".",
"sort",
"(",
"(",
"a",
",",
"b",
")",
"=>",
"a",
".",
"priority",
"-",
"b",
".",
"priority",
")",
";",
"// This isn't a very good shuffle but it'll do for now.",
"for",
... | MXs must be sorted by priority order, but matched priorities must be randomly shuffled in that list, so this is a bit complex. | [
"MXs",
"must",
"be",
"sorted",
"by",
"priority",
"order",
"but",
"matched",
"priorities",
"must",
"be",
"randomly",
"shuffled",
"in",
"that",
"list",
"so",
"this",
"is",
"a",
"bit",
"complex",
"."
] | 4aea44d56834a1a4be78c56b646a6c266aa7d7b5 | https://github.com/haraka/Haraka/blob/4aea44d56834a1a4be78c56b646a6c266aa7d7b5/outbound/hmail.js#L1458-L1472 |
6,809 | haraka/Haraka | server.js | setupListener | function setupListener (host_port, listenerDone) {
const hp = /^\[?([^\]]+)\]?:(\d+)$/.exec(host_port);
if (!hp) return listenerDone(
new Error('Invalid "listen" format in smtp.ini'));
const host = hp[1];
const port = parseInt(hp[2], 10);
Se... | javascript | function setupListener (host_port, listenerDone) {
const hp = /^\[?([^\]]+)\]?:(\d+)$/.exec(host_port);
if (!hp) return listenerDone(
new Error('Invalid "listen" format in smtp.ini'));
const host = hp[1];
const port = parseInt(hp[2], 10);
Se... | [
"function",
"setupListener",
"(",
"host_port",
",",
"listenerDone",
")",
"{",
"const",
"hp",
"=",
"/",
"^\\[?([^\\]]+)\\]?:(\\d+)$",
"/",
".",
"exec",
"(",
"host_port",
")",
";",
"if",
"(",
"!",
"hp",
")",
"return",
"listenerDone",
"(",
"new",
"Error",
"("... | array of listeners | [
"array",
"of",
"listeners"
] | 4aea44d56834a1a4be78c56b646a6c266aa7d7b5 | https://github.com/haraka/Haraka/blob/4aea44d56834a1a4be78c56b646a6c266aa7d7b5/server.js#L388-L425 |
6,810 | aspnet/SignalR | clients/cpp/samples/SignalRServer/Scripts/jquery.signalR-2.2.0.js | map | function map(arr, fun, thisp) {
var i,
length = arr.length,
result = [];
for (i = 0; i < length; i += 1) {
if (arr.hasOwnProperty(i)) {
result[i] = fun.call(thisp, arr[i], i, arr);
}
}
return result;
} | javascript | function map(arr, fun, thisp) {
var i,
length = arr.length,
result = [];
for (i = 0; i < length; i += 1) {
if (arr.hasOwnProperty(i)) {
result[i] = fun.call(thisp, arr[i], i, arr);
}
}
return result;
} | [
"function",
"map",
"(",
"arr",
",",
"fun",
",",
"thisp",
")",
"{",
"var",
"i",
",",
"length",
"=",
"arr",
".",
"length",
",",
"result",
"=",
"[",
"]",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"+=",
"1",
")",
"{",
... | Equivalent to Array.prototype.map | [
"Equivalent",
"to",
"Array",
".",
"prototype",
".",
"map"
] | 8c6ed160d84f58ce8edf06a1c74221ddc8983ee9 | https://github.com/aspnet/SignalR/blob/8c6ed160d84f58ce8edf06a1c74221ddc8983ee9/clients/cpp/samples/SignalRServer/Scripts/jquery.signalR-2.2.0.js#L2518-L2528 |
6,811 | eKoopmans/html2pdf.js | dist/html2pdf.js | unitConvert | function unitConvert(obj, k) {
if (objType(obj) === 'number') {
return obj * 72 / 96 / k;
} else {
var newObj = {};
for (var key in obj) {
newObj[key] = obj[key] * 72 / 96 / k;
}
return newObj;
}
} | javascript | function unitConvert(obj, k) {
if (objType(obj) === 'number') {
return obj * 72 / 96 / k;
} else {
var newObj = {};
for (var key in obj) {
newObj[key] = obj[key] * 72 / 96 / k;
}
return newObj;
}
} | [
"function",
"unitConvert",
"(",
"obj",
",",
"k",
")",
"{",
"if",
"(",
"objType",
"(",
"obj",
")",
"===",
"'number'",
")",
"{",
"return",
"obj",
"*",
"72",
"/",
"96",
"/",
"k",
";",
"}",
"else",
"{",
"var",
"newObj",
"=",
"{",
"}",
";",
"for",
... | Convert units from px using the conversion value 'k' from jsPDF. | [
"Convert",
"units",
"from",
"px",
"using",
"the",
"conversion",
"value",
"k",
"from",
"jsPDF",
"."
] | 9bbe4b35b76896a78a428a62af553c633040ad90 | https://github.com/eKoopmans/html2pdf.js/blob/9bbe4b35b76896a78a428a62af553c633040ad90/dist/html2pdf.js#L110-L120 |
6,812 | eKoopmans/html2pdf.js | dist/html2pdf.js | html2pdf | function html2pdf(src, opt) {
// Create a new worker with the given options.
var worker = new html2pdf.Worker(opt);
if (src) {
// If src is specified, perform the traditional 'simple' operation.
return worker.from(src).save();
} else {
// Otherwise, return the worker for new Promise-based operation... | javascript | function html2pdf(src, opt) {
// Create a new worker with the given options.
var worker = new html2pdf.Worker(opt);
if (src) {
// If src is specified, perform the traditional 'simple' operation.
return worker.from(src).save();
} else {
// Otherwise, return the worker for new Promise-based operation... | [
"function",
"html2pdf",
"(",
"src",
",",
"opt",
")",
"{",
"// Create a new worker with the given options.",
"var",
"worker",
"=",
"new",
"html2pdf",
".",
"Worker",
"(",
"opt",
")",
";",
"if",
"(",
"src",
")",
"{",
"// If src is specified, perform the traditional 'si... | Generate a PDF from an HTML element or string using html2canvas and jsPDF.
@param {Element|string} source The source element or HTML string.
@param {Object=} opt An object of optional settings: 'margin', 'filename',
'image' ('type' and 'quality'), and 'html2canvas' / 'jspdf', which are
sent as settings to their corres... | [
"Generate",
"a",
"PDF",
"from",
"an",
"HTML",
"element",
"or",
"string",
"using",
"html2canvas",
"and",
"jsPDF",
"."
] | 9bbe4b35b76896a78a428a62af553c633040ad90 | https://github.com/eKoopmans/html2pdf.js/blob/9bbe4b35b76896a78a428a62af553c633040ad90/dist/html2pdf.js#L906-L917 |
6,813 | eKoopmans/html2pdf.js | gulpfile.js | mergeBranch | function mergeBranch(branch) {
var mergeCmd = 'git merge --no-ff --no-edit ' + branch;
console.log('Merging release into master.')
return exec('git checkout master && ' + mergeCmd).then(function() {
console.log('Merging release into develop.')
return exec('git checkout develop && ' + mergeCmd);
});
} | javascript | function mergeBranch(branch) {
var mergeCmd = 'git merge --no-ff --no-edit ' + branch;
console.log('Merging release into master.')
return exec('git checkout master && ' + mergeCmd).then(function() {
console.log('Merging release into develop.')
return exec('git checkout develop && ' + mergeCmd);
});
} | [
"function",
"mergeBranch",
"(",
"branch",
")",
"{",
"var",
"mergeCmd",
"=",
"'git merge --no-ff --no-edit '",
"+",
"branch",
";",
"console",
".",
"log",
"(",
"'Merging release into master.'",
")",
"return",
"exec",
"(",
"'git checkout master && '",
"+",
"mergeCmd",
... | Merge the specified branch back into master and develop. | [
"Merge",
"the",
"specified",
"branch",
"back",
"into",
"master",
"and",
"develop",
"."
] | 9bbe4b35b76896a78a428a62af553c633040ad90 | https://github.com/eKoopmans/html2pdf.js/blob/9bbe4b35b76896a78a428a62af553c633040ad90/gulpfile.js#L28-L36 |
6,814 | davidmerfield/randomColor | randomColor.js | getRealHueRange | function getRealHueRange(colorHue)
{ if (!isNaN(colorHue)) {
var number = parseInt(colorHue);
if (number < 360 && number > 0) {
return getColorInfo(colorHue).hueRange
}
}
else if (typeof colorHue === 'string') {
if (colorDictionary[colorHue]) {
var color = colorDictionary[color... | javascript | function getRealHueRange(colorHue)
{ if (!isNaN(colorHue)) {
var number = parseInt(colorHue);
if (number < 360 && number > 0) {
return getColorInfo(colorHue).hueRange
}
}
else if (typeof colorHue === 'string') {
if (colorDictionary[colorHue]) {
var color = colorDictionary[color... | [
"function",
"getRealHueRange",
"(",
"colorHue",
")",
"{",
"if",
"(",
"!",
"isNaN",
"(",
"colorHue",
")",
")",
"{",
"var",
"number",
"=",
"parseInt",
"(",
"colorHue",
")",
";",
"if",
"(",
"number",
"<",
"360",
"&&",
"number",
">",
"0",
")",
"{",
"re... | get The range of given hue when options.count!=0 | [
"get",
"The",
"range",
"of",
"given",
"hue",
"when",
"options",
".",
"count!",
"=",
"0"
] | 5e0cdb4d84a214ccc10e4ad3c2308ed09549bede | https://github.com/davidmerfield/randomColor/blob/5e0cdb4d84a214ccc10e4ad3c2308ed09549bede/randomColor.js#L494-L517 |
6,815 | abouolia/sticky-sidebar | src/jquery.sticky-sidebar.js | _jQueryPlugin | function _jQueryPlugin(config){
return this.each(function(){
var $this = plugin(this),
data = plugin(this).data(DATA_NAMESPACE);
if( ! data ){
data = new StickySidebar(this, typeof config == 'object' && config);
$this.data(DATA_NAMESPACE, data);
}
... | javascript | function _jQueryPlugin(config){
return this.each(function(){
var $this = plugin(this),
data = plugin(this).data(DATA_NAMESPACE);
if( ! data ){
data = new StickySidebar(this, typeof config == 'object' && config);
$this.data(DATA_NAMESPACE, data);
}
... | [
"function",
"_jQueryPlugin",
"(",
"config",
")",
"{",
"return",
"this",
".",
"each",
"(",
"function",
"(",
")",
"{",
"var",
"$this",
"=",
"plugin",
"(",
"this",
")",
",",
"data",
"=",
"plugin",
"(",
"this",
")",
".",
"data",
"(",
"DATA_NAMESPACE",
")... | Sticky Sidebar Plugin Defintion.
@param {Object|String} - config | [
"Sticky",
"Sidebar",
"Plugin",
"Defintion",
"."
] | bcd40bbf95e84b75916bc3535d7475447f9383f8 | https://github.com/abouolia/sticky-sidebar/blob/bcd40bbf95e84b75916bc3535d7475447f9383f8/src/jquery.sticky-sidebar.js#L15-L32 |
6,816 | pissang/claygl | src/util/sh.js | projectEnvironmentMapGPU | function projectEnvironmentMapGPU(renderer, envMap) {
var shTexture = new Texture2D({
width: 9,
height: 1,
type: Texture.FLOAT
});
var pass = new Pass({
fragment: projectEnvMapShaderCode
});
pass.material.define('fragment', 'TEXTURE_SIZE', envMap.width);
pass.setU... | javascript | function projectEnvironmentMapGPU(renderer, envMap) {
var shTexture = new Texture2D({
width: 9,
height: 1,
type: Texture.FLOAT
});
var pass = new Pass({
fragment: projectEnvMapShaderCode
});
pass.material.define('fragment', 'TEXTURE_SIZE', envMap.width);
pass.setU... | [
"function",
"projectEnvironmentMapGPU",
"(",
"renderer",
",",
"envMap",
")",
"{",
"var",
"shTexture",
"=",
"new",
"Texture2D",
"(",
"{",
"width",
":",
"9",
",",
"height",
":",
"1",
",",
"type",
":",
"Texture",
".",
"FLOAT",
"}",
")",
";",
"var",
"pass"... | Project on gpu, but needs browser to support readPixels as Float32Array. | [
"Project",
"on",
"gpu",
"but",
"needs",
"browser",
"to",
"support",
"readPixels",
"as",
"Float32Array",
"."
] | b157bb50cf8c725fa20f90ebb55481352777f0a7 | https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/util/sh.js#L19-L51 |
6,817 | pissang/claygl | src/util/sh.js | projectEnvironmentMapCPU | function projectEnvironmentMapCPU(renderer, cubePixels, width, height) {
var coeff = new vendor.Float32Array(9 * 3);
var normal = vec3.create();
var texel = vec3.create();
var fetchNormal = vec3.create();
for (var m = 0; m < 9; m++) {
var result = vec3.create();
for (var k = 0; k < t... | javascript | function projectEnvironmentMapCPU(renderer, cubePixels, width, height) {
var coeff = new vendor.Float32Array(9 * 3);
var normal = vec3.create();
var texel = vec3.create();
var fetchNormal = vec3.create();
for (var m = 0; m < 9; m++) {
var result = vec3.create();
for (var k = 0; k < t... | [
"function",
"projectEnvironmentMapCPU",
"(",
"renderer",
",",
"cubePixels",
",",
"width",
",",
"height",
")",
"{",
"var",
"coeff",
"=",
"new",
"vendor",
".",
"Float32Array",
"(",
"9",
"*",
"3",
")",
";",
"var",
"normal",
"=",
"vec3",
".",
"create",
"(",
... | Project on cpu. | [
"Project",
"on",
"cpu",
"."
] | b157bb50cf8c725fa20f90ebb55481352777f0a7 | https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/util/sh.js#L97-L146 |
6,818 | pissang/claygl | src/GeometryBase.js | function () {
var enabledAttributes = this.getEnabledAttributes();
for (var i = 0; i < enabledAttributes.length; i++) {
this.dirtyAttribute(enabledAttributes[i]);
}
this.dirtyIndices();
this._enabledAttributes = null;
this._cache.dirty('any');
} | javascript | function () {
var enabledAttributes = this.getEnabledAttributes();
for (var i = 0; i < enabledAttributes.length; i++) {
this.dirtyAttribute(enabledAttributes[i]);
}
this.dirtyIndices();
this._enabledAttributes = null;
this._cache.dirty('any');
} | [
"function",
"(",
")",
"{",
"var",
"enabledAttributes",
"=",
"this",
".",
"getEnabledAttributes",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"enabledAttributes",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"dirtyAttribute"... | Mark attributes and indices in geometry needs to update.
Usually called after you change the data in attributes. | [
"Mark",
"attributes",
"and",
"indices",
"in",
"geometry",
"needs",
"to",
"update",
".",
"Usually",
"called",
"after",
"you",
"change",
"the",
"data",
"in",
"attributes",
"."
] | b157bb50cf8c725fa20f90ebb55481352777f0a7 | https://github.com/pissang/claygl/blob/b157bb50cf8c725fa20f90ebb55481352777f0a7/src/GeometryBase.js#L327-L336 | |
6,819 | 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 | |
6,820 | 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 | |
6,821 | 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 | |
6,822 | 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 | |
6,823 | 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 | |
6,824 | 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 | |
6,825 | 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 | |
6,826 | 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 |
6,827 | 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 | |
6,828 | 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 |
6,829 | 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 | |
6,830 | 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 | |
6,831 | 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 | |
6,832 | 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 | |
6,833 | 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 | |
6,834 | 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 | |
6,835 | 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 | |
6,836 | 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 | |
6,837 | 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 | |
6,838 | 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 | |
6,839 | 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 | |
6,840 | 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 | |
6,841 | 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 |
6,842 | 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 | |
6,843 | 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 | |
6,844 | 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 | |
6,845 | 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 | |
6,846 | 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 | |
6,847 | 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 | |
6,848 | 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 | |
6,849 | 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 | |
6,850 | 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 | |
6,851 | 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 | |
6,852 | 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 | |
6,853 | 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 | |
6,854 | 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 | |
6,855 | 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 | |
6,856 | 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 | |
6,857 | 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 | |
6,858 | 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 | |
6,859 | 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 | |
6,860 | 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 | |
6,861 | 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 | |
6,862 | 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 | |
6,863 | 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 | |
6,864 | 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 | |
6,865 | 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 | |
6,866 | 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 | |
6,867 | 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 | |
6,868 | 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 | |
6,869 | 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 | |
6,870 | 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 | |
6,871 | 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 | |
6,872 | 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 | |
6,873 | 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 | |
6,874 | 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 | |
6,875 | 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 | |
6,876 | 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 | |
6,877 | 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 | |
6,878 | 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 | |
6,879 | 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 | |
6,880 | 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 | |
6,881 | 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 | |
6,882 | 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 | |
6,883 | 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 | |
6,884 | 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 | |
6,885 | 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 | |
6,886 | 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 | |
6,887 | 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 | |
6,888 | 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 | |
6,889 | 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 | |
6,890 | 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 | |
6,891 | 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 | |
6,892 | 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 | |
6,893 | 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 | |
6,894 | 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 | |
6,895 | 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 | |
6,896 | 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 | |
6,897 | 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 | |
6,898 | 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 | |
6,899 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.