Selaa lähdekoodia

Mesh: Support Geometries without morphTargets.

Mr.doob 11 vuotta sitten
vanhempi
commit
092e3ad0d3

+ 0 - 4
src/core/BufferGeometry.js

@@ -28,10 +28,6 @@ THREE.BufferGeometry = function () {
 
 	this.hasTangents = false;
 
-	// for compatibility
-
-	this.morphTargets = [];
-
 };
 
 THREE.BufferGeometry.prototype = {

+ 1 - 1
src/extras/renderers/plugins/ShadowMapPlugin.js

@@ -277,7 +277,7 @@ THREE.ShadowMapPlugin = function () {
 
 					objectMaterial = getObjectMaterial( object );
 
-					useMorphing = object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets;
+					useMorphing = object.geometry.morphTargets !== undefined && object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets;
 					useSkinning = object instanceof THREE.SkinnedMesh && objectMaterial.skinning;
 
 					if ( object.customDepthMaterial ) {

+ 1 - 1
src/objects/Mesh.js

@@ -20,7 +20,7 @@ THREE.Mesh.prototype = Object.create( THREE.Object3D.prototype );
 
 THREE.Mesh.prototype.updateMorphTargets = function () {
 
-	if ( this.geometry.morphTargets.length > 0 ) {
+	if ( this.geometry.morphTargets !== undefined && this.geometry.morphTargets.length > 0 ) {
 
 		this.morphTargetBase = -1;
 		this.morphTargetForcedOrder = [];