/// <summary> /// Input should be the persistent data for this single pivot.<para/> /// Should consist of two quaternions, using comma between members, and dash for separation between quats -- e.g. x,y,z,w-x,y,z,w<para/> /// If persitent data string is empty/null, default orientation is initialized to the current local rotation of the pivot. This new default /// will be captured and saved to persistence the next time the part is saved. /// </summary> /// <param name="persistentData"></param> public void initializeRotation(string persistentData) { if (!string.IsNullOrEmpty(persistentData)) { string[] splitData = persistentData.Split('|'); float[] def = SSTUUtils.parseFloatArray(splitData[0]); float[] cur = SSTUUtils.parseFloatArray(splitData[1]); defaultOrientation = new Quaternion(def[0], def[1], def[2], def[3]); pivot.localRotation = new Quaternion(cur[0], cur[1], cur[2], cur[3]); } else { defaultOrientation = pivot.localRotation; } }