Camera.js 795 B

12345678910111213141516171819202122232425
  1. /**
  2. * @author simonThiele / https://github.com/simonThiele
  3. */
  4. module( "Camera" );
  5. test( "lookAt", function() {
  6. var cam = new THREE.Camera();
  7. cam.lookAt(new THREE.Vector3(0, 1, -1));
  8. ok( cam.rotation.x * (180 / Math.PI) === 45 , "x is equal" );
  9. });
  10. test( "clone", function() {
  11. var cam = new THREE.Camera();
  12. // fill the matrices with any nonsense values just to see if they get copied
  13. cam.matrixWorldInverse.set( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );
  14. cam.projectionMatrix.set( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );
  15. var clonedCam = cam.clone();
  16. ok( cam.matrixWorldInverse.equals(clonedCam.matrixWorldInverse) , "matrixWorldInverse is equal" );
  17. ok( cam.projectionMatrix.equals(clonedCam.projectionMatrix) , "projectionMatrix is equal" );
  18. });