Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. for ( int i=0; i<static_cast<int>(index_count); i += 3)
  3. {
  4. // check for a hit against this triangle
  5. std::pair<bool, Ogre::Real> hit = Ogre::Math::intersects(ray, vertices[indices[i]], vertices[indices[i+1]], vertices[indices[i+2]], true, false);
  6.  
  7. // if it was a hit check if its the closest
  8. if( hit.first && (closest_distance < 0.0f || hit.second < closest_distance) )
  9. {
  10. // this is the closest so far, save it off
  11. closest_distance = hit.second;
  12. new_closest_found = true;
  13. unsigned long ix = index_count/tricount;
  14. temp1 = indices[i];
  15. temp2 = indices[i+1];
  16. temp3 = indices[i+2];
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement