| 163 | } |
| 164 | |
| 165 | bool Model::isCompiled() const |
| 166 | { |
| 167 | if (lodLevels.empty()) |
| 168 | { |
| 169 | return false; |
| 170 | } |
| 171 | |
| 172 | bool hasAnyGeometry = false; |
| 173 | |
| 174 | for (const auto& lod : lodLevels) |
| 175 | { |
| 176 | const auto& mesh = lod.mesh; |
| 177 | |
| 178 | // Special LODs like hitpoints may be empty |
| 179 | if (mesh.vertices.empty() && mesh.triangles.empty()) |
| 180 | { |
| 181 | continue; |
| 182 | } |
| 183 | |
| 184 | if (mesh.HasGeometry()) |
| 185 | { |
| 186 | hasAnyGeometry = true; |
| 187 | |
| 188 | if (mesh.boundingSphere.radius <= 0.0f) |
| 189 | { |
| 190 | return false; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | // Point-only LODs (e.g., hitpoints) may have vertices without triangles — valid |
| 195 | } |
| 196 | |
| 197 | return !hasAnyGeometry || boundingSphere.radius > 0.0f; |
| 198 | } |
| 199 | |
| 200 | } // namespace Poseidon::Model |