ensure brute force ray intersection works (#1170)
* ensure brute force ray intersection works in the same space as kd-tree intersection * add additional tests for ray casts against meshes using brute force approach * update api and add some additional test cases * comment tidy-up and other small updates/fixes for ray intersection code * fix issue with values at the end of a ray
This commit is contained in:
committed by
GitHub
parent
80f62d0523
commit
dd95d2b02e
@@ -208,10 +208,10 @@ namespace AZ
|
||||
bool ModelKdTree::RayIntersection(
|
||||
const AZ::Vector3& raySrc, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const
|
||||
{
|
||||
float closestDistanceNormalized = AZStd::numeric_limits<float>::max();
|
||||
if (RayIntersectionRecursively(m_pRootNode.get(), raySrc, rayDir, closestDistanceNormalized, normal))
|
||||
float shortestDistanceNormalized = AZStd::numeric_limits<float>::max();
|
||||
if (RayIntersectionRecursively(m_pRootNode.get(), raySrc, rayDir, shortestDistanceNormalized, normal))
|
||||
{
|
||||
distanceNormalized = closestDistanceNormalized;
|
||||
distanceNormalized = shortestDistanceNormalized;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user