molstar
Version:
A comprehensive macromolecular library.
20 lines (19 loc) • 1.17 kB
TypeScript
/**
* Copyright (c) 2025 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Adam Midlik <midlik@gmail.com>
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { Vec3 } from '../mol-math/linear-algebra/3d/vec3.js';
type CameraMode = 'perspective' | 'orthographic';
/** Return the position for a camera with an arbitrary field of view `fov`
* necessary to just fit into view the same sphere (with center at `target`)
* as the "reference camera" placed at `refPosition` would fit, while keeping the camera orientation.
* The "reference camera" is a camera which can just fit into view a sphere of radius R with center at distance 2R
* (this corresponds to FOV = 2 * asin(1/2) in perspective mode or FOV = 2 * atan(1/2) in orthographic mode). */
export declare function fovAdjustedPosition(target: Vec3, refPosition: Vec3, mode: CameraMode, fov: number): Vec3;
/** Return the inverse of fovAdjustedPosition to be able to store invariant camera position,
* e.g., in MolViewSpec snapshots.
*/
export declare function fovNormalizedCameraPosition(target: Vec3, refPosition: Vec3, mode: CameraMode, fov: number): Vec3;
export {};