2
0
simonThiele 10 жил өмнө
parent
commit
761f98dd5b

+ 13 - 3
test/unit/cameras/Camera.js

@@ -5,8 +5,18 @@
 module( "Camera" );
 
 test( "lookAt", function() {
-	var obj = new THREE.Camera();
-	obj.lookAt(new THREE.Vector3(0, 1, -1));
+	var cam = new THREE.Camera();
+	cam.lookAt(new THREE.Vector3(0, 1, -1));
 
-	ok( obj.rotation.x * (180 / Math.PI) === 45 , "x is equal" );
+	ok( cam.rotation.x * (180 / Math.PI) === 45 , "x is equal" );
+});
+
+test( "clone", function() {
+	var cam = new THREE.Camera();
+	cam.lookAt(new THREE.Vector3(1, 2, 3));
+
+	var clonedCam = cam.clone();
+
+	ok( cam.matrixWorldInverse.equals(clonedCam.matrixWorldInverse) , "matrixWorldInverse is equal" );
+	ok( cam.projectionMatrix.equals(clonedCam.projectionMatrix) , "projectionMatrix is equal" );
 });