Ignore:
Timestamp:
05/27/08 21:24:34 (16 years ago)
Author:
mattausch
Message:

dynamic objects problem!!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp

    r2691 r2720  
    88#include "Triangle3.h" 
    99#include "VssRay.h" 
    10  
     10#include "IntersectableWrapper.h" 
    1111 
    1212 
     
    21352135    face6->mVertices.push_back(Vector3(mMax.x, mMax.y, mMax.z)); 
    21362136    face6->mVertices.push_back(Vector3(mMin.x, mMax.y, mMax.z)); 
    2137  
     2137} 
     2138 /*  
     2139   xxxxxx 
     2140  x    xx 
     2141 x    x x 
     2142xxxxxx  x          
     2143x    x x  
     2144x    xx 
     2145xxxxxx 
     2146   */ 
     2147 
     2148void AxisAlignedBox3::Triangulate(ObjectContainer &triangles) const 
     2149{ 
     2150        /*PolygonContainer polys; 
     2151        TriangleContainer tris; 
     2152 
     2153        ExtractPolys(polys); 
     2154 
     2155        for (size_t i = 0; i < polys.size(); ++ i) 
     2156        { 
     2157                Triangle tri; 
     2158                polys[i].Trianulage(tris); 
     2159        }*/ 
     2160 
     2161        TriangleIntersectable *triObj; 
     2162        Triangle3 tri; 
     2163 
     2164        tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 
     2165        tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 
     2166        tri.mVertices[2] = Vector3(mMin.x, mMax.y ,mMin.z); 
     2167 
     2168        triObj = new TriangleIntersectable(tri); 
     2169        triangles.push_back(triObj); 
     2170 
     2171        tri.mVertices[0] = Vector3(mMin.x, mMax.y ,mMin.z); 
     2172        tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 
     2173    tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 
     2174 
     2175        triObj = new TriangleIntersectable(tri); 
     2176        triangles.push_back(triObj); 
     2177 
     2178        tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 
     2179    tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 
     2180    tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 
     2181 
     2182        triObj = new TriangleIntersectable(tri); 
     2183        triangles.push_back(triObj); 
     2184 
     2185    tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 
     2186        tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 
     2187        tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 
     2188 
     2189        triObj = new TriangleIntersectable(tri); 
     2190        triangles.push_back(triObj); 
     2191 
     2192    tri.mVertices[0] = Vector3(mMax.x, mMin.y ,mMin.z); 
     2193        tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 
     2194        tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 
     2195 
     2196        triObj = new TriangleIntersectable(tri); 
     2197        triangles.push_back(triObj); 
     2198 
     2199        tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z);      
     2200        tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 
     2201    tri.mVertices[2] = Vector3(mMax.x, mMin.y ,mMin.z); 
     2202 
     2203 
     2204        triObj = new TriangleIntersectable(tri); 
     2205        triangles.push_back(triObj); 
     2206 
     2207        tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 
     2208        tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 
     2209        tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 
     2210 
     2211        triObj = new TriangleIntersectable(tri); 
     2212        triangles.push_back(triObj); 
     2213 
     2214        tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 
     2215        tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 
     2216        tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z); 
     2217     
     2218        triObj = new TriangleIntersectable(tri); 
     2219        triangles.push_back(triObj); 
     2220 
     2221        tri.mVertices[0] = Vector3(mMin.x, mMax.y, mMin.z); 
     2222        tri.mVertices[1] = Vector3(mMax.x, mMax.y, mMin.z); 
     2223    tri.mVertices[2] = Vector3(mMax.x, mMin.y, mMin.z); 
     2224 
     2225            
     2226        triObj = new TriangleIntersectable(tri); 
     2227        triangles.push_back(triObj); 
     2228 
     2229    tri.mVertices[0] = Vector3(mMax.x, mMin.y, mMin.z); 
     2230        tri.mVertices[1] = Vector3(mMin.x, mMin.y, mMin.z); 
     2231        tri.mVertices[2] = Vector3(mMin.x, mMax.y, mMin.z); 
     2232            
     2233        triObj = new TriangleIntersectable(tri); 
     2234        triangles.push_back(triObj); 
     2235 
     2236    tri.mVertices[0] = Vector3(mMin.x, mMin.y, mMax.z); 
     2237        tri.mVertices[1] = Vector3(mMax.x, mMin.y, mMax.z); 
     2238    tri.mVertices[2] = Vector3(mMax.x, mMax.y, mMax.z); 
     2239 
     2240            
     2241        triObj = new TriangleIntersectable(tri); 
     2242        triangles.push_back(triObj); 
     2243 
     2244    tri.mVertices[0] = Vector3(mMax.x, mMax.y, mMax.z); 
     2245    tri.mVertices[1] = Vector3(mMin.x, mMax.y, mMax.z); 
     2246    tri.mVertices[2] = Vector3(mMin.x, mMin.y, mMax.z); 
     2247            
     2248        triObj = new TriangleIntersectable(tri); 
     2249        triangles.push_back(triObj); 
    21382250} 
    21392251 
Note: See TracChangeset for help on using the changeset viewer.