mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-05 18:44:09 +02:00
wip
This commit is contained in:
@@ -501,7 +501,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public isSitting = false;
|
public isSitting = false;
|
||||||
private fps: number | null = 30;
|
private fps: number | null = null;
|
||||||
private disposed = false;
|
private disposed = false;
|
||||||
|
|
||||||
public domEvents: EventEmitter<{
|
public domEvents: EventEmitter<{
|
||||||
@@ -564,7 +564,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
|
|
||||||
this.camera = new BABYLON.UniversalCamera('camera', new BABYLON.Vector3(0, cm(130), cm(0)), this.scene);
|
this.camera = new BABYLON.UniversalCamera('camera', new BABYLON.Vector3(0, cm(130), cm(0)), this.scene);
|
||||||
this.camera.inputs.removeByType('FreeCameraKeyboardMoveInput');
|
this.camera.inputs.removeByType('FreeCameraKeyboardMoveInput');
|
||||||
this.camera.inputs.add(new HorizontalCameraKeyboardMoveInput(this.camera, this.fps));
|
this.camera.inputs.add(new HorizontalCameraKeyboardMoveInput(this.camera));
|
||||||
this.camera.attachControl(this.canvas);
|
this.camera.attachControl(this.canvas);
|
||||||
this.camera.minZ = cm(1);
|
this.camera.minZ = cm(1);
|
||||||
this.camera.maxZ = cm(2000);
|
this.camera.maxZ = cm(2000);
|
||||||
|
|||||||
@@ -54,14 +54,12 @@ export class HorizontalCameraKeyboardMoveInput extends BABYLON.BaseCameraPointer
|
|||||||
onCanvasBlurObserver = null;
|
onCanvasBlurObserver = null;
|
||||||
onKeyboardObserver = null;
|
onKeyboardObserver = null;
|
||||||
public canMove = true;
|
public canMove = true;
|
||||||
private fps: number;
|
|
||||||
|
|
||||||
constructor(camera: BABYLON.UniversalCamera, fps = 60) {
|
constructor(camera: BABYLON.UniversalCamera) {
|
||||||
super();
|
super();
|
||||||
this.camera = camera;
|
this.camera = camera;
|
||||||
this.scene = this.camera.getScene();
|
this.scene = this.camera.getScene();
|
||||||
this.engine = this.scene.getEngine();
|
this.engine = this.scene.getEngine();
|
||||||
this.fps = fps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attachControl() {
|
attachControl() {
|
||||||
@@ -136,7 +134,7 @@ export class HorizontalCameraKeyboardMoveInput extends BABYLON.BaseCameraPointer
|
|||||||
dir.y = 0;
|
dir.y = 0;
|
||||||
dir.normalize();
|
dir.normalize();
|
||||||
const rate = this.preShift ? 3 : 1;
|
const rate = this.preShift ? 3 : 1;
|
||||||
const moveSpeed = 6 / this.fps;
|
const moveSpeed = 0.1 * this.scene.getAnimationRatio();
|
||||||
const move = dir.scale(moveSpeed * rate);
|
const move = dir.scale(moveSpeed * rate);
|
||||||
|
|
||||||
if (this.canMove) {
|
if (this.canMove) {
|
||||||
|
|||||||
Reference in New Issue
Block a user