sample method
dynamic
sample(
- dynamic targetPosition,
- dynamic targetNormal,
- dynamic targetColor
Implementation
sample(targetPosition, targetNormal, targetColor) {
var cumulativeTotal = distribution![distribution!.length - 1];
var faceIndex = binarySearch(randomFunction() * cumulativeTotal);
return sampleFace(faceIndex, targetPosition, targetNormal, targetColor);
}