1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-27 16:34:10 +02:00
This commit is contained in:
syuilo
2026-04-17 17:53:11 +09:00
parent 02c6e1b876
commit 623b4f087f
12 changed files with 302 additions and 316 deletions

View File

@@ -50,12 +50,14 @@ export class HorizontalCameraKeyboardMoveInput extends BABYLON.BaseCameraPointer
onCanvasBlurObserver = null;
onKeyboardObserver = null;
public canMove = true;
private moveSpeed = 0.1;
constructor(camera: BABYLON.UniversalCamera) {
constructor(camera: BABYLON.UniversalCamera, moveSpeed = 0.1) {
super();
this.camera = camera;
this.scene = this.camera.getScene();
this.engine = this.scene.getEngine();
this.moveSpeed = moveSpeed;
}
attachControl() {
@@ -129,9 +131,9 @@ export class HorizontalCameraKeyboardMoveInput extends BABYLON.BaseCameraPointer
const dir = this.camera.getDirection(local.normalize());
dir.y = 0;
dir.normalize();
const rate = this.preShift ? 3 : 1;
const moveSpeed = 0.1 * this.scene.getAnimationRatio();
const move = dir.scale(moveSpeed * rate);
const dashFactor = this.preShift ? 3 : 1;
const moveSpeed = this.moveSpeed * this.scene.getAnimationRatio();
const move = dir.scale(moveSpeed * dashFactor);
if (this.canMove) {
this.camera.cameraDirection.addInPlace(move);