Skip to content
Snippets Groups Projects
Commit d176ae39 authored by johnshaughnessy's avatar johnshaughnessy
Browse files

Don't listen to snap_rotate events

parent 50e6fdd2
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,6 @@ AFRAME.registerComponent("character-controller", {
const eventSrc = this.el.sceneEl;
eventSrc.addEventListener("move", this.setAccelerationInput);
eventSrc.addEventListener("rotateY", this.setAngularVelocity);
eventSrc.addEventListener("snap_rotate_left", this.snapRotateLeft);
eventSrc.addEventListener("snap_rotate_right", this.snapRotateRight);
eventSrc.addEventListener("teleported", this.handleTeleport);
},
......@@ -54,8 +52,6 @@ AFRAME.registerComponent("character-controller", {
const eventSrc = this.el.sceneEl;
eventSrc.removeEventListener("move", this.setAccelerationInput);
eventSrc.removeEventListener("rotateY", this.setAngularVelocity);
eventSrc.removeEventListener("snap_rotate_left", this.snapRotateLeft);
eventSrc.removeEventListener("snap_rotate_right", this.snapRotateRight);
eventSrc.removeEventListener("teleported", this.handleTeleport);
this.reset();
},
......@@ -78,10 +74,12 @@ AFRAME.registerComponent("character-controller", {
snapRotateLeft: function() {
this.pendingSnapRotationMatrix.copy(this.leftRotationMatrix);
this.el.emit("snap_rotate_left");
},
snapRotateRight: function() {
this.pendingSnapRotationMatrix.copy(this.rightRotationMatrix);
this.el.emit("snap_rotate_right");
},
handleTeleport: function(event) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment