Commit 56e19423 authored by Matthias Möller's avatar Matthias Möller

adapted BCI-Action

parent 9c2e8f99
......@@ -27,18 +27,12 @@ export default Ember.Service.extend({
},
myMessageHandler: function(event){
let data = event.data;
data = JSON.parse(data);
let mentalCommand = data["mentalCommand"];
//MentalCommand is a push
if(mentalCommand === 2){
this.triggerZoom(0.1);
//MentalCommand is a pull
}else if(mentalCommand === 4){
this.triggerZoom(-0.1);
if(this.get('isActivated')){
let data = event.data;
data = JSON.parse(data);
let mentalCommand = data["mentalCommand"];
console.log(mentalCommand);
this.triggerZoom(mentalCommand);
}
},
......@@ -47,10 +41,9 @@ export default Ember.Service.extend({
},
triggerZoom(wheelDelta){
triggerZoom(mentalCommand){
let canvas = $("#threeCanvas")[0];
console.log("triggered");
let event = new Event("bciaction",
{
......@@ -58,7 +51,7 @@ export default Ember.Service.extend({
"cancelable":false
});
event.wheelDelta = wheelDelta;
event.mentalCommand = mentalCommand;
for(var key in this.get('activatedControllers')){
if(this.get('activatedControllers')[key]){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment