Commit 2ecbe452408e846efc8798e410c6f9e723163ab3

sammy 2008-05-08T17:05:26

* Add scalar product to the FTPoint operators.

diff --git a/src/FTGL/FTPoint.h b/src/FTGL/FTPoint.h
index 766ea4c..e2ee5e8 100644
--- a/src/FTGL/FTPoint.h
+++ b/src/FTGL/FTPoint.h
@@ -151,7 +151,7 @@ class FTGL_EXPORT FTPoint
         }
 
         /**
-         * Operator *
+         * Operator *  Scalar multiplication
          *
          * @param multiplier
          * @return <code>this</code> multiplied by <code>multiplier</code>.
@@ -168,7 +168,7 @@ class FTGL_EXPORT FTPoint
 
 
         /**
-         * Operator *
+         * Operator *  Scalar multiplication
          *
          * @param point
          * @param multiplier
@@ -181,6 +181,21 @@ class FTGL_EXPORT FTPoint
 
 
         /**
+         * Operator *  Scalar product
+         *
+         * @param a  First vector.
+         * @param b  Second vector.
+         * @return  <code>a.b</code> scalar product.
+         */
+        inline friend double operator * (FTPoint &a, FTPoint& b)
+        {
+            return a.values[0] * b.values[0]
+                 + a.values[1] * b.values[1]
+                 + a.values[2] * b.values[2];
+        }
+
+
+        /**
          * Operator ^  Vector product
          *
          * @param point Second point