Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Module input/handlers/dimension-navigation

    Pure dimension-navigation math extracted from input/input-handler.ts.

    Two helpers live here:

    • computeDimensionStep — given the current dim state, ranges, the selected-dimension index, and a navigation direction, returns {targetDim, newValue, changed} where changed is true only when newValue differs from the current value by more than a step-relative epsilon (snapStep * 1e-9, the same relative tolerance SceneDimsManager uses), so a dim whose grid is finer than a micro-unit is still navigable. The caller is responsible for actually mutating sceneDimsManager — keeping the math pure makes the wrap-around / clamping / discrete-rounding branches unit-testable in isolation.

    • resolveSelectedDimension — translate a 0-based key index into the new selectedDimension value. Returns null when the key points past the available navigable dimensions; in that case the caller logs the "not available" hint without mutating any state.

    DimensionStepResult
    computeDimensionStep
    getSelectedDimensionIndex
    resolveSelectedDimension