//converts scaled units to unity units public static Vector3 SUtoUU(LongPos pos) { return(pos.toVector3() / SUperUU); }
//rotates a given longpos by a certain rotation //this compensates for rotation of a body and therefore of the entire child coordinate system private LongPos rotAroundLong(LongPos pos, Quaternion rot) { Vector3 rotated = rot * pos.toVector3(); return(new LongPos((long)rotated.x, (long)rotated.y, (long)rotated.z)); }
//later either won't need this or will use a double precision vector //takes a vector3 in uu and returns a floating pos vector3 in uu public Vector3 getFloatingPos(Vector3 _pos) { //finds relative position in su, divides by 10000 to convert to uu, converts to v3 return(_pos - (floatingOrigin.toVector3() / SUperUU)); }