Example #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));
        }
Example #2
0
 public Vector3 DirectionTo(NebulaTransform other)
 {
     return((other.position - position).normalized);
 }
Example #3
0
 public float DistanceTo(NebulaTransform other)
 {
     return(Vector3.Distance(position, other.position));
 }