浏览代码

use camera.is*** for its type detection

yomotsu 7 年之前
父节点
当前提交
063515b2ed
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      examples/files.js
  2. 2 2
      examples/js/renderers/CSS3DRenderer.js

+ 1 - 1
examples/files.js

@@ -348,11 +348,11 @@ var files = {
 	],
 	],
 	"css3d": [
 	"css3d": [
 		"css3d_molecules",
 		"css3d_molecules",
+		"css3d_orthographic",
 		"css3d_panorama",
 		"css3d_panorama",
 		"css3d_panorama_deviceorientation",
 		"css3d_panorama_deviceorientation",
 		"css3d_periodictable",
 		"css3d_periodictable",
 		"css3d_sandbox",
 		"css3d_sandbox",
-		"css3d_orthographic",
 		"css3d_sprites",
 		"css3d_sprites",
 		"css3d_youtube"
 		"css3d_youtube"
 	],
 	],

+ 2 - 2
examples/js/renderers/CSS3DRenderer.js

@@ -262,7 +262,7 @@ THREE.CSS3DRenderer = function () {
 
 
 		if ( cache.camera.fov !== fov ) {
 		if ( cache.camera.fov !== fov ) {
 
 
-			if ( camera.type === 'PerspectiveCamera' ) {
+			if ( camera.isPerspectiveCamera ) {
 
 
 				domElement.style.WebkitPerspective = fov + 'px';
 				domElement.style.WebkitPerspective = fov + 'px';
 				domElement.style.perspective = fov + 'px';
 				domElement.style.perspective = fov + 'px';
@@ -277,7 +277,7 @@ THREE.CSS3DRenderer = function () {
 
 
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 		if ( camera.parent === null ) camera.updateMatrixWorld();
 
 
-		var cameraCSSMatrix = camera.type === 'OrthographicCamera' ?
+		var cameraCSSMatrix = camera.isOrthographicCamera ?
 			'scale(' + fov + ')' + getCameraCSSMatrix( camera.matrixWorldInverse ) :
 			'scale(' + fov + ')' + getCameraCSSMatrix( camera.matrixWorldInverse ) :
 			'translateZ(' + fov + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse );
 			'translateZ(' + fov + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse );