Lovi le prvi kontroler

kegel
Jurij Podgoršek 2022-09-17 15:25:19 +02:00
parent c35c231c10
commit 7c1fc1b321
1 changed files with 23 additions and 28 deletions

51
anim.js
View File

@ -264,33 +264,29 @@ window.addEventListener('keyup', (e) => {
}
})
var oscCallbacks = {
'/keys': [
function(args) {
keysPressed = args.map(getVal);
keysPressed[0] |= kbdPressed['a'];
keysPressed[1] |= kbdPressed['s'];
keysPressed[2] |= kbdPressed['d'];
keysPressed[3] |= kbdPressed['f'];
//console.log(keysPressed, kbdPressed);
}
],
'/quaternion': [
function (args) {
// Popravimo osi (w x y z po defaultu HMM)
[qWW.w, qWW.z, qWW.x, qWW.y] = args.map(getVal);
}
],
'/quaternionDiff': [
function (args) {
[qWWd.w, qWWd.x, qWWd.y, qWWd.z] = args.map(getVal);
}
],
'/eulerDiff': [
function (args) {
[dqX, dqY, dqZ] = args.map(getVal);
}
],
var prepend = '/ww/0';
var oscCallbacks = {};
oscCallbacks[prepend + '/keys'] = function(args) {
keysPressed = args.map(getVal);
keysPressed[0] |= kbdPressed['a'];
keysPressed[1] |= kbdPressed['s'];
keysPressed[2] |= kbdPressed['d'];
keysPressed[3] |= kbdPressed['f'];
//console.log(keysPressed, kbdPressed);
console.log(args)
};
oscCallbacks[prepend + '/quaternion'] = function (args) {
// Popravimo osi (w x y z po defaultu HMM)
[qWW.w, qWW.z, qWW.x, qWW.y] = args.map(getVal);
};
oscCallbacks[prepend + '/quaternionDiff'] = function (args) {
[qWWd.w, qWWd.x, qWWd.y, qWWd.z] = args.map(getVal);
};
oscCallbacks[prepend + '/eulerDiff'] = function (args) {
[dqX, dqY, dqZ] = args.map(getVal);
}
/* Ne uporabljamo vec
'/gyro/': [
@ -327,4 +323,3 @@ var oscCallbacks = {
}
],
*/
}