Explorar el Código

Skeleton: Avoid creating empty texture. See #6869.

Mr.doob hace 10 años
padre
commit
b9a8664f2c
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      src/objects/Skeleton.js

+ 2 - 0
src/objects/Skeleton.js

@@ -30,6 +30,8 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
 
 		var size = THREE.Math.nextPowerOfTwo( Math.sqrt( this.bones.length * 4 ) ); // 4 pixels needed for 1 matrix
 
+		if ( size === 0 ) size = 2; // Avoid creating empty texture
+
 		this.boneTextureWidth = size;
 		this.boneTextureHeight = size;