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