a-maze-ing

This commit is contained in:
2025-10-27 08:42:23 +02:00
parent 7221733b47
commit 7afefec63f
5 changed files with 47 additions and 13 deletions
+8 -6
View File
@@ -82,7 +82,7 @@ export class CharacterControls {
this.directionVelocity = this.directionVelocity * 2.5 * Math.abs(input[0])
this.direction += input[0] * delta * 2.5 //this.directionVelocity;
this.model.rotation.y = this.direction;
this.walkDirection.set(input[0], 0, input[1])
this.walkDirection.set(input[0]*0.33, 0, input[1])
this.walkDirection.applyAxisAngle(this.rotateAngle, this.direction)
this.walkDirection.normalize();
@@ -127,11 +127,13 @@ export class CharacterControls {
cameraPosition.lerp(cameraDesiredPosition, delta*2)
this.camera.position.copy(cameraPosition)
this.camera.lookAt(new THREE.Vector3(
this.model.position.x,
2,
this.model.position.z
))
// this.camera.lookAt(new THREE.Vector3(
// this.model.position.x,
// 2,
// this.model.position.z
// ))
this.orbitControl.target.set(this.model.position.x, 2, this.model.position.z)
this.camera.lookAt(this.orbitControl.target)
}
getInput(pointerControls) {