Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-09-27 15:23:10 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-09-27 15:24:49 +0300
commit0901a72b6b36b0bc0d2b0783a949e66dcb17a91c (patch)
tree942cba14c0efb8a7f50779db310b42ef2a802903 /source/blender/blenkernel/intern/pbvh.c
parentc5db0272d4befa4ee8c7da8dec8932e379a7275f (diff)
Cleanup: use consistent clipping plane sign convention
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 0eca4489309..eac18c79891 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -2171,12 +2171,13 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3],
const float bb_max[3],
const float (*planes)[4])
{
- float vmin[3], vmax[3];
PlaneAABBIsect ret = ISECT_INSIDE;
for (int i = 0; i < 4; i++) {
+ float vmin[3], vmax[3];
+
for (int axis = 0; axis < 3; axis++) {
- if (planes[i][axis] > 0) {
+ if (planes[i][axis] < 0) {
vmin[axis] = bb_min[axis];
vmax[axis] = bb_max[axis];
}
@@ -2186,10 +2187,10 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3],
}
}
- if (dot_v3v3(planes[i], vmin) + planes[i][3] > 0) {
+ if (dot_v3v3(planes[i], vmin) + planes[i][3] < 0) {
return ISECT_OUTSIDE;
}
- else if (dot_v3v3(planes[i], vmax) + planes[i][3] >= 0) {
+ else if (dot_v3v3(planes[i], vmax) + planes[i][3] <= 0) {
ret = ISECT_INTERSECT;
}
}