/// <summary> Convert an array of Unity Vector3 positions into a Vect3D Position array used by SGCore. </summary> /// <param name="pos"></param> /// <param name="scale">scale m to mm</param> /// <returns></returns> public static SGCore.Kinematics.Vect3D[] ToPosition(Vector3[] pos, bool scale = true) { SGCore.Kinematics.Vect3D[] res = new SGCore.Kinematics.Vect3D[pos.Length]; for (int f = 0; f < pos.Length; f++) { res[f] = SG_Conversions.ToPosition(pos[f], scale); } return(res); }
/// <summary> Convert an array of Vect3D positions taken from SGCore into a Vector3 Unity Position array. </summary> /// <param name="pos"></param> /// <param name="scale">Scale from mm to m</param> /// <returns></returns> public static Vector3[] ToUnityPositions(SGCore.Kinematics.Vect3D[] pos, bool scale = true) { if (pos != null) { Vector3[] res = new Vector3[pos.Length]; for (int f = 0; f < pos.Length; f++) { res[f] = SG_Conversions.ToUnityPosition(pos[f], scale); } return(res); } return(new Vector3[] { }); }