Ignore:
Timestamp:
07/12/05 21:08:40 (19 years ago)
Author:
bittner
Message:

mesh kd tree added

File:
1 edited

Legend:

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

    r162 r170  
    1212 
    1313class MeshInstance; 
     14class MeshKdTree; 
    1415 
    1516/// default vertex container for Mesh 
     
    1819/// vertex index container 
    1920typedef std::vector<int> VertexIndexContainer; 
    20  
    2121 
    2222 
     
    5454 
    5555  /// Default constructor 
    56   Mesh():mVertices(), mFaces(), mMaterial(NULL) {} 
     56  Mesh():mVertices(), mFaces(), mMaterial(NULL), mKdTree(NULL) {} 
    5757   
    5858  /// Constructor with container preallocation 
     
    6565    mFaces.reserve(faces); 
    6666  } 
    67  
     67   
    6868  ~Mesh() { 
    6969    for (int i=0; i < mFaces.size(); i++) 
     
    7575    mFaces.push_back(face); 
    7676  } 
    77  
     77   
    7878  void Preprocess(); 
    7979 
     
    8686  /** Patches forming the mesh */ 
    8787  FaceContainer mFaces; 
    88  
     88   
    8989  /** Global mesh material */ 
    9090  Material *mMaterial; 
    91  
     91   
    9292  /** true if the mesh is a convex mesh */ 
    9393  bool mIsConvex; 
     94 
     95  MeshKdTree *mKdTree; 
    9496   
    9597  int 
     
    99101          ); 
    100102 
     103  int 
     104  CastRayToSelectedFaces( 
     105                         Ray &ray, 
     106                         const vector<int> &faces, 
     107                         MeshInstance *instance 
     108                         ); 
    101109 
     110  int 
     111  CastRayToFace( 
     112                const int faceIndex, 
     113                Ray &ray, 
     114                float &nearestT, 
     115                int &nearestFace, 
     116                MeshInstance *instance 
     117                ); 
     118 
     119   
    102120  int 
    103121  RayFaceIntersection(const int faceIndex, 
     
    106124                      const float nearestT 
    107125                      ); 
    108  
     126   
    109127  Plane3 GetFacePlane(const int faceIndex); 
    110128 
     129  AxisAlignedBox3 GetFaceBox(const int faceIndex); 
     130   
    111131}; 
    112132 
     
    139159          ); 
    140160   
     161  virtual int 
     162  CastRay( 
     163          Ray &ray, 
     164          const vector<int> &faces 
     165          ); 
     166 
    141167 
    142168}; 
Note: See TracChangeset for help on using the changeset viewer.