Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r310 - trunk/Core/Geometry


Chronological Thread 
  • From: knolla@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r310 - trunk/Core/Geometry
  • Date: Fri, 13 May 2005 13:01:04 -0600 (MDT)

Author: knolla
Date: Fri May 13 13:01:04 2005
New Revision: 310

Modified:
   trunk/Core/Geometry/PointVector.h
Log:
added  functions for adding a Point to a Point

Modified: trunk/Core/Geometry/PointVector.h
==============================================================================
--- trunk/Core/Geometry/PointVector.h   (original)
+++ trunk/Core/Geometry/PointVector.h   Fri May 13 13:01:04 2005
@@ -310,15 +310,25 @@
         result.data[i] = data[i] * v[i];
       return result;
     }
+    PointT<T, Dim> addedTo(const Point<T, Dim>& v) const {
+      PointT<T, Dim> result;
+      for(int i=0;i<Dim;i++)
+        result.data[i] = data[i] + v[i];
+      return result;
+    }
     // This one returns void instead of a reference to itself so that it is 
harder
     // to use the wrong form and end up changing a variable without 
realizing it
     void multiplyBy(T s) {
       for(int i=0;i<Dim;i++)
         data[i] *= s;
     }
-    void multiplyBy(const VectorT<T, Dim>& v) {
+    void multiplyBy(const VectorT<T, Dim>& v){
       for(int i=0;i<Dim;i++)
         data[i] *= v[i];
+    }
+    void addTo(const Point<T, Dim>& v){
+      for(int i=0;i<Dim;i++)
+        data[i] += v[i];
     }
 
   private:




  • [MANTA] r310 - trunk/Core/Geometry, knolla, 05/13/2005

Archive powered by MHonArc 2.6.16.

Top of page