|
|
@@ -132,7 +132,7 @@ void AnimatedModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQu
|
|
|
}
|
|
|
|
|
|
// Check ray hit distance to AABB before proceeding with bone-level tests
|
|
|
- if (query.ray_.HitDistance(GetWorldBoundingBox()) > query.maxDistance_)
|
|
|
+ if (query.ray_.HitDistance(GetWorldBoundingBox()) >= query.maxDistance_)
|
|
|
return;
|
|
|
|
|
|
const Vector<Bone>& bones = skeleton_.GetBones();
|
|
|
@@ -153,7 +153,7 @@ void AnimatedModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQu
|
|
|
const BoundingBox& box = bone.boundingBox_;
|
|
|
const Matrix3x4& transform = bone.node_->GetWorldTransform();
|
|
|
distance = query.ray_.HitDistance(box.Transformed(transform));
|
|
|
- if (distance > query.maxDistance_)
|
|
|
+ if (distance >= query.maxDistance_)
|
|
|
continue;
|
|
|
if (level != RAY_AABB)
|
|
|
{
|
|
|
@@ -161,7 +161,7 @@ void AnimatedModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQu
|
|
|
Matrix3x4 inverse = transform.Inverse();
|
|
|
Ray localRay(inverse * query.ray_.origin_, inverse * Vector4(query.ray_.direction_, 0.0f));
|
|
|
distance = localRay.HitDistance(box);
|
|
|
- if (distance > query.maxDistance_)
|
|
|
+ if (distance >= query.maxDistance_)
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
@@ -170,7 +170,7 @@ void AnimatedModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQu
|
|
|
boneSphere.center_ = bone.node_->GetWorldPosition();
|
|
|
boneSphere.radius_ = bone.radius_;
|
|
|
distance = query.ray_.HitDistance(boneSphere);
|
|
|
- if (distance > query.maxDistance_)
|
|
|
+ if (distance >= query.maxDistance_)
|
|
|
continue;
|
|
|
}
|
|
|
else
|