/// <summary> /// Convert an array of unity positions back into an array used by the DLL /// </summary> /// <param name="pos"></param> /// <returns></returns> public static SenseGloveCs.Kinematics.Vect3D[] ToPosition(Vector3[] pos) { SenseGloveCs.Kinematics.Vect3D[] res = new SenseGloveCs.Kinematics.Vect3D[pos.Length]; for (int f = 0; f < pos.Length; f++) { res[f] = SenseGlove_Util.ToPosition(pos[f]); } return(res); }
//------------------------------------------------------------------------------------------------------------------------- // Conversion #region Conversion /// <summary> /// Convert a float[3] position taken from the DLL into a Unity Position. /// </summary> /// <param name="pos"></param> /// <returns></returns> public static Vector3 ToUnityPosition(SenseGloveCs.Kinematics.Vect3D pos) { return(new Vector3(pos.x, pos.z, pos.y)); }
/// <summary> Convert a set of euler angles from the DLL into the Unity notation. </summary> /// <param name="euler"></param> /// <returns></returns> public static Vector3 ToUnityEuler(SenseGloveCs.Kinematics.Vect3D euler) { euler = SenseGloveCs.Values.Degrees(euler); return(new Vector3(-euler.x, -euler.z, -euler.y)); }