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

29
anim.js
View File

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