| 1338 | } |
| 1339 | |
| 1340 | bool AnimatedModel::IntersectsEntry(int32 entryIndex, const Ray& ray, Real& distance, Vector3& normal) |
| 1341 | { |
| 1342 | auto model = SkinnedModel.Get(); |
| 1343 | if (!model || !model->IsInitialized() || model->GetLoadedLODs() == 0) |
| 1344 | return false; |
| 1345 | |
| 1346 | // Find mesh in the highest loaded LOD that is using the given material slot index and ray hits it |
| 1347 | auto& meshes = model->LODs[model->HighestResidentLODIndex()].Meshes; |
| 1348 | for (int32 i = 0; i < meshes.Count(); i++) |
| 1349 | { |
| 1350 | const auto& mesh = meshes[i]; |
| 1351 | if (mesh.GetMaterialSlotIndex() == entryIndex && mesh.Intersects(ray, _transform, distance, normal)) |
| 1352 | return true; |
| 1353 | } |
| 1354 | |
| 1355 | distance = 0; |
| 1356 | normal = Vector3::Up; |
| 1357 | return false; |
| 1358 | } |
| 1359 | |
| 1360 | bool AnimatedModel::IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) |
| 1361 | { |
nothing calls this directly
no test coverage detected