normalize method

void normalize()

Ensures the individual values are locally valid. Does not ensure that the indexes are valid for a particular linear geometry.

@see clamp

Implementation

void normalize() {
  if (segmentFraction < 0.0) {
    segmentFraction = 0.0;
  }
  if (segmentFraction > 1.0) {
    segmentFraction = 1.0;
  }

  if (componentIndex < 0) {
    componentIndex = 0;
    segmentIndex = 0;
    segmentFraction = 0.0;
  }
  if (segmentIndex < 0) {
    segmentIndex = 0;
    segmentFraction = 0.0;
  }
  if (segmentFraction == 1.0) {
    segmentFraction = 0.0;
    segmentIndex += 1;
  }
}