Ignore:
Timestamp:
08/12/05 18:42:20 (19 years ago)
Author:
mattausch
Message:

added bsp stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Plane3.h

    r225 r237  
    4141                           float *t = NULL, 
    4242                           bool *coplanar = NULL 
    43                            ) const {return Vector3(0,0,0);} // TODO 
     43                           ) const  
     44  { 
     45          const Vector3 v = b - a; // line from A to B 
     46 
     47          float dv = DotProd(mNormal, v); 
     48          float u = 0; 
     49         
     50          if (dv) 
     51          { 
     52                  u = - Distance(a) / dv; 
     53                  Debug << "t: " << u << ", dv: " << dv << endl; 
     54                  if (coplanar) (*coplanar) = false; 
     55          } 
     56          else { 
     57                  Debug << "OHOH: " << u << endl; 
     58                  if (coplanar) (*coplanar) = true;        
     59          } 
     60          if (t) (*t) = u; 
     61          Debug << "A: " << a << ", B: " << b << ", result: " << (a + (u * v)) << endl; 
     62           
     63          return a + (u * v); 
     64  } 
    4465 
    4566  friend bool 
Note: See TracChangeset for help on using the changeset viewer.