Beispiel #1
0
        public float angleBetweenForwards(NebulaTransform other)
        {
            Vector3 myForward    = Quat.Euler(rotation) * new Vector3(0, 0, 1);
            Vector3 otherForward = Quat.Euler(other.rotation) * new Vector3(0, 0, 1);
            var     crossLen     = myForward.Cross(otherForward).Length;
            var     dotVal       = myForward.Dot(otherForward);

            return(Mathf.Atan2(crossLen, dotVal));
        }
Beispiel #2
0
 public Vector3 DirectionTo(NebulaTransform other)
 {
     return((other.position - position).normalized);
 }
Beispiel #3
0
 public float DistanceTo(NebulaTransform other)
 {
     return(Vector3.Distance(position, other.position));
 }