Quellcode durchsuchen

Matrix4: Changed signature of .makePerspective()

Mugen87 vor 8 Jahren
Ursprung
Commit
9e1c61c14e

+ 1 - 1
docs/api/math/Matrix4.html

@@ -236,7 +236,7 @@ xAxis.z, yAxis.z, zAxis.z, 0,
 		</code>
 		</div>
 
-		<h3>[method:Matrix4 makePerspective]( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] )</h3>
+		<h3>[method:Matrix4 makePerspective]( [page:Float left], [page:Float right], [page:Float top], [page:Float bottom], [page:Float near], [page:Float far] )</h3>
 		<div>
 			Creates a [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection perspective projection] matrix.
 			This is used internally by [page:PerspectiveCamera.updateProjectionMatrix]()

+ 1 - 1
src/Three.Legacy.js

@@ -470,7 +470,7 @@ Object.assign( Matrix4.prototype, {
 	makeFrustum: function( left, right, bottom, top, near, far ) {
 
 		console.warn( 'THREE.Matrix4: .makeFrustum() has been renamed to .makePerspective().' );
-		return this.makePerspective( left, right, bottom, top, near, far );
+		return this.makePerspective( left, right, top, bottom, near, far );
 
 	}
 

+ 1 - 1
src/cameras/PerspectiveCamera.js

@@ -193,7 +193,7 @@ PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ),
 		var skew = this.filmOffset;
 		if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
 
-		this.projectionMatrix.makePerspective( left, left + width, top - height, top, near, this.far );
+		this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
 
 	},
 

+ 1 - 1
src/math/Matrix4.js

@@ -833,7 +833,7 @@ Matrix4.prototype = {
 
 	}(),
 
-	makePerspective: function ( left, right, bottom, top, near, far ) {
+	makePerspective: function ( left, right, top, bottom, near, far ) {
 
 		var te = this.elements;
 		var x = 2 * near / ( right - left );

+ 2 - 2
test/unit/math/Frustum.js

@@ -88,7 +88,7 @@ test( "setFromMatrix/makeOrthographic/containsPoint", function() {
 });
 
 test( "setFromMatrix/makePerspective/containsPoint", function() {
-	var m = new THREE.Matrix4().makePerspective( -1, 1, -1, 1, 1, 100 );
+	var m = new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 100 );
 	var a = new THREE.Frustum().setFromMatrix( m );
 
 	ok( ! a.containsPoint( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" );
@@ -107,7 +107,7 @@ test( "setFromMatrix/makePerspective/containsPoint", function() {
 });
 
 test( "setFromMatrix/makePerspective/intersectsSphere", function() {
-	var m = new THREE.Matrix4().makePerspective( -1, 1, -1, 1, 1, 100 );
+	var m = new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 100 );
 	var a = new THREE.Frustum().setFromMatrix( m );
 
 	ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, 0 ), 0 ) ), "Passed!" );

+ 2 - 2
test/unit/math/Matrix4.js

@@ -184,8 +184,8 @@ test( "getInverse", function() {
 		new THREE.Matrix4().makeRotationZ( -0.3 ),
 		new THREE.Matrix4().makeScale( 1, 2, 3 ),
 		new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 ),
-		new THREE.Matrix4().makePerspective( -1, 1, -1, 1, 1, 1000 ),
-		new THREE.Matrix4().makePerspective( -16, 16, -9, 9, 0.1, 10000 ),
+		new THREE.Matrix4().makePerspective( -1, 1, 1, -1, 1, 1000 ),
+		new THREE.Matrix4().makePerspective( -16, 16, 9, -9, 0.1, 10000 ),
 		new THREE.Matrix4().makeTranslation( 1, 2, 3 )
 		];