/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import { Vector3 } from "@vertexvis/geometry";
export function constrainViewVector(viewVector, boundingSphere) {
    const magnitude = Vector3.magnitude(viewVector);
    const scale = boundingSphere.radius / magnitude;
    return Vector3.scale(scale, viewVector);
}
export function updateLookAtRelativeToBoundingBoxCenter(originalLookAt, viewVector, boundingSphereCenter) {
    const updatedCenterPoint = Vector3.subtract(boundingSphereCenter, originalLookAt);
    const orthogonalOffset = Vector3.dot(viewVector, updatedCenterPoint);
    const viewVectorMagnitudeSquared = Vector3.magnitudeSquared(viewVector);
    const offset = orthogonalOffset / viewVectorMagnitudeSquared;
    const scaledViewVectorForOffset = Vector3.scale(offset, viewVector);
    return Vector3.add(scaledViewVectorForOffset, originalLookAt);
}
//# sourceMappingURL=vectors.js.map
