aligning
This commit is contained in:
@@ -101,9 +101,11 @@ export class CharacterControls {
|
||||
this.model.position.z + 5* Math.cos(angleYCameraDirection + directionOffset)
|
||||
)
|
||||
|
||||
cameraPosition.lerp(cameraDesiredPosition, delta*3)
|
||||
cameraPosition.lerp(cameraDesiredPosition, delta*2)
|
||||
|
||||
if (Math.abs(cameraPosition.x - this.model.position.x) + Math.abs(cameraPosition.z - this.model.position.z) > 2){
|
||||
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){
|
||||
this.camera.position.copy(cameraPosition)
|
||||
this.camera.lookAt(new THREE.Vector3(
|
||||
this.model.position.x,
|
||||
@@ -111,6 +113,8 @@ export class CharacterControls {
|
||||
this.model.position.z
|
||||
))
|
||||
}
|
||||
//this.camera.zoom = dst
|
||||
//this.camera.updateProjectionMatrix();
|
||||
|
||||
// run/walk velocity
|
||||
velocity = this.currentAction == 'run' ? this.runVelocity : this.walkVelocity
|
||||
|
||||
Reference in New Issue
Block a user