Mercurial > hg > Game > Games
comparison Orchestland/Assets/LeapMotion/Scripts/Hands/DebugFinger.cs @ 1:f7675884f2a1
Add Orchestland project
author | Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2015 23:09:20 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:347d21cdfc22 | 1:f7675884f2a1 |
---|---|
1 /******************************************************************************\ | |
2 * Copyright (C) Leap Motion, Inc. 2011-2014. * | |
3 * Leap Motion proprietary. Licensed under Apache 2.0 * | |
4 * Available at http://www.apache.org/licenses/LICENSE-2.0.html * | |
5 \******************************************************************************/ | |
6 | |
7 using UnityEngine; | |
8 using System.Collections; | |
9 using Leap; | |
10 | |
11 /** | |
12 * The finger model for our debugging. Draws debug lines for each bone. | |
13 */ | |
14 public class DebugFinger : FingerModel { | |
15 | |
16 /** The colors used for each bone. */ | |
17 protected Color[] colors = {Color.yellow, Color.green, Color.cyan, Color.blue}; | |
18 | |
19 /** Updates the finger and calls the line drawing function. */ | |
20 public override void UpdateFinger() { | |
21 DrawDebugLines(); | |
22 } | |
23 | |
24 /** | |
25 * Draws a line from joint to joint. | |
26 */ | |
27 protected void DrawDebugLines() { | |
28 for (int i = 0; i < NUM_BONES; ++i) | |
29 Debug.DrawLine(GetJointPosition(i), GetJointPosition(i + 1), colors[i]); | |
30 } | |
31 } |