-
Notifications
You must be signed in to change notification settings - Fork 176
Refactor SettingsManager #1240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thkruz
merged 12 commits into
develop
from
claude/review-settings-atte-01WArWR5wakabb7LcckHVFCS
Nov 16, 2025
Merged
Refactor SettingsManager #1240
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d82f904
Merge pull request #1198 from thkruz/develop
thkruz bf110f2
Merge pull request #1227 from thkruz/develop
thkruz dcf72c9
refactor(settings): reorganize SettingsManager into category-based mo…
claude 0719e4d
refactor(settings): update imports to use new module paths and clean …
thkruz fb38f32
fix(settings): add interface declaration for TypeScript property type…
claude eee1bb2
refactor(settings): enhance type safety for texture quality propertie…
thkruz 211c4bd
Merge branch 'develop' into claude/review-settings-atte-01WArWR5wakab…
thkruz 8c0afed
Update src/settings/camera-settings.ts
thkruz 3dfec1a
Update src/settings/ui-settings.ts
thkruz 703f376
Update src/settings/ui-settings.ts
thkruz d26bfbf
Update src/settings/camera-settings.ts
thkruz 4e881a2
Update src/settings/ui-settings.ts
thkruz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| /** | ||
| * ///////////////////////////////////////////////////////////////////////////// | ||
| * | ||
| * @Copyright (C) 2025 Kruczek Labs LLC | ||
| * | ||
| * KeepTrack is free software: you can redistribute it and/or modify it under the | ||
| * terms of the GNU Affero General Public License as published by the Free Software | ||
| * Foundation, either version 3 of the License, or (at your option) any later version. | ||
| * | ||
| * KeepTrack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
| * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| * See the GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License along with | ||
| * KeepTrack. If not, see <http://www.gnu.org/licenses/>. | ||
| * | ||
| * ///////////////////////////////////////////////////////////////////////////// | ||
| */ | ||
|
|
||
| import { Radians, Kilometers } from '@app/engine/ootk/src/main'; | ||
| import { RADIUS_OF_EARTH } from '../engine/utils/constants'; | ||
|
|
||
| /** | ||
| * Camera movement, zoom, and field of view settings | ||
| */ | ||
| export class CameraSettings { | ||
| // Field of View | ||
| /** | ||
| * The initial field of view settings for FPS, Planetarium, Astronomy, and Satellite View | ||
| */ | ||
| fieldOfView = 0.6 as Radians; | ||
| /** | ||
| * @deprecated | ||
| * The maximum value for the field of view setting. | ||
| * | ||
| * TODO: Implement this for FPS, Planetarium, Astronomy, and Satellite View | ||
| */ | ||
| fieldOfViewMax = 1.2 as Radians; | ||
| /** | ||
| * @deprecated | ||
| * The minimum value for the field of view setting. | ||
| * | ||
| * * TODO: Implement this for FPS, Planetarium, Astronomy, and Satellite View | ||
| */ | ||
| fieldOfViewMin = 0.04; | ||
|
|
||
| // Camera Movement | ||
| /** | ||
| * The speed at which the camera decays. | ||
| * | ||
| * Reduce this give momentum to camera changes | ||
| */ | ||
| cameraDecayFactor = 5; | ||
| /** | ||
| * The speed at which the camera moves. | ||
| * | ||
| * TODO: This needs to be made read-only and a sepearate internal camera variable should be used to handle | ||
| * the logic when shift is pressed | ||
| */ | ||
| cameraMovementSpeed = 0.003; | ||
| /** | ||
| * The minimum speed at which the camera moves. | ||
| * | ||
| * TODO: This needs to be made read-only and a sepearate internal camera variable should be used to handle | ||
thkruz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * the logic when shift is pressed | ||
| */ | ||
| cameraMovementSpeedMin = 0.005; | ||
|
|
||
| // Auto Camera Movement | ||
| /** | ||
| * Adjust to change camera speed of auto pan around earth | ||
| */ | ||
| autoPanSpeed = 1; | ||
| /** | ||
| * Adjust to change camera speed of auto rotate around earth | ||
| */ | ||
| autoRotateSpeed = 0.000075; | ||
| isAutoRotateL = true; | ||
| isAutoRotateR = false; | ||
| isAutoRotateU = false; | ||
| isAutoRotateD = false; | ||
| isAutoPanL = false; | ||
| isAutoPanR = false; | ||
| isAutoPanU = false; | ||
| isAutoPanD = false; | ||
|
|
||
| // Zoom Settings | ||
| /** | ||
| * The speed at which the zoom level changes when the user zooms in or out. | ||
| */ | ||
| zoomSpeed = 0.005; | ||
| /** | ||
| * The maximum zoom distance from the Earth's surface in kilometers. | ||
| * | ||
| * Used for zooming in and out in default and offset camera modes. | ||
| */ | ||
| maxZoomDistance = <Kilometers>1.2e6; // 1.2 million km | ||
| /** | ||
| * The minimum zoom distance from 0,0,0 in kilometers. | ||
| * | ||
| * Used for zooming in and out in default and offset camera modes. | ||
| */ | ||
| minZoomDistance = <Kilometers>(RADIUS_OF_EARTH + 50); | ||
| /** | ||
| * Distance from satellite when we switch to close camera mode. | ||
| * This is used to slow down the dolly effect when zooming in on a satellite. | ||
| */ | ||
| nearZoomLevel = 25 as Kilometers; | ||
| /** | ||
| * Minimum distance from satellite when we switch to close camera mode | ||
| * The camera will not be able to get closer than this distance | ||
| */ | ||
| minDistanceFromSatellite = 0.75 as Kilometers; | ||
| /** | ||
| * Determines whether zooming stops auto rotation in the application. | ||
| */ | ||
| isZoomStopsRotation = true; | ||
| /** | ||
| * Changing the zoom with the mouse wheel will stop the camera from following the satellite. | ||
| */ | ||
| isZoomStopsSnappedOnSat = false; | ||
| isAutoZoomIn = false; | ||
| isAutoZoomOut = false; | ||
| autoZoomSpeed = 0.00002; | ||
| /** | ||
| * The initial zoom level for the camera. | ||
| * 0 = earth and 1 = max distance from earth | ||
| */ | ||
| initZoomLevel: number; | ||
|
|
||
| // Camera Controls | ||
| /** | ||
| * Currently only disables panning. | ||
| * | ||
| * TODO: Disable all camera movement | ||
| */ | ||
| disableCameraControls = false; | ||
| /** | ||
| * Global flag for determining if the user is dragging the globe | ||
| */ | ||
| isDragging = false; | ||
|
|
||
| // Camera Focus | ||
| /** Center on a satellite when it is selected. */ | ||
| isFocusOnSatelliteWhenSelected = true; | ||
|
|
||
| // Offset Camera Mode | ||
| /** | ||
| * The offset in the x direction for the offset camera mode. | ||
| */ | ||
| offsetCameraModeX = 15000; | ||
| /** | ||
| * The offset in the z direction for the offset camera mode. | ||
| */ | ||
| offsetCameraModeZ = -6000; | ||
|
|
||
| // FPS Mode Settings | ||
| /** | ||
| * Speed at which the camera moves in the Z direction when in FPS mode. | ||
| */ | ||
| fpsForwardSpeed = 3; | ||
| /** | ||
| * Speed the camera pitches up and down when in FPS mode. | ||
| */ | ||
| fpsPitchRate = 0.02; | ||
| /** | ||
| * Speed at which the camera rotates when in FPS mode. | ||
| */ | ||
| fpsRotateRate = 0.02; | ||
| /** | ||
| * Speed at which the camera moves in the X direction when in FPS mode. | ||
| */ | ||
| fpsSideSpeed = 3; | ||
| /** | ||
| * Speed at which the camera moves in the Y direction when in FPS mode. | ||
| */ | ||
| fpsVertSpeed = 3; | ||
| /** | ||
| * Speed at which the camera twists (yaws) when in FPS mode. | ||
| */ | ||
| fpsYawRate = 0.02; | ||
|
|
||
| /** Enables the camera widget */ | ||
| drawCameraWidget = false; | ||
| } | ||
|
|
||
| export const defaultCameraSettings = new CameraSettings(); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.