|
|
@ -786,6 +786,16 @@ void makeHalfPlane(const HalfPlaneDesc& halfPlaneDesc, VisiblePrimitiveRep& visi |
|
|
|
tensor.m(uvector3(1, 0, 0)) = halfPlaneDesc.normal(0); |
|
|
|
tensor.m(uvector3(0, 1, 0)) = halfPlaneDesc.normal(1); |
|
|
|
tensor.m(uvector3(0, 0, 1)) = halfPlaneDesc.normal(2); |
|
|
|
// AABB
|
|
|
|
visiblePrimitive.aabb.min = -std::numeric_limits<real>::max(); |
|
|
|
visiblePrimitive.aabb.max = std::numeric_limits<real>::max(); |
|
|
|
for (int dim = 0; dim < 3; ++dim) { |
|
|
|
if (halfPlaneDesc.normal(dim) == 1) { |
|
|
|
visiblePrimitive.aabb.max(dim) = halfPlaneDesc.basePt(dim); |
|
|
|
} else if (halfPlaneDesc.normal(dim) == -1) { |
|
|
|
visiblePrimitive.aabb.min(dim) = halfPlaneDesc.basePt(dim); |
|
|
|
} |
|
|
|
} |
|
|
|
// subBlobTree
|
|
|
|
visiblePrimitive.subBlobTree.clear(); |
|
|
|
buildNearBalancedBlobTree(visiblePrimitive.subBlobTree, 1); |
|
|
|