Added default time in Camera.js
This commit is contained in:
parent
be99ba00e6
commit
638111c3b1
|
@ -13,6 +13,9 @@ Camera.prototype = Object.create(THREE.PerspectiveCamera.prototype);
|
||||||
|
|
||||||
// Update function
|
// Update function
|
||||||
Camera.prototype.update = function(time) {
|
Camera.prototype.update = function(time) {
|
||||||
|
if (time === undefined) {
|
||||||
|
time = 20;
|
||||||
|
}
|
||||||
this.theta += 0.01 * time / 20;
|
this.theta += 0.01 * time / 20;
|
||||||
this.position.x = Camera.DISTANCE_X*Math.cos(this.theta);
|
this.position.x = Camera.DISTANCE_X*Math.cos(this.theta);
|
||||||
this.position.y = Camera.DISTANCE_X*Math.sin(this.theta);
|
this.position.y = Camera.DISTANCE_X*Math.sin(this.theta);
|
||||||
|
|
Loading…
Reference in New Issue