Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/pbvh.c
| Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
| /* Returns the index of the first element on the right of the partition */ | /* Returns the index of the first element on the right of the partition */ | ||||
| static int partition_indices_faces(int *prim_indices, | static int partition_indices_faces(int *prim_indices, | ||||
| int *prim_scratch, | int *prim_scratch, | ||||
| int lo, | int lo, | ||||
| int hi, | int hi, | ||||
| int axis, | int axis, | ||||
| float mid, | float mid, | ||||
| BBC *prim_bbc, | BBC *prim_bbc, | ||||
| const MLoopTri *looptri, | const MLoopTri *looptri) | ||||
| const MPoly *mpoly) | |||||
| { | { | ||||
| for (int i = lo; i < hi; i++) { | for (int i = lo; i < hi; i++) { | ||||
| prim_scratch[i - lo] = prim_indices[i]; | prim_scratch[i - lo] = prim_indices[i]; | ||||
| } | } | ||||
| int lo2 = lo, hi2 = hi - 1; | int lo2 = lo, hi2 = hi - 1; | ||||
| int i1 = lo, i2 = 0; | int i1 = lo, i2 = 0; | ||||
| ▲ Show 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | if (!below_leaf_limit) { | ||||
| if (pbvh->header.type == PBVH_FACES) { | if (pbvh->header.type == PBVH_FACES) { | ||||
| end = partition_indices_faces(pbvh->prim_indices, | end = partition_indices_faces(pbvh->prim_indices, | ||||
| prim_scratch, | prim_scratch, | ||||
| offset, | offset, | ||||
| offset + count, | offset + count, | ||||
| axis, | axis, | ||||
| (cb->bmax[axis] + cb->bmin[axis]) * 0.5f, | (cb->bmax[axis] + cb->bmin[axis]) * 0.5f, | ||||
| prim_bbc, | prim_bbc, | ||||
| pbvh->looptri, | pbvh->looptri); | ||||
| pbvh->mpoly); | |||||
| } | } | ||||
| else { | else { | ||||
| end = partition_indices_grids(pbvh->prim_indices, | end = partition_indices_grids(pbvh->prim_indices, | ||||
| prim_scratch, | prim_scratch, | ||||
| offset, | offset, | ||||
| offset + count, | offset + count, | ||||
| axis, | axis, | ||||
| (cb->bmax[axis] + cb->bmin[axis]) * 0.5f, | (cb->bmax[axis] + cb->bmin[axis]) * 0.5f, | ||||
| ▲ Show 20 Lines • Show All 3,269 Lines • Show Last 20 Lines | |||||