提交 9083ed34 编写于 作者: M Mr.doob

Updated builds.

上级 67d67bfc
......@@ -20055,25 +20055,8 @@
//
var backgroundCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
var backgroundCamera2 = new PerspectiveCamera();
var backgroundPlaneMesh = new Mesh(
new PlaneBufferGeometry( 2, 2 ),
new MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } )
);
var backgroundBoxShader = ShaderLib[ 'cube' ];
var backgroundBoxMesh = new Mesh(
new BoxBufferGeometry( 5, 5, 5 ),
new ShaderMaterial( {
uniforms: backgroundBoxShader.uniforms,
vertexShader: backgroundBoxShader.vertexShader,
fragmentShader: backgroundBoxShader.fragmentShader,
side: BackSide,
depthTest: false,
depthWrite: false,
fog: false
} )
);
var backgroundPlaneCamera, backgroundPlaneMesh;
var backgroundBoxCamera, backgroundBoxMesh;
//
......@@ -20944,25 +20927,56 @@
if ( background && background.isCubeTexture ) {
backgroundCamera2.projectionMatrix.copy( camera.projectionMatrix );
if ( backgroundBoxCamera === undefined ) {
backgroundBoxCamera = new PerspectiveCamera();
backgroundBoxMesh = new Mesh(
new BoxBufferGeometry( 5, 5, 5 ),
new ShaderMaterial( {
uniforms: ShaderLib.cube.uniforms,
vertexShader: ShaderLib.cube.vertexShader,
fragmentShader: ShaderLib.cube.fragmentShader,
side: BackSide,
depthTest: false,
depthWrite: false,
fog: false
} )
);
}
backgroundBoxCamera.projectionMatrix.copy( camera.projectionMatrix );
backgroundBoxCamera.matrixWorld.extractRotation( camera.matrixWorld );
backgroundBoxCamera.matrixWorldInverse.getInverse( backgroundBoxCamera.matrixWorld );
backgroundCamera2.matrixWorld.extractRotation( camera.matrixWorld );
backgroundCamera2.matrixWorldInverse.getInverse( backgroundCamera2.matrixWorld );
backgroundBoxMesh.material.uniforms[ "tCube" ].value = background;
backgroundBoxMesh.modelViewMatrix.multiplyMatrices( backgroundCamera2.matrixWorldInverse, backgroundBoxMesh.matrixWorld );
backgroundBoxMesh.modelViewMatrix.multiplyMatrices( backgroundBoxCamera.matrixWorldInverse, backgroundBoxMesh.matrixWorld );
objects.update( backgroundBoxMesh );
_this.renderBufferDirect( backgroundCamera2, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null );
_this.renderBufferDirect( backgroundBoxCamera, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null );
} else if ( background && background.isTexture ) {
if ( backgroundPlaneCamera === undefined ) {
backgroundPlaneCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
backgroundPlaneMesh = new Mesh(
new PlaneBufferGeometry( 2, 2 ),
new MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } )
);
}
backgroundPlaneMesh.material.map = background;
objects.update( backgroundPlaneMesh );
_this.renderBufferDirect( backgroundCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null );
_this.renderBufferDirect( backgroundPlaneCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null );
}
......@@ -41088,11 +41102,8 @@
* headWidth - Number
*/
var lineGeometry = new BufferGeometry();
lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
var coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
coneGeometry.translate( 0, - 0.5, 0 );
var lineGeometry;
var coneGeometry;
function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
......@@ -41105,6 +41116,16 @@
if ( headLength === undefined ) headLength = 0.2 * length;
if ( headWidth === undefined ) headWidth = 0.2 * headLength;
if ( lineGeometry === undefined ) {
lineGeometry = new BufferGeometry();
lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
coneGeometry.translate( 0, - 0.5, 0 );
}
this.position.copy( origin );
this.line = new Line( lineGeometry, new LineBasicMaterial( { color: color } ) );
......
此差异已折叠。
......@@ -20049,25 +20049,8 @@ function WebGLRenderer( parameters ) {
//
var backgroundCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
var backgroundCamera2 = new PerspectiveCamera();
var backgroundPlaneMesh = new Mesh(
new PlaneBufferGeometry( 2, 2 ),
new MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } )
);
var backgroundBoxShader = ShaderLib[ 'cube' ];
var backgroundBoxMesh = new Mesh(
new BoxBufferGeometry( 5, 5, 5 ),
new ShaderMaterial( {
uniforms: backgroundBoxShader.uniforms,
vertexShader: backgroundBoxShader.vertexShader,
fragmentShader: backgroundBoxShader.fragmentShader,
side: BackSide,
depthTest: false,
depthWrite: false,
fog: false
} )
);
var backgroundPlaneCamera, backgroundPlaneMesh;
var backgroundBoxCamera, backgroundBoxMesh;
//
......@@ -20938,25 +20921,56 @@ function WebGLRenderer( parameters ) {
if ( background && background.isCubeTexture ) {
backgroundCamera2.projectionMatrix.copy( camera.projectionMatrix );
if ( backgroundBoxCamera === undefined ) {
backgroundBoxCamera = new PerspectiveCamera();
backgroundBoxMesh = new Mesh(
new BoxBufferGeometry( 5, 5, 5 ),
new ShaderMaterial( {
uniforms: ShaderLib.cube.uniforms,
vertexShader: ShaderLib.cube.vertexShader,
fragmentShader: ShaderLib.cube.fragmentShader,
side: BackSide,
depthTest: false,
depthWrite: false,
fog: false
} )
);
}
backgroundBoxCamera.projectionMatrix.copy( camera.projectionMatrix );
backgroundBoxCamera.matrixWorld.extractRotation( camera.matrixWorld );
backgroundBoxCamera.matrixWorldInverse.getInverse( backgroundBoxCamera.matrixWorld );
backgroundCamera2.matrixWorld.extractRotation( camera.matrixWorld );
backgroundCamera2.matrixWorldInverse.getInverse( backgroundCamera2.matrixWorld );
backgroundBoxMesh.material.uniforms[ "tCube" ].value = background;
backgroundBoxMesh.modelViewMatrix.multiplyMatrices( backgroundCamera2.matrixWorldInverse, backgroundBoxMesh.matrixWorld );
backgroundBoxMesh.modelViewMatrix.multiplyMatrices( backgroundBoxCamera.matrixWorldInverse, backgroundBoxMesh.matrixWorld );
objects.update( backgroundBoxMesh );
_this.renderBufferDirect( backgroundCamera2, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null );
_this.renderBufferDirect( backgroundBoxCamera, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null );
} else if ( background && background.isTexture ) {
if ( backgroundPlaneCamera === undefined ) {
backgroundPlaneCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
backgroundPlaneMesh = new Mesh(
new PlaneBufferGeometry( 2, 2 ),
new MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } )
);
}
backgroundPlaneMesh.material.map = background;
objects.update( backgroundPlaneMesh );
_this.renderBufferDirect( backgroundCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null );
_this.renderBufferDirect( backgroundPlaneCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null );
}
......@@ -41082,11 +41096,8 @@ BoxHelper.prototype.update = ( function () {
* headWidth - Number
*/
var lineGeometry = new BufferGeometry();
lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
var coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
coneGeometry.translate( 0, - 0.5, 0 );
var lineGeometry;
var coneGeometry;
function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
......@@ -41099,6 +41110,16 @@ function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
if ( headLength === undefined ) headLength = 0.2 * length;
if ( headWidth === undefined ) headWidth = 0.2 * headLength;
if ( lineGeometry === undefined ) {
lineGeometry = new BufferGeometry();
lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
coneGeometry.translate( 0, - 0.5, 0 );
}
this.position.copy( origin );
this.line = new Line( lineGeometry, new LineBasicMaterial( { color: color } ) );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册