lvec2_ops_src.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Filename: lvec2_ops_src.h
  2. // Created by: drose (08Mar00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. // When possible, operators have been defined within the classes.
  19. // This file defines operator functions outside of classes where
  20. // necessary. It also defines some convenient out-of-class wrappers
  21. // around in-class functions (like dot, length, normalize).
  22. // scalar * vec (vec * scalar is defined in class)
  23. INLINE_LINMATH FLOATNAME(LVecBase2)
  24. operator * (FLOATTYPE scalar, const FLOATNAME(LVecBase2) &a);
  25. INLINE_LINMATH FLOATNAME(LPoint2)
  26. operator * (FLOATTYPE scalar, const FLOATNAME(LPoint2) &a);
  27. INLINE_LINMATH FLOATNAME(LVector2)
  28. operator * (FLOATTYPE scalar, const FLOATNAME(LVector2) &a);
  29. // dot product
  30. INLINE_LINMATH FLOATTYPE
  31. dot(const FLOATNAME(LVecBase2) &a, const FLOATNAME(LVecBase2) &b);
  32. // Length of a vector.
  33. INLINE_LINMATH FLOATTYPE
  34. length(const FLOATNAME(LVector2) &a);
  35. // A normalized vector.
  36. INLINE_LINMATH FLOATNAME(LVector2)
  37. normalize(const FLOATNAME(LVector2) &v);
  38. #include "lvec2_ops_src.I"