Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. Ogre::Ray ray;
  2. ray.setOrigin(Ogre::Vector3( ray_pos.x, ray_pos.y, ray_pos.z));
  3. ray.setDirection(Ogre::Vector3(ray_dir.x, ray_dir.y, ray_dir.z));
  4. Ogre::Vector3 result;
  5.  
  6. RaycastFromPoint(ray.getOrigin(), ray.getDirection(), result, v1, v2, v3);
  7. float pointZ = out.pointlist[(3*i)+2];
  8.  
  9. if(result.z < pointZ)
  10. {
  11. std::cout << "Remove edge "<< u1 << " "<< u2 << " "<< u3 << std::endl;
  12. Utility::DebugPrimitives::drawSphere( result, 0.3f , "RayMesh"+std::to_string(counter), "SimpleColors/SolidGreen" );
  13.  
  14. cntEdges++;
  15. vertices= static_cast<uint16_t *>(vertexbuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));
  16. int j = 0;
  17. for (int i = 0; i<out.numberofvertices; i++)
  18. {
  19. if(vertices[i] == v1|| vertices[i] == v2|| vertices[i] == v3)
  20. {
  21. continue;
  22. }
  23. j++;
  24. vertices[j] = out.vertices[j];
  25.  
  26.  
  27. }
  28. vertexbuffer->unlock();
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement