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.
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
{
|
{
|
||||||
"camera": {
|
"camera": {
|
||||||
"position": {
|
"position": {
|
||||||
"x": 514,
|
"x": 248.7,
|
||||||
"y": 228,
|
"y": 93.5,
|
||||||
"z": -403
|
"z": 139.16
|
||||||
},
|
},
|
||||||
"target": {
|
"target": {
|
||||||
"x": 50,
|
"x": 156.1,
|
||||||
"y": 85,
|
"y": 63.43,
|
||||||
"z": -140
|
"z": -186.15
|
||||||
},
|
},
|
||||||
"distance": 552,
|
"distance": 339.56,
|
||||||
"spherical": {
|
"spherical": {
|
||||||
"radius": 552,
|
"radius": 339.56,
|
||||||
"theta": 2.09,
|
"theta": 0.28,
|
||||||
"phi": 1.31
|
"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."
|
"description": "Default camera configuration for 3D model viewer. Position values can be copied from console logs and pasted here to set new defaults."
|
||||||
|
|||||||
@@ -305,10 +305,10 @@ export function updateFPVMovement(camera) {
|
|||||||
|
|
||||||
const delta = 0.016; // Approximate 60fps
|
const delta = 0.016; // Approximate 60fps
|
||||||
const moveSpeed = 100.0; // Units per second
|
const moveSpeed = 100.0; // Units per second
|
||||||
const jumpSpeed = 220.0; // Jump initial velocity
|
const jumpSpeed = 500.0; // Jump initial velocity
|
||||||
const gravity = 420.0; // Gravity strength
|
const gravity = 2000.0; // Gravity strength
|
||||||
const crouchHeight = window.eyeHeight * 0.5; // Crouch height
|
const crouchHeight = window.eyeHeight * 0.3; // Crouch height
|
||||||
const crouchSpeed = 100.0; // Speed of crouching transition
|
const crouchSpeed = 300.0; // Speed of crouching transition
|
||||||
const flySpeed = 80.0; // Vertical fly speed
|
const flySpeed = 80.0; // Vertical fly speed
|
||||||
|
|
||||||
// Reset direction
|
// Reset direction
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ function centerModelAndControls(object, camera, controls) {
|
|||||||
window.modelBounds = { boundingBox, center, size };
|
window.modelBounds = { boundingBox, center, size };
|
||||||
window.groundLevel = boundingBox.min.y;
|
window.groundLevel = boundingBox.min.y;
|
||||||
window.ceilingLevel = boundingBox.max.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('FPV bounds calculated:');
|
||||||
console.log('Ground level:', window.groundLevel);
|
console.log('Ground level:', window.groundLevel);
|
||||||
|
|||||||
Reference in New Issue
Block a user