| 210 | } |
| 211 | |
| 212 | void outputModelStatus(BulletShapeModel &bulletModel) { |
| 213 | qDebug() << "Bullet shape model status:"; |
| 214 | qDebug() << " Name: " << bulletModel.name(); |
| 215 | qDebug() << " Tolerance: " << bulletModel.getTolerance(); |
| 216 | qDebug() << "Model has intersection? " << bulletModel.hasIntersection(); |
| 217 | SurfacePoint *intersection = NULL; |
| 218 | if ( bulletModel.hasIntersection() ) { |
| 219 | intersection = bulletModel.surfaceIntersection(); |
| 220 | qDebug() << " Surface Point: (" |
| 221 | << intersection->GetX().kilometers() << ", " |
| 222 | << intersection->GetY().kilometers() << ", " |
| 223 | << intersection->GetZ().kilometers() << ")"; |
| 224 | } |
| 225 | qDebug() << "Model has normal? " << bulletModel.hasLocalNormal(); |
| 226 | std::vector<double> normal; |
| 227 | if ( bulletModel.hasLocalNormal() ) { |
| 228 | normal = bulletModel.localNormal(); |
| 229 | qDebug() << " Local Normal: (" |
| 230 | << normal[0] << ", " |
| 231 | << normal[1] << ", " |
| 232 | << normal[2] << ")"; |
| 233 | if ( bulletModel.hasIntersection() ) { |
| 234 | bulletModel.calculateDefaultNormal(); |
| 235 | normal = bulletModel.normal(); |
| 236 | qDebug() << " Ellipsoid Normal: (" |
| 237 | << normal[0] << ", " |
| 238 | << normal[1] << ", " |
| 239 | << normal[2] << ")"; |
| 240 | bulletModel.setLocalNormalFromIntercept(); |
| 241 | normal = bulletModel.localNormal(); |
| 242 | qDebug() << " Recalculated Local Normal: (" |
| 243 | << normal[0] << ", " |
| 244 | << normal[1] << ", " |
| 245 | << normal[2] << ")"; |
| 246 | } |
| 247 | } |
| 248 | qDebug() << ""; |
| 249 | } |
| 250 | |
| 251 | void testCameraToGround(std::vector<double> &observer, |
| 252 | std::vector<double> &lookDir, |
no test coverage detected