1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Animation constants
/// Tolerance for detecting external camera input during animations.
/// Values within this threshold are considered unchanged (accounts for floating point noise).
pub const EXTERNAL_INPUT_TOLERANCE: f32 = 1e-6;
// Fit constants
/// Maximum centering iterations per candidate radius.
pub const CENTERING_MAX_ITERATIONS: usize = 10;
/// Normalized screen-space center offset tolerance.
pub const CENTERING_TOLERANCE: f32 = 0.0001;
/// Minimum screen-space extent before treating a dimension as degenerate (edge-on).
/// Below this threshold the dimension is ignored for fit purposes.
pub const DEGENERATE_EXTENT_THRESHOLD: f32 = 1e-6;
/// Initial best-guess radius as a multiple of the object radius (2x).
pub const INITIAL_RADIUS_MULTIPLIER: f32 = 2.0;
/// Maximum allowed margin value.
pub const MAX_MARGIN: f32 = 0.9999;
/// Maximum binary search iterations.
pub const MAX_ITERATIONS: usize = 200;
/// Maximum search radius as a multiple of the object radius (100x).
pub const MAX_RADIUS_MULTIPLIER: f32 = 100.0;
/// Minimum allowed margin value.
pub const MIN_MARGIN: f32 = 0.0;
/// Minimum search radius as a fraction of the object radius (0.1x).
pub const MIN_RADIUS_MULTIPLIER: f32 = 0.1;
/// Convergence tolerance (0.1% of search range).
pub const TOLERANCE: f32 = 0.001;
// Input constants
/// Conversion factor from mouse drag delta to scroll-equivalent zoom input.
pub const BUTTON_ZOOM_SCALE: f32 = 0.03;
/// Amplification factor for trackpad pinch gesture input.
pub const PINCH_GESTURE_AMPLIFICATION: f32 = 10.0;
/// Scale factor for converting pixel-based scroll events to zoom input.
pub const PIXEL_SCROLL_SCALE: f32 = 0.005;
// Orbit constants
/// Approximate-equality threshold for floating-point convergence checks.
pub const EPSILON: f32 = 0.001;
/// Minimum orbit radius when camera and focus coincide.
pub const MIN_ORBIT_RADIUS: f32 = 0.05;
/// Fraction of current radius applied per scroll unit.
pub const SCROLL_ZOOM_FACTOR: f32 = 0.2;
/// Exponent that shapes the smoothing response curve.
pub const SMOOTHNESS_EXPONENT: i32 = 7;
/// Conversion factor from two-finger touch pinch to zoom input.
pub const TOUCH_PINCH_SCALE: f32 = 0.015;
// Projection constants
/// Minimum depth for a point to be considered in front of the camera.
/// Points at or below this depth are treated as behind the camera in perspective projection.
pub const MIN_VISIBLE_DEPTH: f32 = 0.1;