-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNui.cs
39 lines (33 loc) · 897 Bytes
/
Nui.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX;
using Microsoft.Research.Kinect.Nui;
namespace BuildBrickBuilding
{
class Nui
{
public const float CLOSE_DIS2 = 0.03f;
public static Vector3 toVector3(Joint joint)
{
return new Vector3(joint.Position.X, joint.Position.Y, joint.Position.Z);
}
public static float dist(Vector3 a, Vector3 b)
{
return (a - b).Length();
}
public static float dist2(Vector3 a, Vector3 b)
{
return (a - b).LengthSq();
}
public static bool isNear(Vector3 a, Vector3 b)
{
if ((a - b).LengthSq() <= CLOSE_DIS2)
{
return true;
}
return false;
}
}
}