Ignore:
Timestamp:
01/12/06 13:20:25 (18 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
1 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Beam.cpp

    r513 r522  
    6565  return result; 
    6666} 
     67 
     68 
     69void Beam::ComputeFrustum(float &near, float &far, 
     70                                                  float &left, float &right, 
     71                                                  float &bottom, float &top, 
     72                                                  const AxisAlignedBox3 &sceneBBox) 
     73{ 
     74        const float xDirRange = mDirBox.Max().x - mDirBox.Min().x; 
     75        const float yDirRange = mDirBox.Max().y - mDirBox.Min().y; 
     76 
     77        near = 1; // NOTE: what is the best value for near and far plane? 
     78        far = sceneBBox.Size(sceneBBox.Size().DrivingAxis()); 
     79 
     80        left = 1.0f / tan(xDirRange * 0.5); 
     81        right = 1.0f / tan(xDirRange * 0.5); 
     82 
     83        bottom = 1.0f / tan(yDirRange * 0.5); 
     84        top = 1.0f / tan(yDirRange * 0.5); 
     85} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Beam.h

    r513 r522  
    3535          const AxisAlignedBox3 &dBox); 
    3636   
    37    
    38   int 
    39           ComputeIntersection(const AxisAlignedBox3 &box); 
     37  void ComputeFrustum(float &near, float &far, 
     38                                          float &left, float &right, 
     39                                          float &bottom, float &top, 
     40                                          const AxisAlignedBox3 &sceneBBox); 
     41 
     42  int ComputeIntersection(const AxisAlignedBox3 &box); 
    4043 
    4144  bool IsValid() { return mFlags & VALID; } 
     
    4548  { 
    4649  } 
    47    
    4850}; 
    4951 
Note: See TracChangeset for help on using the changeset viewer.