Created
February 5, 2013 08:57
-
-
Save asus4/4713156 to your computer and use it in GitHub Desktop.
Convert LeapMotion Coordinate system to Unity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace Leap { | |
public class LeapUtil | |
{ | |
public static Vector3 ToPositionVector3 (Vector position) | |
{ | |
return new Vector3 (position.x, position.y, -position.z); | |
} | |
public static Vector3 ToVector3 (Vector v) | |
{ | |
return new Vector3 (v.x, v.y, v.z); | |
} | |
public static void LookAt (Transform t, Vector norlmal) | |
{ | |
t.LookAt (t.position + ToPositionVector3 (norlmal), Vector3.forward); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment