Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from sunimalr/master

Edited the Airkinect-Gesture-Lib to support Airkinect 2.2
  • Loading branch information...
commit 24b6a08bd2049da9a01cf4a951ce6498e97ec10b 2 parents d520401 + 45ed47a
@tonybeltramelli authored
View
6 src/com/tonybeltramelli/airkinect/debug/KinectDebugger.as
@@ -154,7 +154,7 @@ package com.tonybeltramelli.airkinect.debug {
{
for each (var joint : SkeletonJoint in user.skeletonJoints) {
_skeleton.graphics.beginFill(0xd11df2);
- _skeleton.graphics.drawCircle(joint.depthPosition.x, joint.depthPosition.y, 4);
+ _skeleton.graphics.drawCircle(joint.position.depth.x, joint.position.depth.y, 4);
_skeleton.graphics.endFill();
}
}
@@ -163,8 +163,8 @@ package com.tonybeltramelli.airkinect.debug {
}
private function _drawLineBetweenJoints(user : User, from : String, to : String) : void {
- _skeleton.graphics.moveTo(user.getJointByName(from).depthPosition.x, user.getJointByName(from).depthPosition.y);
- _skeleton.graphics.lineTo(user.getJointByName(to).depthPosition.x, user.getJointByName(to).depthPosition.y);
+ _skeleton.graphics.moveTo(user.getJointByName(from).position.depth.x, user.getJointByName(from).position.depth.y);
+ _skeleton.graphics.lineTo(user.getJointByName(to).position.depth.x, user.getJointByName(to).position.depth.y);
}
private function _positioning() : void {
View
10 src/com/tonybeltramelli/airkinect/userAction/gesture/abstract/AGesture.as
@@ -41,10 +41,10 @@ package com.tonybeltramelli.airkinect.userAction.gesture.abstract {
_increment++;
- _gaps.push(user.getJointByName("waist").depthPosition.y - user.head.depthPosition.y);
- _bodyPosX.push(user.torso.depthPosition.x);
- _bodyPosY.push(user.torso.depthPosition.y);
- _bodyPosZ.push(user.torso.position.z);
+ _gaps.push(user.getJointByName("waist").position.depth.y - user.head.position.depth.y);
+ _bodyPosX.push(user.torso.position.depth.x);
+ _bodyPosY.push(user.torso.position.depth.y);
+ _bodyPosZ.push(user.torso.position.world.z);
if(!_wait || _gestureSettings.ignoreGestureBack) _allPos.push(_jointSettings.jointProperty);
if(!_wait && _increment == _speed)
@@ -57,7 +57,7 @@ package com.tonybeltramelli.airkinect.userAction.gesture.abstract {
var bodyYRef : Number = UMath.getMaxValueAndIndexV(_bodyPosY).value - UMath.getMinValueAndIndexV(_bodyPosY).value;
var bodyZRef : Number = UMath.getMaxValueAndIndexV(_bodyPosZ).value - UMath.getMinValueAndIndexV(_bodyPosZ).value;
- if(gap > gapReference*_jointSettings.gapRatio && user.position.z > _LIMIT && bodyXRef < _BODY_LIMIT_X*_jointSettings.gapRatio && bodyYRef < _BODY_LIMIT_Y*_jointSettings.gapRatio && bodyZRef < _BODY_LIMIT_Z)
+ if(gap > gapReference*_jointSettings.gapRatio && user.position.world.z > _LIMIT && bodyXRef < _BODY_LIMIT_X*_jointSettings.gapRatio && bodyYRef < _BODY_LIMIT_Y*_jointSettings.gapRatio && bodyZRef < _BODY_LIMIT_Z)
{
_gestureSettings.ignoreGestureBack ? _wait = true : _wait = false;
max.i < min.i ? _gestureDetected(1) : _gestureDetected(-1);
View
14 src/com/tonybeltramelli/airkinect/userAction/gesture/settings/JointSettings.as
@@ -30,13 +30,13 @@ package com.tonybeltramelli.airkinect.userAction.gesture.settings {
break;
case GesturePart.RIGHT_HAND :
jointToTrack = user.rightHand;
- _gapRatio = 1.1;
- _waitRatio = 1;
+ _gapRatio = 0.3;
+ _waitRatio = 0.1;
break;
case GesturePart.LEFT_HAND :
jointToTrack = user.leftHand;
- _gapRatio = 1.1;
- _waitRatio = 1;
+ _gapRatio = 0.3;
+ _waitRatio = 0.1;
break;
case GesturePart.RIGHT_FOOT :
jointToTrack = user.rightFoot;
@@ -81,13 +81,13 @@ package com.tonybeltramelli.airkinect.userAction.gesture.settings {
switch (_axis)
{
case "x":
- _jointProperty = joint.depthPosition.x;
+ _jointProperty = joint.position.depth.x;
break;
case "y":
- _jointProperty = joint.depthPosition.y;
+ _jointProperty = joint.position.depth.y;
break;
case "z":
- _jointProperty = joint.position.z;
+ _jointProperty = joint.position.world.z;
_gapRatio = _gapRatio*7;
break;
default :
View
2  src/com/tonybeltramelli/airkinect/userAction/movement/BendDownMovement.as
@@ -14,7 +14,7 @@ package com.tonybeltramelli.airkinect.userAction.movement {
}
override public function compute(user : User) : void {
- _jointProperty = user.torso.depthPosition.y;
+ _jointProperty = user.torso.position.depth.y;
super.compute(user);
}
View
2  src/com/tonybeltramelli/airkinect/userAction/movement/JumpMovement.as
@@ -14,7 +14,7 @@ package com.tonybeltramelli.airkinect.userAction.movement {
}
override public function compute(user : User) : void {
- _jointProperty = user.torso.depthPosition.y;
+ _jointProperty = user.torso.position.depth.y;
super.compute(user);
}
View
4 src/com/tonybeltramelli/airkinect/userAction/movement/abstract/AMovement.as
@@ -22,7 +22,7 @@ package com.tonybeltramelli.airkinect.userAction.movement.abstract {
public function compute(user : User) : void {
_increment++;
- _gaps.push(user.getJointByName("waist").depthPosition.y - user.head.depthPosition.y);
+ _gaps.push(user.getJointByName("waist").position.depth.y - user.head.position.depth.y);
_allPos.push(_jointProperty);
if(_increment == _speed)
@@ -32,7 +32,7 @@ package com.tonybeltramelli.airkinect.userAction.movement.abstract {
var gap : Number = max.value - min.value;
var gapReference : Number = UMath.average(_gaps);
- if(gap > gapReference*_gapRatio && user.position.z > _LIMIT)
+ if(gap > gapReference*_gapRatio && user.position.world.z > _LIMIT)
{
max.i < min.i ? _gestureDetected(1) : _gestureDetected(-1);
}
Please sign in to comment.
Something went wrong with that request. Please try again.