浏览代码

Simplify CubeCamera method names

WestLangley 8 年之前
父节点
当前提交
a598c8eae5

+ 3 - 3
docs/api/cameras/CubeCamera.html

@@ -32,7 +32,7 @@
 		//Update the render target cube
 		//Update the render target cube
 		car.setVisible( false );
 		car.setVisible( false );
 		cubeCamera.position.copy( car.position );
 		cubeCamera.position.copy( car.position );
-		cubeCamera.updateCubeMap( renderer, scene );
+		cubeCamera.update( renderer, scene );
 
 
 		//Render the scene
 		//Render the scene
 		car.setVisible( true );
 		car.setVisible( true );
@@ -67,7 +67,7 @@
 		<div>See the base [page:Object3D] class for common methods.</div>
 		<div>See the base [page:Object3D] class for common methods.</div>
 
 
 
 
-		<h3>[method:null updateCubeMap]( [page:WebGLRenderer renderer], [page:Scene scene] )</h3>
+		<h3>[method:null update]( [page:WebGLRenderer renderer], [page:Scene scene] )</h3>
 		<div>
 		<div>
 		renderer -- The current WebGL renderer <br />
 		renderer -- The current WebGL renderer <br />
 		scene -- The current scene
 		scene -- The current scene
@@ -76,7 +76,7 @@
 		Call this to update the [page:CubeCamera.renderTarget renderTarget].
 		Call this to update the [page:CubeCamera.renderTarget renderTarget].
 		</div>
 		</div>
 
 
-		<h3>[method:null clearCubeMap]( [page:Boolean color], [page:Boolean depth], [page:Boolean stencil] )</h3>
+		<h3>[method:null clear]( [page:Boolean color], [page:Boolean depth], [page:Boolean stencil] )</h3>
 		<div>
 		<div>
 		Call this to clear the [page:CubeCamera.renderTarget renderTarget] color, depth, and/or stencil buffers.
 		Call this to clear the [page:CubeCamera.renderTarget renderTarget] color, depth, and/or stencil buffers.
 		The color buffer is set to the renderer's current clear color. Arguments default to *true*.
 		The color buffer is set to the renderer's current clear color. Arguments default to *true*.

+ 1 - 1
examples/webgl_materials_cubemap_dynamic.html

@@ -961,7 +961,7 @@
 					cubeCamera.position.copy( currentCar.root.position );
 					cubeCamera.position.copy( currentCar.root.position );
 
 
 					renderer.autoClear = true;
 					renderer.autoClear = true;
-					cubeCamera.updateCubeMap( renderer, scene );
+					cubeCamera.update( renderer, scene );
 
 
 					veyron.setVisible( true );
 					veyron.setVisible( true );
 					gallardo.setVisible( true );
 					gallardo.setVisible( true );

+ 2 - 2
examples/webgl_materials_cubemap_dynamic2.html

@@ -191,12 +191,12 @@
 				if ( count % 2 === 0 ) {
 				if ( count % 2 === 0 ) {
 
 
 					material.envMap = cubeCamera1.renderTarget.texture;
 					material.envMap = cubeCamera1.renderTarget.texture;
-					cubeCamera2.updateCubeMap( renderer, scene );
+					cubeCamera2.update( renderer, scene );
 
 
 				} else {
 				} else {
 
 
 					material.envMap = cubeCamera2.renderTarget.texture;
 					material.envMap = cubeCamera2.renderTarget.texture;
-					cubeCamera1.updateCubeMap( renderer, scene );
+					cubeCamera1.update( renderer, scene );
 
 
 				}
 				}
 
 

+ 1 - 1
examples/webgl_shading_physical.html

@@ -392,7 +392,7 @@
 				// render cube map
 				// render cube map
 
 
 				mesh.visible = false;
 				mesh.visible = false;
-				cubeCamera.updateCubeMap( renderer, scene );
+				cubeCamera.update( renderer, scene );
 				mesh.visible = true;
 				mesh.visible = true;
 
 
 				// render scene
 				// render scene

+ 10 - 0
src/Three.Legacy.js

@@ -66,6 +66,7 @@ import { WebGLRenderer } from './renderers/WebGLRenderer.js';
 import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
 import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
 import { WebGLShadowMap } from './renderers/webgl/WebGLShadowMap.js';
 import { WebGLShadowMap } from './renderers/webgl/WebGLShadowMap.js';
 import { Shape } from './extras/core/Shape.js';
 import { Shape } from './extras/core/Shape.js';
+import { CubeCamera } from './cameras/CubeCamera.js';
 
 
 export { BoxGeometry as CubeGeometry };
 export { BoxGeometry as CubeGeometry };
 
 
@@ -1426,6 +1427,15 @@ AudioAnalyser.prototype.getData = function () {
 
 
 //
 //
 
 
+CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) {
+
+	console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' );
+	return this.update( renderer, scene );
+
+};
+
+//
+
 export var GeometryUtils = {
 export var GeometryUtils = {
 
 
 	merge: function ( geometry1, geometry2, materialIndexOffset ) {
 	merge: function ( geometry1, geometry2, materialIndexOffset ) {

+ 2 - 2
src/cameras/CubeCamera.js

@@ -54,7 +54,7 @@ function CubeCamera( near, far, cubeResolution ) {
 	this.renderTarget = new WebGLRenderTargetCube( cubeResolution, cubeResolution, options );
 	this.renderTarget = new WebGLRenderTargetCube( cubeResolution, cubeResolution, options );
 	this.renderTarget.texture.name = "CubeCamera";
 	this.renderTarget.texture.name = "CubeCamera";
 
 
-	this.updateCubeMap = function ( renderer, scene ) {
+	this.update = function ( renderer, scene ) {
 
 
 		if ( this.parent === null ) this.updateMatrixWorld();
 		if ( this.parent === null ) this.updateMatrixWorld();
 
 
@@ -87,7 +87,7 @@ function CubeCamera( near, far, cubeResolution ) {
 
 
 	};
 	};
 
 
-	this.clearCubeMap = function ( color, depth, stencil ) {
+	this.clear = function ( color, depth, stencil ) {
 
 
 		var renderTarget = this.renderTarget;
 		var renderTarget = this.renderTarget;