Added option to override maximum height constraint, closes #135, closes #114

This commit is contained in:
Lucas Dower 2023-09-04 01:41:18 +01:00
parent a827e427db
commit e2f601fbfd
No known key found for this signature in database
GPG Key ID: B3EE6B8499593605
4 changed files with 15 additions and 3 deletions

View File

@ -15,6 +15,7 @@ export const en_GB = {
heading: 'SETTINGS',
components: {
language: 'Language',
overrideHeight: 'Max height override',
},
changing_language: 'Changing languages...',
changed_language: 'Changed language',

View File

@ -51,7 +51,7 @@ export class ArcballCamera {
this._target = new SmoothVectorVariable(new Vector3(0, 0, 0), AppConfig.Get.CAMERA_SMOOTHING);
this._elevation.setClamp(0.001, Math.PI - 0.001);
this._distance.setClamp(1.0, 100.0);
this._distance.setClamp(AppConfig.Get.CAMERA_MINIMUM_DISTANCE, 100.0);
}
public init() {

View File

@ -25,13 +25,14 @@ export class AppConfig {
public readonly RENDER_TRIANGLE_THRESHOLD = 1_000_000;
public readonly MAXIMUM_IMAGE_MEM_ALLOC = 2048;
public readonly CAMERA_FOV_DEGREES = 30.0;
public readonly CAMERA_MINIMUM_DISTANCE = 0.125;
public readonly CAMERA_DEFAULT_DISTANCE_UNITS = 4.0;
public readonly CAMERA_DEFAULT_AZIMUTH_RADIANS = -1.0;
public readonly CAMERA_DEFAULT_ELEVATION_RADIANS = 1.3;
public readonly CAMERA_SENSITIVITY_ROTATION = 0.005;
public readonly CAMERA_SENSITIVITY_ZOOM = 0.0025;
public readonly CONSTRAINT_MINIMUM_HEIGHT = 3;
public readonly CONSTRAINT_MAXIMUM_HEIGHT = 380;
public CONSTRAINT_MAXIMUM_HEIGHT = 380;
public readonly SMOOTHNESS_MAX = 3.0;
public readonly CAMERA_SMOOTHING = 1.0;
public readonly VIEWPORT_BACKGROUND_COLOUR: RGBA = {

View File

@ -90,8 +90,18 @@ export class UI {
label: LOC('settings.heading'),
components: {
'language': new ComboboxComponent<string>(), // Handled in constructor
'overrideHeight': new SliderComponent()
.setMin(16)
.setMax(10000)
.setDefaultValue(380)
.setDecimals(0)
.setStep(1)
.setLabel('settings.components.overrideHeight')
.addValueChangedListener((newValue) => {
AppConfig.Get.CONSTRAINT_MAXIMUM_HEIGHT = newValue;
})
},
componentOrder: ['language'],
componentOrder: ['language', 'overrideHeight'],
},
'import': {
id: 'import',