Within my code, I have implemented an ArrowHelper and its parameters are updated through the function below (each invocation of this function adjusts the ArrowHelper's dimensions):
function updateArrowHelper() {
// Update parameters for transportedVector
transportedVector.arrowHelper.setLength(transportedVector.coordLocal.length(), headLengthVector, headWidthVector);
transportedVector.arrowHelper.setDirection(directionVector.normalize());
transportedVector.arrowHelper.position.copy(coordTorus);
transportedVector.arrowHelper.line.material.linewidth = widthVector;
transportedVector.arrowHelper.setColor(hexVector);
// Set head length and width to zero if dirVector.length is zero
if (transportedVector.coordLocal.length() == 0.0)
transportedVector.arrowHelper.setLength(0, 0, 0);
}
I am aiming to hide the head of the ArrowHelper
if its length (determined by
transportedVector.coordLocal.length()
) is zero. To achieve this, I implemented the following check:
// Set head length and width to zero if dirVector.length is zero
if (transportedVector.coordLocal.length() == 0.0)
transportedVector.arrowHelper.setLength(0, 0, 0);
However, upon execution, this approach does not yield the intended result. Despite the length being zero, the head of the ArrowHelper remains visible after the function is called. I am unsure as to why this is happening.
If anyone can identify the issue, I would greatly appreciate it.
Thank you in advance.