-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathopenni.js
49 lines (42 loc) · 1.03 KB
/
openni.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var kinect = require('./build/Release/openni.node');
var EventEmitter = require('events').EventEmitter;
module.exports = function(options) {
var kContext = new kinect.Context();
var keepRunning = setInterval(function() {}, 3600000);
var running = true;
var oldClose = kContext.close;
kContext.close = function() {
console.log('\nClosing...\n');
clearInterval(keepRunning);
oldClose.apply(kContext, arguments);
}
kContext.__proto__.__proto__ = EventEmitter.prototype;
// Set all joints by default and let the user override this if he wills
kContext.setJoints([
"head",
"neck",
"torso",
"waist",
"left_collar",
"left_shoulder",
"left_elbow",
"left_wrist",
"left_hand",
"left_fingertip",
"right_collar",
"right_shoulder",
"right_elbow",
"right_wrist",
"right_hand",
"right_fingertip",
"left_hip",
"left_knee",
"left_ankle",
"left_foot",
"right_hip",
"right_knee",
"right_ankle",
"right_foot"
]);
return kContext;
};