Changeset 525 for trunk/VUT/GtpVisibilityPreprocessor/src/Beam.cpp
- Timestamp:
- 01/12/06 14:27:18 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Beam.cpp
r522 r525 67 67 68 68 69 void Beam::ComputeFrustum(float &near, float &far, 70 float &left, float &right, 69 void Beam::ComputeFrustum(float &left, float &right, 71 70 float &bottom, float &top, 72 const AxisAlignedBox3 &sceneBBox) 71 float &near, float &far, 72 const AxisAlignedBox3 &sceneBBox) const 73 73 { 74 74 const float xDirRange = mDirBox.Max().x - mDirBox.Min().x; 75 75 const float yDirRange = mDirBox.Max().y - mDirBox.Min().y; 76 76 77 near = 1; // NOTE: what is the best value for near and far plane?78 far = sceneBBox.Size(sceneBBox.Size().DrivingAxis());77 near = 0.1; // NOTE: what is the best value for near and far plane? 78 far = 2.0f * Magnitude(sceneBBox.Diagonal()); 79 79 80 left = 1.0f/ tan(xDirRange * 0.5);81 right = 1.0f/ tan(xDirRange * 0.5);80 left = near / tan(xDirRange * 0.5); 81 right = near / tan(xDirRange * 0.5); 82 82 83 bottom = 1.0f/ tan(yDirRange * 0.5);84 top = 1.0f/ tan(yDirRange * 0.5);83 bottom = near / tan(yDirRange * 0.5); 84 top = near / tan(yDirRange * 0.5); 85 85 } 86 87 Vector3 Beam::GetMainDirection() const 88 { 89 Vector3 directions[4]; 90 91 directions[0] = VssRay::GetDirection(dBox.Min().x, dBox.Min().y); 92 directions[1] = VssRay::GetDirection(dBox.Max().x, dBox.Min().y); 93 directions[2] = VssRay::GetDirection(dBox.Max().x, dBox.Max().y); 94 directions[3] = VssRay::GetDirection(dBox.Min().x, dBox.Max().y); 95 96 return Normalize(direction[0], direction[1], direction[2], direction[3]); 97 }
Note: See TracChangeset
for help on using the changeset viewer.