overte/scripts/developer/tests/drawTrackedObjects.js
Anthony Thibault 8d56a313e8 renamed viveTrackedObjects.js to drawTrackedObjects.js
Removed requirement of having a Vive hooked up.  Input recordings can have trackedObjects within them.
2018-10-09 14:05:26 -07:00

34 lines
962 B
JavaScript

var TRACKED_OBJECT_POSES = [
"TrackedObject00", "TrackedObject01", "TrackedObject02", "TrackedObject03",
"TrackedObject04", "TrackedObject05", "TrackedObject06", "TrackedObject07",
"TrackedObject08", "TrackedObject09", "TrackedObject10", "TrackedObject11",
"TrackedObject12", "TrackedObject13", "TrackedObject14", "TrackedObject15"
];
function init() {
Script.update.connect(update);
}
function shutdown() {
Script.update.disconnect(update);
TRACKED_OBJECT_POSES.forEach(function (key) {
DebugDraw.removeMyAvatarMarker(key);
});
}
var BLUE = {x: 0, y: 0, z: 1, w: 1};
function update(dt) {
TRACKED_OBJECT_POSES.forEach(function (key) {
var pose = Controller.getPoseValue(Controller.Standard[key]);
if (pose.valid) {
DebugDraw.addMyAvatarMarker(key, pose.rotation, pose.translation, BLUE);
} else {
DebugDraw.removeMyAvatarMarker(key);
}
});
}
init();