amaze
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user