Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1411 - in trunk: Core/Geometry Interface


Chronological Thread 
  • From: boulos@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1411 - in trunk: Core/Geometry Interface
  • Date: Fri, 8 Jun 2007 17:37:03 -0600 (MDT)

Author: boulos
Date: Fri Jun  8 17:37:02 2007
New Revision: 1411

Modified:
   trunk/Core/Geometry/AffineTransform.cc
   trunk/Core/Geometry/AffineTransform.h
   trunk/Interface/Light.h
Log:
Adding a multiply_point function that takes 
VectorT<Real, 4> for AffineTransform.

Removing requirement to implement preprocess
for lights...  


Modified: trunk/Core/Geometry/AffineTransform.cc
==============================================================================
--- trunk/Core/Geometry/AffineTransform.cc      (original)
+++ trunk/Core/Geometry/AffineTransform.cc      Fri Jun  8 17:37:02 2007
@@ -344,6 +344,18 @@
     }
     return result;
   }
+  Vector AffineTransform::multiply_point(const VectorT<Real, 4>& point) 
const {
+    Vector result;
+    for (int i=0;i<3;++i) {
+      result[i]  = mat[i][0] * point[0];
+      result[i] += mat[i][1] * point[1];
+      result[i] += mat[i][2] * point[2];
+      result[i] += mat[i][3] * point[3];
+    }
+    // NOTE(boulos): Since points have a 4th component that's always one
+    // we don't need the divide, right?
+    return result;
+  }
   Vector AffineTransform::multiply_vector(const Vector& vec) const {
     Vector result;
     for (int i=0;i<3;++i) {
@@ -375,7 +387,7 @@
     }
     return result;
   }
-  
+
   std::ostream& operator<<( std::ostream& os, const AffineTransform& trans ) 
{
     for (int i=0;i<3;++i) {
       for (int j=0;j<4;++j) {

Modified: trunk/Core/Geometry/AffineTransform.h
==============================================================================
--- trunk/Core/Geometry/AffineTransform.h       (original)
+++ trunk/Core/Geometry/AffineTransform.h       Fri Jun  8 17:37:02 2007
@@ -31,6 +31,7 @@
 
 #include <MantaTypes.h>
 #include <Core/Geometry/Vector.h>
+#include <Core/Geometry/VectorT.h>
 
 #include <sgi_stl_warnings_off.h>
 #include <iosfwd>
@@ -105,6 +106,7 @@
     AffineTransform& operator*=(const AffineTransform& m);
 
     Vector multiply_point(const Vector& point) const;
+    Vector multiply_point(const VectorT<Real, 4>& point) const;
     Vector multiply_vector(const Vector& vec) const;
 
     // Multiply by the transpose of the AffineTransformation, useful for

Modified: trunk/Interface/Light.h
==============================================================================
--- trunk/Interface/Light.h     (original)
+++ trunk/Interface/Light.h     Fri Jun  8 17:37:02 2007
@@ -10,13 +10,13 @@
 
   class PreprocessContext;
   class RenderContext;
-       
+
   class Light {
   public:
     Light();
     virtual ~Light();
-               
-    virtual void preprocess(const PreprocessContext& context ) = 0;
+
+    virtual void preprocess(const PreprocessContext& context ) {};
 
     // This method is called on the light by the shadow algorithm. The
     // color and direction produced by the light may change for each




  • [MANTA] r1411 - in trunk: Core/Geometry Interface, boulos, 06/08/2007

Archive powered by MHonArc 2.6.16.

Top of page