Пример #1
0
 //converts scaled units to unity units
 public static Vector3 SUtoUU(LongPos pos)
 {
     return(pos.toVector3() / SUperUU);
 }
Пример #2
0
    //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));
    }
Пример #3
0
 //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));
 }