lvec2_ops_src.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Filename: lvec2_ops_src.h
  2. // Created by: drose (08Mar00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. // When possible, operators have been defined within the classes.
  15. // This file defines operator functions outside of classes where
  16. // necessary. It also defines some convenient out-of-class wrappers
  17. // around in-class functions (like dot, length, normalize).
  18. // scalar * vec (vec * scalar is defined in class)
  19. INLINE_LINMATH FLOATNAME(LVecBase2)
  20. operator * (FLOATTYPE scalar, const FLOATNAME(LVecBase2) &a);
  21. INLINE_LINMATH FLOATNAME(LPoint2)
  22. operator * (FLOATTYPE scalar, const FLOATNAME(LPoint2) &a);
  23. INLINE_LINMATH FLOATNAME(LVector2)
  24. operator * (FLOATTYPE scalar, const FLOATNAME(LVector2) &a);
  25. // dot product
  26. INLINE_LINMATH FLOATTYPE
  27. dot(const FLOATNAME(LVecBase2) &a, const FLOATNAME(LVecBase2) &b);
  28. // Length of a vector.
  29. INLINE_LINMATH FLOATTYPE
  30. length(const FLOATNAME(LVector2) &a);
  31. // A normalized vector.
  32. INLINE_LINMATH FLOATNAME(LVector2)
  33. normalize(const FLOATNAME(LVector2) &v);
  34. INLINE_LINMATH void
  35. generic_write_datagram(Datagram &dest, const FLOATNAME(LVecBase2) &value);
  36. INLINE_LINMATH void
  37. generic_read_datagram(FLOATNAME(LVecBase2) &result, DatagramIterator &source);
  38. #include "lvec2_ops_src.I"