InternalColor for the diagonal length wire / its label / the anchor dots.
True once destroy has run.
Diagonal world length between the two anchors.
World-space origin anchor.
World-space target anchor.
InternalRecompute screen positions of all sub-elements. Called by the tool once per camera-update tick — endpoints in world space, canvas in pixels.
project(worldPos) must return [canvasX, canvasY, w] where w
is the homogeneous w-component of the clip-space coordinate; a
non-positive w means "behind the camera" and the corresponding
sub-element is hidden.
Tear down all DOM/SVG. Idempotent.
One distance measurement — two world-space anchors plus the overlay DOM/SVG that shows the diagonal length and its X / Y / Z component decomposition.
Instances are created and owned by DistanceMeasurementTool; external callers should go through the tool's DistanceMeasurementTool.createMeasurement factory and call DistanceMeasurementTool.destroyMeasurement (or DistanceMeasurementTool.clear) to tear them down.
Layout
The measurement composes 4 wires and 4 labels:
The X / Y / Z polyline traces the right-angled "stair-step" between the two anchors so the user can visualise each component separately. The four label divs sit at each wire's midpoint.
Toggles visible, wireVisible, axisVisible, labelsVisible compose like CSS visibility — hiding the whole measurement (
visible = false) overrides the others.