setLength method

dynamic setLength(
  1. dynamic length,
  2. dynamic headLength,
  3. dynamic headWidth
)

Implementation

setLength(length, headLength, headWidth) {
  headLength ??= 0.2 * length;
  headWidth ??= 0.2 * headLength;

  line.scale.set(1, Math.max(0.0001, length - headLength), 1); // see #17458
  line.updateMatrix();

  cone.scale.set(headWidth, headLength, headWidth);
  cone.position.y = length;
  cone.updateMatrix();
}