MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / IntersectsEntry

Method IntersectsEntry

Source/Engine/Level/Actors/AnimatedModel.cpp:1340–1358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1338}
1339
1340bool 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
1360bool AnimatedModel::IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex)
1361{

Callers

nothing calls this directly

Calls 4

GetMethod · 0.45
IsInitializedMethod · 0.45
CountMethod · 0.45
IntersectsMethod · 0.45

Tested by

no test coverage detected