Lovi le prvi kontroler
parent
c35c231c10
commit
7c1fc1b321
31
anim.js
31
anim.js
|
@ -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 = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
*/
|
*/
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue