Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ( int i=0; i<static_cast<int>(index_count); i += 3)
- {
- // check for a hit against this triangle
- std::pair<bool, Ogre::Real> hit = Ogre::Math::intersects(ray, vertices[indices[i]], vertices[indices[i+1]], vertices[indices[i+2]], true, false);
- // if it was a hit check if its the closest
- if( hit.first && (closest_distance < 0.0f || hit.second < closest_distance) )
- {
- // this is the closest so far, save it off
- closest_distance = hit.second;
- new_closest_found = true;
- unsigned long ix = index_count/tricount;
- temp1 = indices[i];
- temp2 = indices[i+1];
- temp3 = indices[i+2];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement