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

bug fix

parent d4beb737
......@@ -65,8 +65,8 @@
<form>
<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()">
<option value="on">On</option>
<option value="off" selected="selected">Off</option>
<option value="on">On</option>
</select>
</form>
<form>
......
......@@ -112,14 +112,11 @@ Traj.OSC = {
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){
//ussing Spat formatting source ID xyz x y z
if(rate%3 === 0){
Traj.OSC.sendSpatMessage(['source',Traj.Manager.currentSource, 'yaw', msg[0]]);
Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'pitch', msg[1]]);
}
rate = (rate +1)%3;
Traj.OSC.sendSpatMessage(['source',Traj.Manager.currentSource, 'yaw', msg[0]]);
//Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'pitch', msg[1]]);
// Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'roll', msg[2]]);
},
sendNewTraj : function(msg){
......
......@@ -300,15 +300,20 @@ Traj.Events = {
},
processOrientationEvents : function(event) {
// console.log(event);
var alpha = event.alpha;
// gamma: left to right
var gamma = event.gamma;
// beta: front back motion
var beta = event.beta;
var msg = [alpha,beta,gamma];
// gamma is the left-to-right tilt in degrees, where right is positive
var tiltLR = event.gamma;
// beta is the front-to-back tilt in degrees, where front is positive
var tiltFB = event.beta;
// 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){
Traj.OSC.sendOrientation(msg);
Traj.OSC.sendOrientation([dir,tiltLR,tiltFB]);
}
},
......
......@@ -472,6 +472,8 @@ Traj.Manager = {
var newCurve = Traj.Utils.simplifyCurve(currentCurve,tolerance);
Traj.Manager.trajectories[Traj.Manager.currentCurveIndex] = newCurve ;
}
Traj.View.current_repaint();
},
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