SignedDistance.h 648 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. namespace msdfgen {
  3. /// Represents a signed squared distance and alignment, which together can be compared to uniquely determine the closest edge segment.
  4. class SignedDistance {
  5. public:
  6. static const SignedDistance INFINITE;
  7. double sqDistance;
  8. double dot;
  9. SignedDistance();
  10. SignedDistance(double sqDistance, double d);
  11. double distance() const;
  12. friend bool operator<(SignedDistance a, SignedDistance b);
  13. friend bool operator>(SignedDistance a, SignedDistance b);
  14. friend bool operator<=(SignedDistance a, SignedDistance b);
  15. friend bool operator>=(SignedDistance a, SignedDistance b);
  16. };
  17. }