Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ THREE.GLTFLoader = ( function () {
/**
* DDS Texture Extension
*
* Specification:
* Specification:
* https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds
*
*
*/
function GLTFTextureDDSExtension() {

Expand Down Expand Up @@ -455,7 +455,7 @@ THREE.GLTFLoader = ( function () {
*
* Specification: https://github.com/KhronosGroup/glTF/pull/874
*/
function GLTFDracoMeshCompressionExtension ( json, dracoLoader ) {
function GLTFDracoMeshCompressionExtension( json, dracoLoader ) {

if ( ! dracoLoader ) {

Expand All @@ -481,7 +481,7 @@ THREE.GLTFLoader = ( function () {

for ( var attributeName in gltfAttributeMap ) {

if ( !( attributeName in ATTRIBUTES ) ) continue;
if ( ! ( attributeName in ATTRIBUTES ) ) continue;

threeAttributeMap[ ATTRIBUTES[ attributeName ] ] = gltfAttributeMap[ attributeName ];

Expand All @@ -494,7 +494,7 @@ THREE.GLTFLoader = ( function () {
var accessorDef = json.accessors[ primitive.attributes[ attributeName ] ];
var componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];

attributeTypeMap[ ATTRIBUTES[ attributeName ] ] = componentType;
attributeTypeMap[ ATTRIBUTES[ attributeName ] ] = componentType;
attributeNormalizedMap[ ATTRIBUTES[ attributeName ] ] = accessorDef.normalized === true;

}
Expand Down Expand Up @@ -934,7 +934,7 @@ THREE.GLTFLoader = ( function () {

THREE.Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );

};
}

GLTFCubicSplineInterpolant.prototype = Object.create( THREE.Interpolant.prototype );
GLTFCubicSplineInterpolant.prototype.constructor = GLTFCubicSplineInterpolant;
Expand Down Expand Up @@ -966,10 +966,10 @@ THREE.GLTFLoader = ( function () {
// [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ]
for ( var i = 0; i !== stride; i ++ ) {

var p0 = values[ offset0 + i + stride ]; // splineVertex_k
var m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)
var p1 = values[ offset1 + i + stride ]; // splineVertex_k+1
var m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)
var p0 = values[ offset0 + i + stride ]; // splineVertex_k
var m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)
var p1 = values[ offset1 + i + stride ]; // splineVertex_k+1
var m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)

result[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1;

Expand Down Expand Up @@ -1123,7 +1123,7 @@ THREE.GLTFLoader = ( function () {
WEIGHT: 'skinWeight', // deprecated
JOINTS_0: 'skinIndex',
JOINT: 'skinIndex' // deprecated
}
};

var PATH_PROPERTIES = {
scale: 'scale',
Expand Down Expand Up @@ -1214,7 +1214,7 @@ THREE.GLTFLoader = ( function () {
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets
*
* @param {THREE.Geometry} geometry
* @param {THREE.BufferGeometry} geometry
* @param {Array<GLTF.Target>} targets
* @param {Array<THREE.BufferAttribute>} accessors
*/
Expand Down Expand Up @@ -1533,7 +1533,7 @@ THREE.GLTFLoader = ( function () {
// BufferGeometry caching
this.primitiveCache = [];
this.multiplePrimitivesCache = [];
this.multiPassGeometryCache = []
this.multiPassGeometryCache = [];

this.textureLoader = new THREE.TextureLoader( this.options.manager );
this.textureLoader.setCrossOrigin( this.options.crossOrigin );
Expand Down Expand Up @@ -2178,7 +2178,7 @@ THREE.GLTFLoader = ( function () {

}

if ( materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial) {
if ( materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {

pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture.index ) );

Expand All @@ -2192,7 +2192,7 @@ THREE.GLTFLoader = ( function () {

}

if ( materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial) {
if ( materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {

pending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture.index ) );

Expand All @@ -2204,13 +2204,13 @@ THREE.GLTFLoader = ( function () {

}

if ( materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial) {
if ( materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial ) {

materialParams.emissive = new THREE.Color().fromArray( materialDef.emissiveFactor );

}

if ( materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial) {
if ( materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {

pending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture.index ) );

Expand Down Expand Up @@ -2270,7 +2270,7 @@ THREE.GLTFLoader = ( function () {
var bufferAttribute = accessors[ attributes[ gltfAttributeName ] ];

// Skip attributes already provided by e.g. Draco extension.
if ( !threeAttributeName ) continue;
if ( ! threeAttributeName ) continue;
if ( threeAttributeName in geometry.attributes ) continue;

geometry.addAttribute( threeAttributeName, bufferAttribute );
Expand Down Expand Up @@ -2508,7 +2508,7 @@ THREE.GLTFLoader = ( function () {

var mesh;

var material = isMultiMaterial ? originalMaterials : originalMaterials[ i ]
var material = isMultiMaterial ? originalMaterials : originalMaterials[ i ];

if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES ||
primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ||
Expand Down Expand Up @@ -2592,7 +2592,7 @@ THREE.GLTFLoader = ( function () {
THREE.Material.prototype.copy.call( pointsMaterial, material );
pointsMaterial.color.copy( material.color );
pointsMaterial.map = material.map;
pointsMaterial.lights = false; // PointsMaterial doesn't support lights yet
pointsMaterial.lights = false; // PointsMaterial doesn't support lights yet

scope.cache.add( cacheKey, pointsMaterial );

Expand All @@ -2611,7 +2611,7 @@ THREE.GLTFLoader = ( function () {
lineMaterial = new THREE.LineBasicMaterial();
THREE.Material.prototype.copy.call( lineMaterial, material );
lineMaterial.color.copy( material.color );
lineMaterial.lights = false; // LineBasicMaterial doesn't support lights yet
lineMaterial.lights = false; // LineBasicMaterial doesn't support lights yet

scope.cache.add( cacheKey, lineMaterial );

Expand All @@ -2638,8 +2638,8 @@ THREE.GLTFLoader = ( function () {
if ( ! cachedMaterial ) {

cachedMaterial = material.isGLTFSpecularGlossinessMaterial
? extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].cloneMaterial( material )
: material.clone();
? extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].cloneMaterial( material )
: material.clone();

if ( useSkinning ) cachedMaterial.skinning = true;
if ( useVertexColors ) cachedMaterial.vertexColors = THREE.VertexColors;
Expand Down