This commit is contained in:
2025-10-21 18:50:52 +03:00
parent 3ff60a1cf4
commit 8f817eee14
13 changed files with 157 additions and 100 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ export class CharacterControls {
let dst = Math.sqrt(Math.pow(cameraPosition.x - this.model.position.x, 2) + Math.pow(cameraPosition.z - this.model.position.z, 2));
//cameraPosition.y = 8 - dst;
if (dst > 2){
if (dst >0.52){
this.camera.position.copy(cameraPosition)
this.camera.lookAt(new THREE.Vector3(
this.model.position.x,
@@ -24,7 +24,7 @@ class GameEngine {
this.opts = opts;
const gameEngine = this;
this.perspectiveCamera = new THREE.PerspectiveCamera(45, this.aspect, 0.01, 25);
this.perspectiveCamera = new THREE.PerspectiveCamera(45, this.aspect, 0.01, 250);
this.raycaster = new THREE.Raycaster();
this.perspectiveCamera.position.set(0, 0, 10);
+5
View File
@@ -54,4 +54,9 @@ export default {
rad2deg(rad){
return rad * 180 / Math.PI;
},
shuffleArray(arr){
return arr.map(value => ({ value, sort: Math.random() }))
.sort((a, b) => a.sort - b.sort).map(({ value }) => value)
}
}