-------------------------------------------------------------------------------
| 91 | |
| 92 | // ------------------------------------------------------------------------------- |
| 93 | void FindSceneCenter(aiScene *scene, aiVector3D &out, aiVector3D &min, aiVector3D &max) { |
| 94 | if (nullptr == scene) { |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | if (0 == scene->mNumMeshes) { |
| 99 | return; |
| 100 | } |
| 101 | FindMeshCenter(scene->mMeshes[0], out, min, max); |
| 102 | for (unsigned int i = 1; i < scene->mNumMeshes; ++i) { |
| 103 | aiVector3D tout, tmin, tmax; |
| 104 | FindMeshCenter(scene->mMeshes[i], tout, tmin, tmax); |
| 105 | if (min[0] > tmin[0]) min[0] = tmin[0]; |
| 106 | if (min[1] > tmin[1]) min[1] = tmin[1]; |
| 107 | if (min[2] > tmin[2]) min[2] = tmin[2]; |
| 108 | if (max[0] < tmax[0]) max[0] = tmax[0]; |
| 109 | if (max[1] < tmax[1]) max[1] = tmax[1]; |
| 110 | if (max[2] < tmax[2]) max[2] = tmax[2]; |
| 111 | } |
| 112 | out = min + (max - min) * (ai_real)0.5; |
| 113 | } |
| 114 | |
| 115 | // ------------------------------------------------------------------------------- |
| 116 | void FindMeshCenterTransformed(aiMesh *mesh, aiVector3D &out, aiVector3D &min, |
nothing calls this directly
no test coverage detected