Commit cde2e341 authored by Jérémie Garcia's avatar Jérémie Garcia
Browse files

bug fix

parent d4beb737
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
<form> <form>
<label for="flip-loop">Loop Mode:</label> <label for="flip-loop">Loop Mode:</label>
<select name="flip-loop" id="flip-loop" data-role="slider" data-theme="b" onchange="javascript:Traj.Player.updateLoopMode()"> <select name="flip-loop" id="flip-loop" data-role="slider" data-theme="b" onchange="javascript:Traj.Player.updateLoopMode()">
<option value="on">On</option>
<option value="off" selected="selected">Off</option> <option value="off" selected="selected">Off</option>
<option value="on">On</option>
</select> </select>
</form> </form>
<form> <form>
......
...@@ -112,14 +112,11 @@ Traj.OSC = { ...@@ -112,14 +112,11 @@ Traj.OSC = {
Traj.OSC.sendMessage(Traj.OSC.record_address, msg); Traj.OSC.sendMessage(Traj.OSC.record_address, msg);
}, },
orientation_rate : 3, //used to send orientaiton events one time over the rate // orientation_rate : 0, //used to send orientaiton events one time over the rate
sendOrientation : function(msg){ sendOrientation : function(msg){
//ussing Spat formatting source ID xyz x y z Traj.OSC.sendSpatMessage(['source',Traj.Manager.currentSource, 'yaw', msg[0]]);
if(rate%3 === 0){ //Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'pitch', msg[1]]);
Traj.OSC.sendSpatMessage(['source',Traj.Manager.currentSource, 'yaw', msg[0]]); // Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'roll', msg[2]]);
Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'pitch', msg[1]]);
}
rate = (rate +1)%3;
}, },
sendNewTraj : function(msg){ sendNewTraj : function(msg){
......
...@@ -300,15 +300,20 @@ Traj.Events = { ...@@ -300,15 +300,20 @@ Traj.Events = {
}, },
processOrientationEvents : function(event) { processOrientationEvents : function(event) {
// console.log(event); // gamma is the left-to-right tilt in degrees, where right is positive
var alpha = event.alpha; var tiltLR = event.gamma;
// gamma: left to right
var gamma = event.gamma; // beta is the front-to-back tilt in degrees, where front is positive
// beta: front back motion var tiltFB = event.beta;
var beta = event.beta;
var msg = [alpha,beta,gamma]; // alpha is the compass direction the device is facing in degrees
var dir = event.alpha
//put with correct offset for android
dir = (360-dir) % 360;
if(Traj.Events.stream_orientation){ if(Traj.Events.stream_orientation){
Traj.OSC.sendOrientation(msg); Traj.OSC.sendOrientation([dir,tiltLR,tiltFB]);
} }
}, },
......
...@@ -472,6 +472,8 @@ Traj.Manager = { ...@@ -472,6 +472,8 @@ Traj.Manager = {
var newCurve = Traj.Utils.simplifyCurve(currentCurve,tolerance); var newCurve = Traj.Utils.simplifyCurve(currentCurve,tolerance);
Traj.Manager.trajectories[Traj.Manager.currentCurveIndex] = newCurve ; Traj.Manager.trajectories[Traj.Manager.currentCurveIndex] = newCurve ;
} }
Traj.View.current_repaint();
}, },
SelectandRedrawEdit : function (){ SelectandRedrawEdit : function (){
......
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