| 605 | } |
| 606 | |
| 607 | bool StaticModel::IntersectsEntry(int32 entryIndex, const Ray& ray, Real& distance, Vector3& normal) |
| 608 | { |
| 609 | auto model = Model.Get(); |
| 610 | if (!model || !model->IsInitialized() || model->GetLoadedLODs() == 0) |
| 611 | return false; |
| 612 | |
| 613 | // Find mesh in the highest loaded LOD that is using the given material slot index and ray hits it |
| 614 | auto& meshes = model->LODs[model->HighestResidentLODIndex()].Meshes; |
| 615 | for (int32 i = 0; i < meshes.Count(); i++) |
| 616 | { |
| 617 | const auto& mesh = meshes[i]; |
| 618 | if (mesh.GetMaterialSlotIndex() == entryIndex && mesh.Intersects(ray, _transform, distance, normal)) |
| 619 | return true; |
| 620 | } |
| 621 | |
| 622 | distance = 0; |
| 623 | normal = Vector3::Up; |
| 624 | return false; |
| 625 | } |
| 626 | |
| 627 | bool StaticModel::IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) |
| 628 | { |
no test coverage detected