code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
serializeSubtags = function (e, tags) {
var i, j, fa
for (i = 0; i < tags.length; i++) {
fa = e[byTag](tags[i])
for (j = 0; j < fa.length; j++) serial(fa[j], cb)
}
} | `fail` will execute when the request fails | serializeSubtags | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function serializeQueryString() {
return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))
} | `fail` will execute when the request fails | serializeQueryString | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function serializeHash() {
var hash = {}
eachFormElement.apply(function (name, value) {
if (name in hash) {
hash[name] && !isArray(hash[name]) && (hash[name] = [hash[name]])
hash[name].push(value)
} else hash[name] = value
}, arguments)
return hash
} | `fail` will execute when the request fails | serializeHash | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
add = function (key, value) {
// If value is a function, invoke it and return its value
value = ('function' === typeof value) ? value() : (value == null ? '' : value)
s[s.length] = enc(key) + '=' + enc(value)
} | `fail` will execute when the request fails | add | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function buildParams(prefix, obj, traditional, add) {
var name, i, v
, rbracket = /\[\]$/
if (isArray(obj)) {
// Serialize array item.
for (i = 0; obj && i < obj.length; i++) {
v = obj[i]
if (traditional || rbracket.test(prefix)) {
// Treat each array item a... | `fail` will execute when the request fails | buildParams | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function normalize(gj) {
if (!gj || !gj.type) return null;
var type = types[gj.type];
if (!type) return null;
if (type === 'geometry') {
return {
type: 'FeatureCollection',
features: [{
type: 'Feature',
properties: {},
... | Normalize a GeoJSON feature into a FeatureCollection.
@param {object} gj geojson data
@returns {object} normalized geojson data | normalize | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
get x () {
return this._x;
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | x | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set x ( value ) {
this._x = value;
this.onChangeCallback();
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | x | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get y () {
return this._y;
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | y | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set y ( value ) {
this._y = value;
this.onChangeCallback();
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | y | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get z () {
return this._z;
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | z | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set z ( value ) {
this._z = value;
this.onChangeCallback();
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | z | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get w () {
return this._w;
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | w | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set w ( value ) {
this._w = value;
this.onChangeCallback();
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | w | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get width() {
return this.x;
} | @author mrdoob / http://mrdoob.com/
@author philogb / http://blog.thejit.org/
@author egraether / http://egraether.com/
@author zz85 / http://www.lab4games.net/zz85/blog | width | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set width( value ) {
this.x = value;
} | @author mrdoob / http://mrdoob.com/
@author philogb / http://blog.thejit.org/
@author egraether / http://egraether.com/
@author zz85 / http://www.lab4games.net/zz85/blog | width | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get height() {
return this.y;
} | @author mrdoob / http://mrdoob.com/
@author philogb / http://blog.thejit.org/
@author egraether / http://egraether.com/
@author zz85 / http://www.lab4games.net/zz85/blog | height | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set height( value ) {
this.y = value;
} | @author mrdoob / http://mrdoob.com/
@author philogb / http://blog.thejit.org/
@author egraether / http://egraether.com/
@author zz85 / http://www.lab4games.net/zz85/blog | height | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get x () {
return this._x;
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | x | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set x ( value ) {
this._x = value;
this.onChangeCallback();
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | x | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get y () {
return this._y;
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | y | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set y ( value ) {
this._y = value;
this.onChangeCallback();
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | y | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get z () {
return this._z;
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | z | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set z ( value ) {
this._z = value;
this.onChangeCallback();
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | z | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get order () {
return this._order;
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | order | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set order ( value ) {
this._order = value;
this.onChangeCallback();
} | @author mrdoob / http://mrdoob.com/
@author WestLangley / http://github.com/WestLangley
@author bhouston / http://clara.io | order | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function interpolate( p0, p1, p2, p3, t, t2, t3 ) {
var v0 = ( p2 - p0 ) * 0.5,
v1 = ( p3 - p1 ) * 0.5;
return ( 2 * ( p1 - p2 ) + v0 + v1 ) * t3 + ( - 3 * ( p1 - p2 ) - 2 * v0 - v1 ) * t2 + v0 * t + p1;
} | Spline from Tween.js, slightly optimized (and trashed)
http://sole.github.com/tween.js/examples/05_spline.html
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | interpolate | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function ascSort( a, b ) {
return a.distance - b.distance;
} | @author mrdoob / http://mrdoob.com/
@author bhouston / http://clara.io/
@author stephomi / http://stephaneginier.com/ | ascSort | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function intersectObject( object, raycaster, intersects, recursive ) {
if ( object.visible === false ) return;
object.raycast( raycaster, intersects );
if ( recursive === true ) {
var children = object.children;
for ( var i = 0, l = children.length; i < l; i ++ ) {
intersectObject( children[ i ], ... | @author mrdoob / http://mrdoob.com/
@author bhouston / http://clara.io/
@author stephomi / http://stephaneginier.com/ | intersectObject | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function onRotationChange() {
quaternion.setFromEuler( rotation, false );
} | @author mrdoob / http://mrdoob.com/
@author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author elephantatwork / www.elephantatwork.ch | onRotationChange | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function onQuaternionChange() {
rotation.setFromQuaternion( quaternion, undefined, false );
} | @author mrdoob / http://mrdoob.com/
@author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author elephantatwork / www.elephantatwork.ch | onQuaternionChange | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function extractFromCache ( cache ) {
var values = [];
for ( var key in cache ) {
var data = cache[ key ];
delete data.metadata;
values.push( data );
}
return values;
} | @author mrdoob / http://mrdoob.com/
@author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author elephantatwork / www.elephantatwork.ch | extractFromCache | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function addFace( a, b, c, materialIndex ) {
var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : [];
var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : [];
v... | @author mrdoob / http://mrdoob.com/
@author kile / http://kile.stravaganza.org/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author zz85 / http://www.lab4games.net/zz85/blog
@author bhouston / http://clara.io | addFace | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function materialIndexSort( a, b ) {
return a.materialIndex - b.materialIndex;
} | @author mrdoob / http://mrdoob.com/
@author kile / http://kile.stravaganza.org/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author zz85 / http://www.lab4games.net/zz85/blog
@author bhouston / http://clara.io | materialIndexSort | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setBit( value, position, enabled ) {
return enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position ) );
} | @author mrdoob / http://mrdoob.com/
@author kile / http://kile.stravaganza.org/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author zz85 / http://www.lab4games.net/zz85/blog
@author bhouston / http://clara.io | setBit | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getNormalIndex( normal ) {
var hash = normal.x.toString() + normal.y.toString() + normal.z.toString();
if ( normalsHash[ hash ] !== undefined ) {
return normalsHash[ hash ];
}
normalsHash[ hash ] = normals.length / 3;
normals.push( normal.x, normal.y, normal.z );
return normalsHash[... | @author mrdoob / http://mrdoob.com/
@author kile / http://kile.stravaganza.org/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author zz85 / http://www.lab4games.net/zz85/blog
@author bhouston / http://clara.io | getNormalIndex | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getColorIndex( color ) {
var hash = color.r.toString() + color.g.toString() + color.b.toString();
if ( colorsHash[ hash ] !== undefined ) {
return colorsHash[ hash ];
}
colorsHash[ hash ] = colors.length;
colors.push( color.getHex() );
return colorsHash[ hash ];
} | @author mrdoob / http://mrdoob.com/
@author kile / http://kile.stravaganza.org/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author zz85 / http://www.lab4games.net/zz85/blog
@author bhouston / http://clara.io | getColorIndex | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getUvIndex( uv ) {
var hash = uv.x.toString() + uv.y.toString();
if ( uvsHash[ hash ] !== undefined ) {
return uvsHash[ hash ];
}
uvsHash[ hash ] = uvs.length / 2;
uvs.push( uv.x, uv.y );
return uvsHash[ hash ];
} | @author mrdoob / http://mrdoob.com/
@author kile / http://kile.stravaganza.org/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author zz85 / http://www.lab4games.net/zz85/blog
@author bhouston / http://clara.io | getUvIndex | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
addNonemptyTrack = function(
trackType, trackName, animationKeys, propertyName, destTracks ) {
// only return track if there are actually keys.
if ( animationKeys.length !== 0 ) {
var times = [];
var values = [];
THREE.AnimationUtils.flattenJSON(
animationKeys, times, values, propertyName... | Reusable set of Tracks that represent an animation.
@author Ben Houston / http://clara.io/
@author David Sarno / http://lighthaus.us/ | addNonemptyTrack | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function compareTime( i, j ) {
return times[ i ] - times[ j ];
} | @author tschw
@author Ben Houston / http://clara.io/
@author David Sarno / http://lighthaus.us/ | compareTime | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
searchSkeleton = function( skeleton ) {
for( var i = 0; i < skeleton.bones.length; i ++ ) {
var bone = skeleton.bones[i];
if( bone.name === nodeName ) {
return bone;
}
}
return null;
} | A reference to a real property in the scene graph.
@author Ben Houston / http://clara.io/
@author David Sarno / http://lighthaus.us/
@author tschw | searchSkeleton | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
searchNodeSubtree = function( children ) {
for( var i = 0; i < children.length; i ++ ) {
var childNode = children[i];
if( childNode.name === nodeName || childNode.uuid === nodeName ) {
return childNode;
}
var result = searchNodeSubtree( childNode.children );
if( result ) return result... | A reference to a real property in the scene graph.
@author Ben Houston / http://clara.io/
@author David Sarno / http://lighthaus.us/
@author tschw | searchNodeSubtree | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get statusDomElement () {
if ( this._statusDomElement === undefined ) {
this._statusDomElement = document.createElement( 'div' );
}
console.warn( 'THREE.JSONLoader: .statusDomElement has been removed.' );
return this._statusDomElement;
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | statusDomElement | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function parseModel( scale ) {
function isBitSet( value, position ) {
return value & ( 1 << position );
}
var i, j, fi,
offset, zLength,
colorIndex, normalIndex, uvIndex, materialIndex,
type,
isQuad,
hasMaterial,
hasFaceVertexUv,
hasFaceNormal, hasFaceVertexNormal,
hasFaceColo... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | parseModel | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isBitSet( value, position ) {
return value & ( 1 << position );
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | isBitSet | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function parseSkin() {
var influencesPerVertex = ( json.influencesPerVertex !== undefined ) ? json.influencesPerVertex : 2;
if ( json.skinWeights ) {
for ( var i = 0, l = json.skinWeights.length; i < l; i += influencesPerVertex ) {
var x = json.skinWeights[ i ];
var... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | parseSkin | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function parseMorphing( scale ) {
if ( json.morphTargets !== undefined ) {
for ( var i = 0, l = json.morphTargets.length; i < l; i ++ ) {
geometry.morphTargets[ i ] = {};
geometry.morphTargets[ i ].name = json.morphTargets[ i ].name;
geometry.morphTargets[ i ].vertices = [];
var dstVertic... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | parseMorphing | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function parseAnimations() {
var outputAnimations = [];
// parse old style Bone/Hierarchy animations
var animations = [];
if ( json.animation !== undefined ) {
animations.push( json.animation );
}
if ( json.animations !== undefined ) {
if ( json.animations.length ) {
animations = ... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | parseAnimations | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function loadTexture( i ) {
loader.load( url[ i ], function ( buffer ) {
var texDatas = scope._parser( buffer, true );
images[ i ] = {
width: texDatas.width,
height: texDatas.height,
format: texDatas.format,
mipmaps: texDatas.mipmaps
};
loaded += 1;
if ( loaded === 6 ) {
... | @author mrdoob / http://mrdoob.com/
Abstract Base class to block based textures loader (dds, pvr, ...) | loadTexture | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
get needsUpdate() {
return this._needsUpdate;
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | needsUpdate | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set needsUpdate( value ) {
if ( value === true ) this.update();
this._needsUpdate = value;
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | needsUpdate | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function extractFromCache ( cache ) {
var values = [];
for ( var key in cache ) {
var data = cache[ key ];
delete data.metadata;
values.push( data );
}
return values;
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/ | extractFromCache | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
set needsUpdate( value ) {
if ( value === true ) this.version ++;
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/ | needsUpdate | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getDataURL( image ) {
var canvas;
if ( image.toDataURL !== undefined ) {
canvas = image;
} else {
canvas = document.createElement( 'canvas' );
canvas.width = image.width;
canvas.height = image.height;
canvas.getContext( '2d' ).drawImage( image, 0, 0, image.width, image.height... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/ | getDataURL | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
THREE.Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord );
uv1.multiplyScalar( barycoord.x );
uv2.multiplyScalar( barycoord.y );
uv3.multiplyScalar( barycoord.z );
uv1.add( uv2 ).add( uv3 );
return uv1.clone();
} | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author jonobr1 / http://jonobr1.com/ | uvIntersection | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function checkIntersection( object, raycaster, ray, pA, pB, pC, point ) {
var intersect;
var material = object.material;
if ( material.side === THREE.BackSide ) {
intersect = ray.intersectTriangle( pC, pB, pA, true, point );
} else {
intersect = ray.intersectTriangle( pA, pB, pC, material.side ... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author jonobr1 / http://jonobr1.com/ | checkIntersection | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function checkBufferGeometryIntersection( object, raycaster, ray, positions, uvs, a, b, c ) {
vA.fromArray( positions, a * 3 );
vB.fromArray( positions, b * 3 );
vC.fromArray( positions, c * 3 );
var intersection = checkIntersection( object, raycaster, ray, vA, vB, vC, intersectionPoint );
if ( inters... | @author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author mikael emtinger / http://gomo.se/
@author jonobr1 / http://jonobr1.com/ | checkBufferGeometryIntersection | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getTargetPixelRatio() {
return _currentRenderTarget === null ? _pixelRatio : 1;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | getTargetPixelRatio | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function glClearColor( r, g, b, a ) {
if ( _premultipliedAlpha === true ) {
r *= a; g *= a; b *= a;
}
state.clearColor( r, g, b, a );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | glClearColor | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setDefaultGLState() {
state.init();
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
glClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setDefaultGLState | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function resetGLState() {
_currentProgram = null;
_currentCamera = null;
_currentGeometryProgram = '';
_currentMaterialId = - 1;
state.reset();
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | resetGLState | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function onContextLost( event ) {
event.preventDefault();
resetGLState();
setDefaultGLState();
properties.clear();
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | onContextLost | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function onTextureDispose( event ) {
var texture = event.target;
texture.removeEventListener( 'dispose', onTextureDispose );
deallocateTexture( texture );
_infoMemory.textures --;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | onTextureDispose | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function onRenderTargetDispose( event ) {
var renderTarget = event.target;
renderTarget.removeEventListener( 'dispose', onRenderTargetDispose );
deallocateRenderTarget( renderTarget );
_infoMemory.textures --;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | onRenderTargetDispose | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function onMaterialDispose( event ) {
var material = event.target;
material.removeEventListener( 'dispose', onMaterialDispose );
deallocateMaterial( material );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | onMaterialDispose | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function deallocateTexture( texture ) {
var textureProperties = properties.get( texture );
if ( texture.image && textureProperties.__image__webglTextureCube ) {
// cube texture
_gl.deleteTexture( textureProperties.__image__webglTextureCube );
} else {
// 2D texture
if ( textureProperties.__webg... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | deallocateTexture | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function deallocateRenderTarget( renderTarget ) {
var renderTargetProperties = properties.get( renderTarget );
var textureProperties = properties.get( renderTarget.texture );
if ( ! renderTarget ) return;
if ( textureProperties.__webglTexture !== undefined ) {
_gl.deleteTexture( textureProperties.__webgl... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | deallocateRenderTarget | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function deallocateMaterial( material ) {
releaseMaterialProgramReference( material );
properties.delete( material );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | deallocateMaterial | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function releaseMaterialProgramReference( material ) {
var programInfo = properties.get( material ).program;
material.program = undefined;
if ( programInfo !== undefined ) {
programCache.releaseProgram( programInfo );
}
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | releaseMaterialProgramReference | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupVertexAttributes( material, program, geometry, startIndex ) {
var extension;
if ( geometry instanceof THREE.InstancedBufferGeometry ) {
extension = extensions.get( 'ANGLE_instanced_arrays' );
if ( extension === null ) {
console.error( 'THREE.WebGLRenderer.setupVertexAttributes: using TH... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupVertexAttributes | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function absNumericalSort( a, b ) {
return Math.abs( b[ 0 ] ) - Math.abs( a[ 0 ] );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | absNumericalSort | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function painterSortStable ( a, b ) {
if ( a.object.renderOrder !== b.object.renderOrder ) {
return a.object.renderOrder - b.object.renderOrder;
} else if ( a.material.id !== b.material.id ) {
return a.material.id - b.material.id;
} else if ( a.z !== b.z ) {
return a.z - b.z;
} else {
return... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | painterSortStable | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function reversePainterSortStable ( a, b ) {
if ( a.object.renderOrder !== b.object.renderOrder ) {
return a.object.renderOrder - b.object.renderOrder;
} if ( a.z !== b.z ) {
return b.z - a.z;
} else {
return a.id - b.id;
}
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | reversePainterSortStable | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function pushRenderItem( object, geometry, material, z, group ) {
var array, index;
// allocate the next position in the appropriate array
if ( material.transparent ) {
array = transparentObjects;
index = ++ transparentObjectsLastIndex;
} else {
array = opaqueObjects;
index = ++ opaqueObjectsL... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | pushRenderItem | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isObjectViewable( object ) {
var geometry = object.geometry;
if ( geometry.boundingSphere === null )
geometry.computeBoundingSphere();
_sphere.copy( geometry.boundingSphere ).
applyMatrix4( object.matrixWorld );
return isSphereViewable( _sphere );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | isObjectViewable | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isSpriteViewable( sprite ) {
_sphere.center.set( 0, 0, 0 );
_sphere.radius = 0.7071067811865476;
_sphere.applyMatrix4( sprite.matrixWorld );
return isSphereViewable( _sphere );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | isSpriteViewable | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isSphereViewable( sphere ) {
if ( ! _frustum.intersectsSphere( sphere ) ) return false;
var numPlanes = _clipping.numPlanes;
if ( numPlanes === 0 ) return true;
var planes = _this.clippingPlanes,
center = sphere.center,
negRad = - sphere.radius,
i = 0;
do {
// out when deeper than ... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | isSphereViewable | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function projectObject( object, camera ) {
if ( object.visible === false ) return;
if ( object.layers.test( camera.layers ) ) {
if ( object instanceof THREE.Light ) {
lights.push( object );
} else if ( object instanceof THREE.Sprite ) {
if ( object.frustumCulled === false || isSpriteViewable( ob... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | projectObject | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function renderObjects( renderList, camera, fog, overrideMaterial ) {
for ( var i = 0, l = renderList.length; i < l; i ++ ) {
var renderItem = renderList[ i ];
var object = renderItem.object;
var geometry = renderItem.geometry;
var material = overrideMaterial === undefined ? renderItem.material : overr... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | renderObjects | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function initMaterial( material, fog, object ) {
var materialProperties = properties.get( material );
var parameters = programCache.getParameters(
material, _lights, fog, _clipping.numPlanes, object );
var code = programCache.getProgramCode( material, parameters );
var program = materialProperties.progr... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | initMaterial | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setMaterial( material ) {
if ( material.side !== THREE.DoubleSide )
state.enable( _gl.CULL_FACE );
else
state.disable( _gl.CULL_FACE );
state.setFlipSided( material.side === THREE.BackSide );
if ( material.transparent === true ) {
state.setBlending( material.blending, material.blendEquatio... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setMaterial | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setProgram( camera, fog, material, object ) {
_usedTextureUnits = 0;
var materialProperties = properties.get( material );
if ( _clippingEnabled ) {
if ( _localClippingEnabled || camera !== _currentCamera ) {
var useCache =
camera === _currentCamera &&
material.id === _currentMater... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setProgram | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsCommon ( uniforms, material ) {
uniforms.opacity.value = material.opacity;
uniforms.diffuse.value = material.color;
if ( material.emissive ) {
uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );
}
uniforms.map.value = material.map;
... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsCommon | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsLine ( uniforms, material ) {
uniforms.diffuse.value = material.color;
uniforms.opacity.value = material.opacity;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsLine | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsDash ( uniforms, material ) {
uniforms.dashSize.value = material.dashSize;
uniforms.totalSize.value = material.dashSize + material.gapSize;
uniforms.scale.value = material.scale;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsDash | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsPoints ( uniforms, material ) {
uniforms.diffuse.value = material.color;
uniforms.opacity.value = material.opacity;
uniforms.size.value = material.size * _pixelRatio;
uniforms.scale.value = _canvas.clientHeight * 0.5;
uniforms.map.value = material.map;
if ( material.map !== null )... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsPoints | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsFog ( uniforms, fog ) {
uniforms.fogColor.value = fog.color;
if ( fog instanceof THREE.Fog ) {
uniforms.fogNear.value = fog.near;
uniforms.fogFar.value = fog.far;
} else if ( fog instanceof THREE.FogExp2 ) {
uniforms.fogDensity.value = fog.density;
}
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsFog | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsLambert ( uniforms, material ) {
if ( material.lightMap ) {
uniforms.lightMap.value = material.lightMap;
uniforms.lightMapIntensity.value = material.lightMapIntensity;
}
if ( material.emissiveMap ) {
uniforms.emissiveMap.value = material.emissiveMap;
}
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsLambert | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsPhong ( uniforms, material ) {
uniforms.specular.value = material.specular;
uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )
if ( material.lightMap ) {
uniforms.lightMap.value = material.lightMap;
uniforms.lightMapIntensity.value = mat... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsPhong | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsStandard ( uniforms, material ) {
uniforms.roughness.value = material.roughness;
uniforms.metalness.value = material.metalness;
if ( material.roughnessMap ) {
uniforms.roughnessMap.value = material.roughnessMap;
}
if ( material.metalnessMap ) {
uniforms.metalnessMap.value =... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsStandard | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function refreshUniformsPhysical ( uniforms, material ) {
refreshUniformsStandard( uniforms, material );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | refreshUniformsPhysical | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function markUniformsLightsNeedsUpdate ( uniforms, value ) {
uniforms.ambientLightColor.needsUpdate = value;
uniforms.directionalLights.needsUpdate = value;
uniforms.pointLights.needsUpdate = value;
uniforms.spotLights.needsUpdate = value;
uniforms.hemisphereLights.needsUpdate = value;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | markUniformsLightsNeedsUpdate | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupShadows ( lights ) {
var lightShadowsLength = 0;
for ( var i = 0, l = lights.length; i < l; i ++ ) {
var light = lights[ i ];
if ( light.castShadow ) {
_lights.shadows[ lightShadowsLength ++ ] = light;
}
}
_lights.shadows.length = lightShadowsLength;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupShadows | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupLights ( lights, camera ) {
var l, ll, light,
r = 0, g = 0, b = 0,
color,
intensity,
distance,
shadowMap,
viewMatrix = camera.matrixWorldInverse,
directionalLength = 0,
pointLength = 0,
spotLength = 0,
hemiLength = 0;
for ( l = 0, ll = lights.length; l < ll; l ++ ) {
light ... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupLights | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function allocTextureUnit() {
var textureUnit = _usedTextureUnits;
if ( textureUnit >= capabilities.maxTextures ) {
console.warn( 'WebGLRenderer: trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );
}
_usedTextureUnits += 1;
return textureUnit;
... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | allocTextureUnit | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setTextureParameters ( textureType, texture, isPowerOfTwoImage ) {
var extension;
if ( isPowerOfTwoImage ) {
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, paramThreeToGL( texture.wrapS ) );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, paramThreeToGL( texture.wrapT ) );
_gl.texPara... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setTextureParameters | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function uploadTexture( textureProperties, texture, slot ) {
if ( textureProperties.__webglInit === undefined ) {
textureProperties.__webglInit = true;
texture.addEventListener( 'dispose', onTextureDispose );
textureProperties.__webglTexture = _gl.createTexture();
_infoMemory.textures ++;
}
sta... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | uploadTexture | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setTexture2D( texture, slot ) {
var textureProperties = properties.get( texture );
if ( texture.version > 0 && textureProperties.__version !== texture.version ) {
var image = texture.image;
if ( image === undefined ) {
console.warn( 'THREE.WebGLRenderer: Texture marked for update but image i... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setTexture2D | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function clampToMaxSize ( image, maxSize ) {
if ( image.width > maxSize || image.height > maxSize ) {
// Warning: Scaling through the canvas will only work with images that use
// premultiplied alpha.
var scale = maxSize / Math.max( image.width, image.height );
var canvas = document.createElement( 'ca... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | clampToMaxSize | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isPowerOfTwo( image ) {
return THREE.Math.isPowerOfTwo( image.width ) && THREE.Math.isPowerOfTwo( image.height );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | isPowerOfTwo | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.