diff options
author | Anilforextra <anilforextra@gmail.com> | 2021-09-23 20:43:43 +0545 |
---|---|---|
committer | Anilforextra <anilforextra@gmail.com> | 2021-09-23 22:26:07 +0545 |
commit | cc51b045da4bf40722d347c6306b2764a1c9d813 (patch) | |
tree | 96323b3b6cd43dbbec3a74a9c09762c911e9dc32 /core | |
parent | 2ec1152b0fda21f2050b30e49630659697a5e68b (diff) |
Construct values only when necessary.
Diffstat (limited to 'core')
-rw-r--r-- | core/math/aabb.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index 33aa65f15d..51a1309f0e 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -52,8 +52,8 @@ void AABB::merge_with(const AABB &p_aabb) { beg_1 = position; beg_2 = p_aabb.position; - end_1 = Vector3(size.x, size.y, size.z) + beg_1; - end_2 = Vector3(p_aabb.size.x, p_aabb.size.y, p_aabb.size.z) + beg_2; + end_1 = size + beg_1; + end_2 = p_aabb.size + beg_2; min.x = (beg_1.x < beg_2.x) ? beg_1.x : beg_2.x; min.y = (beg_1.y < beg_2.y) ? beg_1.y : beg_2.y; |