Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r811 - in branches/vertical: Interface Model/Backgrounds Model/Instances


Chronological Thread 
  • From: sparker@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r811 - in branches/vertical: Interface Model/Backgrounds Model/Instances
  • Date: Tue, 3 Jan 2006 15:24:06 -0700 (MST)

Author: sparker
Date: Tue Jan  3 15:24:05 2006
New Revision: 811

Added:
   branches/vertical/Model/Instances/MPT.h
Modified:
   branches/vertical/Interface/RayPacket.h
   branches/vertical/Model/Backgrounds/TextureBackground.cc
   branches/vertical/Model/Instances/Instance.cc
Log:
Slight update to MPT stuff


Modified: branches/vertical/Interface/RayPacket.h
==============================================================================
--- branches/vertical/Interface/RayPacket.h     (original)
+++ branches/vertical/Interface/RayPacket.h     Tue Jan  3 15:24:05 2006
@@ -242,15 +242,34 @@
     {
       return data->hitMatl[which] != 0;
     }
-    const Material* hitMaterial(int which)
+    const Material* hitMatl(int which)
     {
       return data->hitMatl[which];
     }
-    void setTexCoordMapper(int which, const TexCoordMapper* tex)
+    void setHitMaterial(int which, const Material* matl)
+    {
+      data->hitMatl[which] = matl;
+    }
+    void setHitPrimitive(int which, const Primitive* prim)
+    {
+      data->hitPrim[which] = prim;
+    }
+    void setHitTexCoordMapper(int which, const TexCoordMapper* tex)
     {
       data->hitTex[which] = tex;
     }
-
+    const Material* getHitMaterial(int which)
+    {
+      return data->hitMatl[which];
+    }
+    const Primitive* getHitPrimitive(int which)
+    {
+      return data->hitPrim[which];
+    }
+    const TexCoordMapper* getHitTexCoordMapper(int which)
+    {
+      return data->hitTex[which];
+    }
 
     // Final result
     void setColor(int which, const Color& color)

Modified: branches/vertical/Model/Backgrounds/TextureBackground.cc
==============================================================================
--- branches/vertical/Model/Backgrounds/TextureBackground.cc    (original)
+++ branches/vertical/Model/Backgrounds/TextureBackground.cc    Tue Jan  3 
15:24:05 2006
@@ -78,7 +78,7 @@
   // to this class for each ray.
   for(int i=rays.begin();i<rays.end();i++){
     // Set the TexCoordMapper pointer.
-    rays.setTexCoordMapper(i, mapper);
+    rays.setHitTexCoordMapper(i, mapper);
     // Copy the direction from old ray to the new one.
     rays.setHitPosition(i, Point(rays.getDirection(i)));
   }

Modified: branches/vertical/Model/Instances/Instance.cc
==============================================================================
--- branches/vertical/Model/Instances/Instance.cc       (original)
+++ branches/vertical/Model/Instances/Instance.cc       Tue Jan  3 15:24:05 
2006
@@ -1,5 +1,6 @@
 
 #include <Model/Instances/Instance.h>
+#include <Model/Instances/MPT.h>
 #include <Interface/RayPacket.h>
 #include <Core/Exceptions/BadPrimitive.h>
 #include <Core/Geometry/BBox.h>

Added: branches/vertical/Model/Instances/MPT.h
==============================================================================
--- (empty file)
+++ branches/vertical/Model/Instances/MPT.h     Tue Jan  3 15:24:05 2006
@@ -0,0 +1,45 @@
+
+#ifndef Manta_Interface_MPT_h
+#define Manta_Interface_MPT_h
+
+/*
+ * If this ever gets used outside of Instances, it should be moved to a
+ * more general spot
+ */
+#include <MantaTypes.h>
+
+namespace Manta {
+  class Material;
+  class Primitive;
+  class TexCoordMapper;
+       
+  // Convenience struct to hold a material, primitive and texcoordmapper
+  struct MPT {
+    const Material* material;
+    const Primitive* primitive;
+    const TexCoordMapper* tex;
+    MPT(const Material* material, const Primitive* primitive,
+                               const TexCoordMapper* tex)
+      : material(material), primitive(primitive), tex(tex)
+    {
+    }
+  };
+       
+  // Convenience struct to hold a material, primitive and texcoordmapper
+  // and a scale/inverse scale
+  struct MPTscale {
+    const Material* material;
+    const Primitive* primitive;
+    const TexCoordMapper* tex;
+    Real scale;
+    Real inv_scale;
+    MPTscale(const Material* material, const Primitive* primitive,
+                                                const TexCoordMapper* tex, 
Real scale, Real inv_scale)
+      : material(material), primitive(primitive), tex(tex),
+                       scale(scale), inv_scale(inv_scale)
+    {
+    }
+  };
+}
+       
+#endif




  • [MANTA] r811 - in branches/vertical: Interface Model/Backgrounds Model/Instances, sparker, 01/03/2006

Archive powered by MHonArc 2.6.16.

Top of page