Last change
on this file since 28897 was 28897, checked in by davidb, 10 years ago |
GUI front-end to server base plus web page content
|
File size:
979 bytes
|
Line | |
---|
1 | /**
|
---|
2 | * @author mrdoob / http://mrdoob.com/
|
---|
3 | * @author mikael emtinger / http://gomo.se/
|
---|
4 | * @author WestLangley / http://github.com/WestLangley
|
---|
5 | */
|
---|
6 |
|
---|
7 | THREE.Camera = function () {
|
---|
8 |
|
---|
9 | THREE.Object3D.call( this );
|
---|
10 |
|
---|
11 | this.matrixWorldInverse = new THREE.Matrix4();
|
---|
12 | this.projectionMatrix = new THREE.Matrix4();
|
---|
13 |
|
---|
14 | };
|
---|
15 |
|
---|
16 | THREE.Camera.prototype = Object.create( THREE.Object3D.prototype );
|
---|
17 |
|
---|
18 | THREE.Camera.prototype.lookAt = function () {
|
---|
19 |
|
---|
20 | // This routine does not support cameras with rotated and/or translated parent(s)
|
---|
21 |
|
---|
22 | var m1 = new THREE.Matrix4();
|
---|
23 |
|
---|
24 | return function ( vector ) {
|
---|
25 |
|
---|
26 | m1.lookAt( this.position, vector, this.up );
|
---|
27 |
|
---|
28 | this.quaternion.setFromRotationMatrix( m1 );
|
---|
29 |
|
---|
30 | };
|
---|
31 |
|
---|
32 | }();
|
---|
33 |
|
---|
34 | THREE.Camera.prototype.clone = function (camera) {
|
---|
35 |
|
---|
36 | if ( camera === undefined ) camera = new THREE.Camera();
|
---|
37 |
|
---|
38 | THREE.Object3D.prototype.clone.call( this, camera );
|
---|
39 |
|
---|
40 | camera.matrixWorldInverse.copy( this.matrixWorldInverse );
|
---|
41 | camera.projectionMatrix.copy( this.projectionMatrix );
|
---|
42 |
|
---|
43 | return camera;
|
---|
44 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.