Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r832 - in branches/vertical: Interface Model/Groups


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r832 - in branches/vertical: Interface Model/Groups
  • Date: Fri, 6 Jan 2006 15:17:22 -0700 (MST)

Author: bigler
Date: Fri Jan  6 15:17:22 2006
New Revision: 832

Modified:
   branches/vertical/Interface/RayPacket.h
   branches/vertical/Model/Groups/CMakeLists.txt
   branches/vertical/Model/Groups/RealisticBvh.cc
Log:

Interface/RayPacket.h

  A little typedef magic to get swig to compile the code properly.
  You could work around this by passing -nocppcast to swig, but that
  option on exists in newer versions of swig, and I don't wish to
  break backwards compatibility just yet.

Model/Groups/CMakeLists.txt

  Compile RealisticBvh.

Model/Groups/RealisticBvh.cc
  
  Fixes to work with new vertical RayPackets.


Modified: branches/vertical/Interface/RayPacket.h
==============================================================================
--- branches/vertical/Interface/RayPacket.h     (original)
+++ branches/vertical/Interface/RayPacket.h     Fri Jan  6 15:17:22 2006
@@ -29,9 +29,16 @@
       }
 
     // Pointer-based arrays
-    Primitive const* hitPrim[Size];
-    Material const* hitMatl[Size];
-    TexCoordMapper const* hitTex[Size];
+
+    // SWIG generated some error prone code when we used the types
+    // directly.  Making a typedef seemed to fix it.
+    typedef Primitive const* PrimitiveCP;
+    typedef Material const*  MaterialCP;
+    typedef TexCoordMapper const* TexCoordMapperCP;
+
+    PrimitiveCP hitPrim[Size];
+    MaterialCP hitMatl[Size];
+    TexCoordMapperCP hitTex[Size];
 
     // Real-based arrays
     Real image[2][Size];

Modified: branches/vertical/Model/Groups/CMakeLists.txt
==============================================================================
--- branches/vertical/Model/Groups/CMakeLists.txt       (original)
+++ branches/vertical/Model/Groups/CMakeLists.txt       Fri Jan  6 15:17:22 
2006
@@ -16,8 +16,8 @@
      #Groups/FrustumKDTree.cc
      Groups/PsiGammaTable.cc
      Groups/PsiGammaTable.h
-     #Groups/RealisticBvh.h
-     #Groups/RealisticBvh.cc
+     Groups/RealisticBvh.h
+     Groups/RealisticBvh.cc
      Groups/VolumeGrid.h
      Groups/varray.h
 )

Modified: branches/vertical/Model/Groups/RealisticBvh.cc
==============================================================================
--- branches/vertical/Model/Groups/RealisticBvh.cc      (original)
+++ branches/vertical/Model/Groups/RealisticBvh.cc      Fri Jan  6 15:17:22 
2006
@@ -99,7 +99,7 @@
        }
        
        // Find a pivot point.
-       Point pivot((Vector(new_node->bounds[0]) + 
Vector(new_node->bounds[1])) * 0.5);
+       Point pivot((Vector(new_node->bounds[0]) + 
Vector(new_node->bounds[1])) * (Real)0.5);
        
        // Split along the axis.
        int mid_point = qsplit( array, size, pivot[axis], axis );
@@ -167,21 +167,20 @@
 void RealisticBvh::intersect(const RenderContext& context, RayPacket& rays) 
const {
        
        rays.computeInverseDirections();
-        rays.computeSigns();
+  rays.computeSigns();
 
        // Intersect the ray packet with the bounds of this node.
        bool bbox_intersect[RayPacket::MaxSize];
-       
-       for(int i=rays.begin();i<rays.end();i++) {
-               
-               RayPacket::Element& e = rays.get(i);
+       VectorT<int, 3> signs[RayPacket::MaxSize];
 
+       for(int i=rays.begin();i<rays.end();i++) {
                // Check to see if the ray hits this node's bounding box.
                Real min_t, max_t;
-               bbox_intersect[i] = Intersection::intersectAaBox( bounds, 
min_t, max_t, e.ray, 
-                                                                             
                                                                              
                                                      e.sign, 
e.inverseDirection,
-                                                                             
                                                                              
                                                            (Real)0,
-                                                                             
                                                                              
                                                            e.hitInfo.minT() 
);
+    signs[i] = rays.getSigns(i);
+               bbox_intersect[i]
+      = Intersection::intersectAaBox( bounds, min_t, max_t, rays.getRay(i), 
+                                      signs[i], rays.getInverseDirection(i),
+                                      (Real)0, rays.getMinT(i) );
        }
        
        // Find runs of rays which intersect this bounding box and intersect 
those 
@@ -197,12 +196,12 @@
                        ++begin;
        
                // Determine the first child for the first ray in the packet.
-               first_child = rays.get( begin ).sign[ split_axis ];
+               first_child = signs[begin][ split_axis ];
        
                // Find the end of this run.
                end = begin;
                while ((end < rays.end()) && (bbox_intersect[end]) && 
-                      (rays.get( begin ).sign[ split_axis ] == first_child))
+                      (signs[begin][ split_axis ] == first_child))
                        ++end;
 
                if ((end > begin) && (begin < rays.end())) {




  • [MANTA] r832 - in branches/vertical: Interface Model/Groups, bigler, 01/06/2006

Archive powered by MHonArc 2.6.16.

Top of page