Removed useless stuff
This commit is contained in:
parent
6442a7bcb9
commit
5df1d17746
|
@ -22,11 +22,6 @@ var FixedCamera = function(arg1, arg2, arg3, arg4, position, target) {
|
||||||
|
|
||||||
this.target = this.position.clone();
|
this.target = this.position.clone();
|
||||||
this.target.add(Tools.mul(direction,20));
|
this.target.add(Tools.mul(direction,20));
|
||||||
// this.up = new THREE.Vector3(0,0,1);
|
|
||||||
|
|
||||||
// Compute corners
|
|
||||||
|
|
||||||
// Create the mesh to draw
|
|
||||||
|
|
||||||
var geometry = new THREE.Geometry();
|
var geometry = new THREE.Geometry();
|
||||||
|
|
||||||
|
@ -58,37 +53,6 @@ var FixedCamera = function(arg1, arg2, arg3, arg4, position, target) {
|
||||||
|
|
||||||
geometry.computeFaceNormals();
|
geometry.computeFaceNormals();
|
||||||
|
|
||||||
(function(self, direction, left, other, position) {
|
|
||||||
var material = new THREE.LineBasicMaterial({ color: '0x000000', transparent: true});
|
|
||||||
var geometry = new THREE.Geometry();
|
|
||||||
// var direction = Tools.mul(direction, 1);
|
|
||||||
var target = Tools.sum(position, direction);
|
|
||||||
// geometry.vertices.push(position, target);
|
|
||||||
geometry.vertices.push(
|
|
||||||
Tools.sum(Tools.sum(position, left), other),
|
|
||||||
Tools.diff(Tools.sum(position, other),left),
|
|
||||||
Tools.diff(Tools.diff(position, left),other),
|
|
||||||
Tools.sum(Tools.diff(position, other), left),
|
|
||||||
Tools.sum(Tools.sum(position, left), other),
|
|
||||||
Tools.sum(Tools.diff(position, other), left),
|
|
||||||
|
|
||||||
Tools.sum(position, direction),
|
|
||||||
Tools.sum(Tools.sum(position, left), other),
|
|
||||||
|
|
||||||
Tools.sum(position, direction),
|
|
||||||
Tools.diff(Tools.sum(position, other),left),
|
|
||||||
|
|
||||||
Tools.sum(position, direction),
|
|
||||||
Tools.diff(Tools.diff(position, left),other),
|
|
||||||
|
|
||||||
Tools.sum(position, direction),
|
|
||||||
Tools.sum(Tools.diff(position, other), left)
|
|
||||||
);
|
|
||||||
|
|
||||||
self.border = new THREE.Line(geometry, material);
|
|
||||||
})(this, direction, left, other, position);
|
|
||||||
|
|
||||||
|
|
||||||
var material = new THREE.MeshLambertMaterial({
|
var material = new THREE.MeshLambertMaterial({
|
||||||
color : 0xff0000,
|
color : 0xff0000,
|
||||||
transparent : true,
|
transparent : true,
|
||||||
|
|
|
@ -23,7 +23,6 @@ var PointerCamera = function() {
|
||||||
this.position = new THREE.Vector3();
|
this.position = new THREE.Vector3();
|
||||||
this.forward = new THREE.Vector3();
|
this.forward = new THREE.Vector3();
|
||||||
this.left = new THREE.Vector3();
|
this.left = new THREE.Vector3();
|
||||||
// this.up = new THREE.Vector3(0,0,1);
|
|
||||||
this.target = new THREE.Vector3(0,1,0);
|
this.target = new THREE.Vector3(0,1,0);
|
||||||
|
|
||||||
// Stuff for events
|
// Stuff for events
|
||||||
|
@ -62,7 +61,7 @@ PointerCamera.prototype.constructor = PointerCamera;
|
||||||
// Update function
|
// Update function
|
||||||
PointerCamera.prototype.update = function() {
|
PointerCamera.prototype.update = function() {
|
||||||
if (this.moving) {
|
if (this.moving) {
|
||||||
// Linear version
|
// Linear motion
|
||||||
var position_direction = Tools.diff(this.new_position, this.position);
|
var position_direction = Tools.diff(this.new_position, this.position);
|
||||||
var target_direction = Tools.diff(this.new_target, this.target);
|
var target_direction = Tools.diff(this.new_target, this.target);
|
||||||
|
|
||||||
|
@ -75,30 +74,6 @@ PointerCamera.prototype.update = function() {
|
||||||
this.anglesFromVectors();
|
this.anglesFromVectors();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hermite polynom version
|
|
||||||
// var eval = this.hermite.eval(this.t);
|
|
||||||
// this.position.x = eval.x;
|
|
||||||
// this.position.y = eval.y;
|
|
||||||
// this.position.z = eval.z;
|
|
||||||
|
|
||||||
// this.target = Tools.sum(this.position, this.hermite.prime(this.t));
|
|
||||||
|
|
||||||
// this.t += 0.005;
|
|
||||||
|
|
||||||
// if (this.t > 1) {
|
|
||||||
// this.moving = false;
|
|
||||||
// // Update phi and theta so that return to reality does not hurt
|
|
||||||
// var forward = Tools.diff(this.target, this.position);
|
|
||||||
// forward.normalize();
|
|
||||||
|
|
||||||
// this.phi = Math.asin(forward.y);
|
|
||||||
|
|
||||||
// // Don't know why this line works... But thanks Thierry-san and
|
|
||||||
// // Bastien because it seems to work...
|
|
||||||
// this.theta = Math.atan2(forward.x, forward.z);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Update angles
|
// Update angles
|
||||||
if (this.increasePhi) this.phi += this.sensitivity;
|
if (this.increasePhi) this.phi += this.sensitivity;
|
||||||
|
|
Loading…
Reference in New Issue