Avoid unqualified-id "near" and "far" in Node3DEditor/Viewport
This commit is contained in:
@@ -117,11 +117,6 @@ AABB AABB::intersection(const AABB &p_aabb) const {
|
||||
return AABB(min, max - min);
|
||||
}
|
||||
|
||||
#ifdef MINGW_ENABLED
|
||||
#undef near
|
||||
#undef far
|
||||
#endif
|
||||
|
||||
bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip, Vector3 *r_normal) const {
|
||||
#ifdef MATH_CHECKS
|
||||
if (unlikely(size.x < 0 || size.y < 0 || size.z < 0)) {
|
||||
@@ -130,8 +125,8 @@ bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *
|
||||
#endif
|
||||
Vector3 c1, c2;
|
||||
Vector3 end = position + size;
|
||||
real_t near = -1e20;
|
||||
real_t far = 1e20;
|
||||
real_t depth_near = -1e20;
|
||||
real_t depth_far = 1e20;
|
||||
int axis = 0;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@@ -146,14 +141,14 @@ bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *
|
||||
if (c1[i] > c2[i]) {
|
||||
SWAP(c1, c2);
|
||||
}
|
||||
if (c1[i] > near) {
|
||||
near = c1[i];
|
||||
if (c1[i] > depth_near) {
|
||||
depth_near = c1[i];
|
||||
axis = i;
|
||||
}
|
||||
if (c2[i] < far) {
|
||||
far = c2[i];
|
||||
if (c2[i] < depth_far) {
|
||||
depth_far = c2[i];
|
||||
}
|
||||
if ((near > far) || (far < 0)) {
|
||||
if ((depth_near > depth_far) || (depth_far < 0)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user