Update: CC - SnailRunner - Mouse Move (jz3qg0174l.js) 495 bytes modified
parent
93d9b9934d
commit
042522635d
|
@ -4,34 +4,13 @@ if (!this.entityLoaded) {
|
|||
|
||||
if (!this.initialized) {
|
||||
this.mouse = this.entityLoaded.mouse;
|
||||
this.raycaster = this.entityLoaded.raycaster;
|
||||
this.initialized = true;
|
||||
}
|
||||
|
||||
this.mouse.x = (data.event.offsetX / data.event.target.width ) * 2 - 1;
|
||||
this.mouse.y = -(data.event.offsetY / data.event.target.height) * 2 + 1;
|
||||
|
||||
//this.camera.lookAt.x = this.mouse.x * 20;
|
||||
//this.camera.lookAt.y = this.mouse.y * 20;
|
||||
//this.camera.lookAt.z = 0;
|
||||
//this.camera.updateInstance('lookAt');
|
||||
|
||||
this.raycaster.setFromCamera(
|
||||
this.mouse,
|
||||
this.camera
|
||||
);
|
||||
|
||||
var distance = - this.camera.position.z / this.raycaster.direction.z;
|
||||
var cursorPosition = this.camera.position.clone().add(
|
||||
this.raycaster.direction.clone().multiply(
|
||||
distance,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
cursorPosition.z = 3;
|
||||
|
||||
this.lookAtTarget = cursorPosition;
|
||||
this.update3dCursor();
|
||||
|
||||
//var left = false;
|
||||
//var right = false;
|
||||
|
|
Loading…
Reference in New Issue