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