Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1.   for (int i=0; i<objects.size(); i++) {
  2.  
  3.     WavefrontObj* wfo = dynamic_cast<WavefrontObj*>( objects[i] );
  4.  
  5.     if (wfo || i != thisObjIndex) { // don't check for int with the originating object
  6.       vec3 point, normal;
  7.       Material *intMat;
  8.       float t;
  9.       int intPartIndex;
  10.  
  11.       if (objects[i]->rayInt( rayStart, rayDir, ((i != thisObjIndex) ? -1 : thisObjPartIndex), point, normal, t, intMat, intPartIndex ))
  12.     if (0 < t && t < param) {
  13.       param = t;
  14.       P = point;
  15.       N = normal;
  16.       objIndex = i;
  17.       objPartIndex = intPartIndex;
  18.       mat = intMat;
  19.     }
  20.     }
  21.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement