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