Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ogre::Ray ray;
- ray.setOrigin(Ogre::Vector3( ray_pos.x, ray_pos.y, ray_pos.z));
- ray.setDirection(Ogre::Vector3(ray_dir.x, ray_dir.y, ray_dir.z));
- Ogre::Vector3 result;
- RaycastFromPoint(ray.getOrigin(), ray.getDirection(), result, v1, v2, v3);
- float pointZ = out.pointlist[(3*i)+2];
- if(result.z < pointZ)
- {
- std::cout << "Remove edge "<< u1 << " "<< u2 << " "<< u3 << std::endl;
- Utility::DebugPrimitives::drawSphere( result, 0.3f , "RayMesh"+std::to_string(counter), "SimpleColors/SolidGreen" );
- cntEdges++;
- vertices= static_cast<uint16_t *>(vertexbuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));
- int j = 0;
- for (int i = 0; i<out.numberofvertices; i++)
- {
- if(vertices[i] == v1|| vertices[i] == v2|| vertices[i] == v3)
- {
- continue;
- }
- j++;
- vertices[j] = out.vertices[j];
- }
- vertexbuffer->unlock();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement