|
0
|
1 |
/* |
|
8
|
2 |
* This file is part of the TraKERS\Middleware package. |
|
|
3 |
* |
|
|
4 |
* (c) IRI <http://www.iri.centrepompidou.fr/> |
|
|
5 |
* |
|
|
6 |
* For the full copyright and license information, please view the LICENSE_MIDDLEWARE |
|
|
7 |
* file that was distributed with this source code. |
|
|
8 |
*/ |
|
|
9 |
|
|
|
10 |
/* |
|
3
|
11 |
* Projet : TraKERS |
|
0
|
12 |
* Module : MIDDLEWARE |
|
3
|
13 |
* Sous-Module : Tracking/Events |
|
0
|
14 |
* Classe : LeftHandTrackedListener |
|
|
15 |
* |
|
|
16 |
* Auteur : alexandre.bastien@iri.centrepompidou.fr |
|
|
17 |
* |
|
|
18 |
* Fonctionnalités : Ce listener écoute l'événement du type : La main gauche est entrée dans le champ. |
|
3
|
19 |
* Il contient le code a être éxecuté au cas où cet événement survient, à savoir : |
|
0
|
20 |
* - On affiche un visuel dans le debug. |
|
|
21 |
* - On notifie le serveur TUIO. |
|
|
22 |
*/ |
|
|
23 |
|
|
|
24 |
using System; |
|
|
25 |
using System.Collections.Generic; |
|
|
26 |
using System.Linq; |
|
|
27 |
using System.Text; |
|
|
28 |
using Microsoft.Kinect; |
|
|
29 |
|
|
|
30 |
namespace Trakers.Tracking.Events |
|
|
31 |
{ |
|
|
32 |
public class LeftHandTrackedListener |
|
|
33 |
{ |
|
|
34 |
/* |
|
|
35 |
* Méthode appelée lorsque on a l'événement : La main gauche est entrée dans le champ. |
|
|
36 |
*/ |
|
|
37 |
public void ShowOnScreen(object o, LeftHandTrackedEventArgs e) |
|
|
38 |
{ |
|
|
39 |
Joint handJoint = e.handJoint; |
|
|
40 |
//On l'indique dans le debug. |
|
|
41 |
e.debug.showLeftHandRect(true); |
|
|
42 |
e.debug.showLeftHandCoord("(" + handJoint.Position.X + ";" + handJoint.Position.Y + ")"); |
|
|
43 |
//On notifie le serveur TUIO. |
|
|
44 |
e.server.LeftHandTracked(o, e); |
|
|
45 |
} |
|
|
46 |
} |
|
|
47 |
} |