diff options
author | Gosha <284210+Lordron@users.noreply.github.com> | 2022-04-18 22:41:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-18 21:41:31 +0200 |
commit | 428d8dc3b7616f7bb9d39c4b6343c5eec4e3c965 (patch) | |
tree | 989f238717c6af9eacc1728b226c8f3c42e3de32 | |
parent | aff4f875696108159ca05cc1ed370eab6dc0b12c (diff) |
Core/Vmaps: Use provided invDirection from G3D::Ray instead of calculating it ourselves (#27883)
Do not calculate inv direction, Ray has one
-rw-r--r-- | src/common/Collision/BoundingIntervalHierarchy.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/Collision/BoundingIntervalHierarchy.h b/src/common/Collision/BoundingIntervalHierarchy.h index b5ce289f905..59423581af8 100644 --- a/src/common/Collision/BoundingIntervalHierarchy.h +++ b/src/common/Collision/BoundingIntervalHierarchy.h @@ -117,12 +117,11 @@ class TC_COMMON_API BIH { float intervalMin = -1.f; float intervalMax = -1.f; - G3D::Vector3 org = r.origin(); - G3D::Vector3 dir = r.direction(); - G3D::Vector3 invDir; + G3D::Vector3 const& org = r.origin(); + G3D::Vector3 const& dir = r.direction(); + G3D::Vector3 const& invDir = r.invDirection(); for (int i=0; i<3; ++i) { - invDir[i] = 1.f / dir[i]; if (G3D::fuzzyNe(dir[i], 0.0f)) { float t1 = (bounds.low()[i] - org[i]) * invDir[i]; |