| 176 | } |
| 177 | |
| 178 | bool CullingManager::computeIntersectionPoints(Ogre::Camera* camera, std::vector<Ogre::Vector3>& ogreVectors) |
| 179 | { |
| 180 | if(ogreVectors.size() != 4) |
| 181 | { |
| 182 | OD_LOG_ERR("Unexpected size for ogreVectors size=" + Helper::toString(ogreVectors.size())); |
| 183 | return false; |
| 184 | } |
| 185 | |
| 186 | const Ogre::Vector3* cameraVector = camera->getWorldSpaceCorners(); |
| 187 | for(int ii = 0 ; ii < 4; ++ii) |
| 188 | { |
| 189 | Ogre::Ray ray(cameraVector[ii], cameraVector[ii+4] - cameraVector[ii]); |
| 190 | std::pair<bool, Ogre::Real> intersectionResult = ray.intersects(GROUND_PLANE); |
| 191 | if(intersectionResult.first) |
| 192 | ogreVectors[ii]= (ray.getPoint(intersectionResult.second)); |
| 193 | else |
| 194 | { |
| 195 | OD_LOG_ERR("I didn't find the intersection point for " + Helper::toString(ii) + "th ray "); |
| 196 | } |
| 197 | } |
| 198 | return true; |
| 199 | } |
| 200 | |
| 201 | void CullingManager::update(Ogre::Camera* camera, const std::vector<Ogre::Vector3>& ogreVectors) |
| 202 | { |
no test coverage detected