From 6d34067fc8bace3adec43eb90d44f89b3579ab5f Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Tue, 26 Aug 2025 02:49:35 +0200 Subject: [PATCH] Update camera configuration and FPV controls: adjusted camera position, target, and distance values for improved viewing experience; modified jump speed, gravity, crouch height, and crouch speed in FPV controls for enhanced movement dynamics; refined eye height calculation in model loader for better alignment with model dimensions. --- camera-config.json | 20 ++++++++++---------- src/fpv-controls.js | 8 ++++---- src/model-loader.js | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/camera-config.json b/camera-config.json index c126b03..3362dce 100644 --- a/camera-config.json +++ b/camera-config.json @@ -1,20 +1,20 @@ { "camera": { "position": { - "x": 514, - "y": 228, - "z": -403 + "x": 248.7, + "y": 93.5, + "z": 139.16 }, "target": { - "x": 50, - "y": 85, - "z": -140 + "x": 156.1, + "y": 63.43, + "z": -186.15 }, - "distance": 552, + "distance": 339.56, "spherical": { - "radius": 552, - "theta": 2.09, - "phi": 1.31 + "radius": 339.56, + "theta": 0.28, + "phi": 1.48 } }, "description": "Default camera configuration for 3D model viewer. Position values can be copied from console logs and pasted here to set new defaults." diff --git a/src/fpv-controls.js b/src/fpv-controls.js index 4e60f22..b83f713 100644 --- a/src/fpv-controls.js +++ b/src/fpv-controls.js @@ -305,10 +305,10 @@ export function updateFPVMovement(camera) { const delta = 0.016; // Approximate 60fps const moveSpeed = 100.0; // Units per second - const jumpSpeed = 220.0; // Jump initial velocity - const gravity = 420.0; // Gravity strength - const crouchHeight = window.eyeHeight * 0.5; // Crouch height - const crouchSpeed = 100.0; // Speed of crouching transition + const jumpSpeed = 500.0; // Jump initial velocity + const gravity = 2000.0; // Gravity strength + const crouchHeight = window.eyeHeight * 0.3; // Crouch height + const crouchSpeed = 300.0; // Speed of crouching transition const flySpeed = 80.0; // Vertical fly speed // Reset direction diff --git a/src/model-loader.js b/src/model-loader.js index 79fc864..6ad9e18 100644 --- a/src/model-loader.js +++ b/src/model-loader.js @@ -234,7 +234,7 @@ function centerModelAndControls(object, camera, controls) { window.modelBounds = { boundingBox, center, size }; window.groundLevel = boundingBox.min.y; window.ceilingLevel = boundingBox.max.y; - window.eyeHeight = window.groundLevel + (window.ceilingLevel - window.groundLevel) * 0.5; + window.eyeHeight = window.groundLevel + (window.ceilingLevel - window.groundLevel) * 0.55; console.log('FPV bounds calculated:'); console.log('Ground level:', window.groundLevel);