- Timestamp:
- 05/30/08 10:38:15 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2727 r2728 1716 1716 1717 1717 1718 1719 } 1718 void 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 166 166 VssRayContainer &reverseRays); 167 167 168 virtual void CastRays4(SimpleRayContainer &rays, 169 VssRayContainer &vssRays); 170 168 171 /** Returns true if we sampled a closer triangle than with the previous ray. 169 172 Does reverse sampling if gap found. -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r2726 r2728 803 803 bool ViewCellBasedDistribution::GenerateSample(SimpleRay &ray) 804 804 { 805 806 static Vector3 origin; 807 static Vector3 direction; 808 static Vector3 point; 809 static Vector3 normal; 810 static float r[2]; 811 805 812 sHalton.GetNext(2, r); 806 813 direction = UniformRandomVector(r[0], r[1]); -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r2726 r2728 7 7 #include "common.h" 8 8 #include "Halton.h" 9 #include "Vector3.h" 9 10 10 11 11 namespace GtpVisibilityPreprocessor { … … 263 263 ViewCell *mViewCell; 264 264 265 Vector3 origin;266 Vector3 direction;267 Vector3 point;268 Vector3 normal;269 float r[2];270 265 271 266 static HaltonSequence sHalton;
Note: See TracChangeset
for help on using the changeset viewer.