Skip to content

Commit

Permalink
Clean up landing page demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jsantell committed Mar 11, 2019
1 parent 5b647fe commit b6da07c
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions examples/scripts/homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class App {
this.gui = new dat.GUI({ autoPlace: !DEMO_MODE && !isMobile() });
this.config = {
rotationSpeed: -4.5,
showTarget: true,
followMouse: false,
constraintAngle: 60,
showTarget: isMobile() || DEMO_MODE,
followMouse: !isMobile() && !DEMO_MODE,
constraintAngle: 75,
};

this.gui.add(this.config, 'rotationSpeed').min(-10).max(10).step(0.5);
Expand Down Expand Up @@ -140,16 +140,6 @@ class App {
this.mousePosition.set((event.clientX / window.innerWidth) * 2 - 1,
-(event.clientY / window.innerHeight) * 2 + 1,
0.4);

return;

this._mouseVector.copy(this.mousePosition);
const dir = this._mouseVector.sub(this.camera.position).normalize();
const distance = -this.camera.position.z / dir.z;
const pos = this.camera.position.clone().add(dir.multiplyScalar(distance));
this.target.position.copy(pos);
this.target.position.z = 0.2;

}

onPartyModeToggle(e) {
Expand All @@ -161,15 +151,6 @@ class App {
moveTargetToMouse() {
this.target.position.copy(this.mousePosition)
this.target.position.unproject(this.camera);
console.log(this.target.position);
//this.target.position.z = 0.1;
return;

const dir = this._mouseVector.sub(this.camera.position).normalize();
const distance = -this.camera.position.z / dir.z;
const pos = this.camera.position.clone().add(dir.multiplyScalar(distance));
this.target.position.copy(pos);
this.target.position.z = 0.2;
}

render() {
Expand Down

0 comments on commit b6da07c

Please sign in to comment.