Skip to content

Commit 6ce58ed

Browse files
committed
Let them define the orientation
1 parent 87ed734 commit 6ce58ed

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/gameobjects/mesh/MeshCamera.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ var MeshCamera = new Class({
3434
this._position = new Vector3(x, y, z);
3535
this._target = new Vector3();
3636

37+
this.orientation = Vector3.DOWN;
38+
3739
this.viewMatrix = new Matrix4();
3840
this.projectionMatrix = new Matrix4();
3941
},
@@ -42,7 +44,7 @@ var MeshCamera = new Class({
4244
{
4345
this.aspectRatio = width / height;
4446

45-
this.viewMatrix.lookAt(this._position, this._target, Vector3.UP);
47+
this.viewMatrix.lookAt(this._position, this._target, this.orientation);
4648

4749
this.projectionMatrix.perspective(DegToRad(this._fov), this.aspectRatio, this._near, this._far);
4850
},

0 commit comments

Comments
 (0)