Changeset 2728


Ignore:
Timestamp:
05/30/08 10:38:15 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

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

    r2727 r2728  
    17161716 
    17171717 
    1718  
    1719 } 
     1718void Preprocessor::CastRays4(SimpleRayContainer &rays, VssRayContainer &vssRays) 
     1719{ 
     1720        const int packetSize = 4; 
     1721 
     1722        static int hit_triangles[packetSize]; 
     1723        static float dist[packetSize]; 
     1724        static Vector3 dirs[packetSize]; 
     1725        static Vector3 shifts[packetSize]; 
     1726        static Vector3 origs[packetSize]; 
     1727 
     1728 
     1729        SimpleRayContainer::const_iterator it, it_end = rays.end(); 
     1730 
     1731        for (it = rays.begin(); it != it_end; ++ it) 
     1732        { 
     1733 
     1734                SimpleRay mainRay = *it; 
     1735 
     1736                origs[0] = mainRay.mOrigin; 
     1737                dirs[0] = mainRay.mDirection; 
     1738 
     1739                for (i = 1; i < packetSize; i++)  
     1740                { 
     1741                        origs[i] = mainRay.mOrigin; 
     1742 
     1743                        const float pertubDir = 0.01f; 
     1744                        Vector3 pertub; 
     1745 
     1746                        pertub.x = RandomValue(-pertubDir, pertubDir); 
     1747                        pertub.y = RandomValue(-pertubDir, pertubDir); 
     1748                        pertub.z = RandomValue(-pertubDir, pertubDir); 
     1749 
     1750                        dirs[i] = mainRay.mDirection + pertub; 
     1751                        const float c = Magnitude(newDir); 
     1752                        dirs{i] *= 1.0f / c; 
     1753                } 
     1754 
     1755                AxisAlignedBox3 box; 
     1756                preprocessor->mRayCaster->CastRaysPacket4(box.Min(), 
     1757                                                                                                  box.Max(), 
     1758                                                                                                  origs, 
     1759                                                                                                  dirs, 
     1760                                                                                                  hit_triangles, 
     1761                                                                                                  dist);        
     1762        } 
     1763 
     1764        DeterminePvsObjects(vssRays); 
     1765} 
     1766 
     1767 
     1768} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h

    r2726 r2728  
    166166                                                  VssRayContainer &reverseRays); 
    167167 
     168        virtual void CastRays4(SimpleRayContainer &rays, 
     169                                                   VssRayContainer &vssRays); 
     170 
    168171        /** Returns true if we sampled a closer triangle than with the previous ray.  
    169172                Does reverse sampling if gap found. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2726 r2728  
    803803bool ViewCellBasedDistribution::GenerateSample(SimpleRay &ray) 
    804804{ 
     805         
     806        static Vector3 origin; 
     807        static Vector3 direction;  
     808        static Vector3 point; 
     809        static Vector3 normal; 
     810        static float r[2]; 
     811 
    805812        sHalton.GetNext(2, r); 
    806813        direction = UniformRandomVector(r[0], r[1]); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h

    r2726 r2728  
    77#include "common.h" 
    88#include "Halton.h" 
    9 #include "Vector3.h" 
     9 
    1010 
    1111namespace GtpVisibilityPreprocessor { 
     
    263263        ViewCell *mViewCell; 
    264264 
    265         Vector3 origin; 
    266         Vector3 direction;  
    267         Vector3 point; 
    268         Vector3 normal; 
    269         float r[2]; 
    270265 
    271266        static HaltonSequence sHalton; 
Note: See TracChangeset for help on using the changeset viewer.