mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-04 00:44:22 +02:00
Update engine.ts
This commit is contained in:
@@ -738,6 +738,9 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
this.zGridPreviewPlane.isVisible = false;
|
this.zGridPreviewPlane.isVisible = false;
|
||||||
|
|
||||||
this.selectionOutlineLayer = new BABYLON.SelectionOutlineLayer('outliner', this.scene);
|
this.selectionOutlineLayer = new BABYLON.SelectionOutlineLayer('outliner', this.scene);
|
||||||
|
if (SNAPSHOT_RENDERING) {
|
||||||
|
this.sr.updateMeshesForEffectLayer(this.selectionOutlineLayer);
|
||||||
|
}
|
||||||
|
|
||||||
if (_DEV_) {
|
if (_DEV_) {
|
||||||
// snapshot renderingかつglow layerが有効だとなんかクラッシュする
|
// snapshot renderingかつglow layerが有効だとなんかクラッシュする
|
||||||
@@ -877,7 +880,12 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
easing.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEOUT);
|
easing.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEOUT);
|
||||||
animTarget.setEasingFunction(easing);
|
animTarget.setEasingFunction(easing);
|
||||||
this.camera.animations.push(animTarget);
|
this.camera.animations.push(animTarget);
|
||||||
this.scene.beginAnimation(this.camera, 0, 30, false);
|
this.scene.beginAnimation(this.camera, 0, 30, false, undefined, () => {
|
||||||
|
if (SNAPSHOT_RENDERING) { // 視点が動くとアウトラインが薄くなるのでリセット
|
||||||
|
this.sr.disableSnapshotRendering();
|
||||||
|
this.sr.enableSnapshotRendering();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -885,6 +893,8 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public selectObject(objectId: string | null) {
|
public selectObject(objectId: string | null) {
|
||||||
|
if (SNAPSHOT_RENDERING) this.sr.disableSnapshotRendering(); // snapshot rendering中にbake/unbakeするとエラーになる。なおこのメソッドは参照カウント方式な点に留意
|
||||||
|
|
||||||
const currentSelected = this.selected;
|
const currentSelected = this.selected;
|
||||||
if (currentSelected != null) {
|
if (currentSelected != null) {
|
||||||
this.selected = null;
|
this.selected = null;
|
||||||
@@ -906,6 +916,8 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SNAPSHOT_RENDERING) this.sr.enableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleGrabbing() {
|
private handleGrabbing() {
|
||||||
@@ -1453,14 +1465,18 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private highlightMeshes(meshes: BABYLON.AbstractMesh[]) {
|
private highlightMeshes(meshes: BABYLON.AbstractMesh[]) {
|
||||||
if (this.engine.snapshotRendering) return; // snapshot rendering内でそのままやろうとするとエラーになる 回避実装もめんどいので単に無視
|
//if (this.engine.snapshotRendering) return; // snapshot rendering内でそのままやろうとするとエラーになる 回避実装もめんどいので単に無視
|
||||||
|
if (SNAPSHOT_RENDERING) this.sr.disableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||||
this.clearHighlight();
|
this.clearHighlight();
|
||||||
this.selectionOutlineLayer.addSelection(meshes);
|
this.selectionOutlineLayer.addSelection(meshes);
|
||||||
|
if (SNAPSHOT_RENDERING) this.sr.enableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||||
}
|
}
|
||||||
|
|
||||||
private clearHighlight() {
|
private clearHighlight() {
|
||||||
if (this.engine.snapshotRendering) return; // snapshot rendering内でそのままやろうとするとエラーになる 回避実装もめんどいので単に無視
|
//if (this.engine.snapshotRendering) return; // snapshot rendering内でそのままやろうとするとエラーになる 回避実装もめんどいので単に無視
|
||||||
|
if (SNAPSHOT_RENDERING) this.sr.disableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||||
this.selectionOutlineLayer.clearSelection();
|
this.selectionOutlineLayer.clearSelection();
|
||||||
|
if (SNAPSHOT_RENDERING) this.sr.enableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||||
}
|
}
|
||||||
|
|
||||||
public beginSelectedInstalledObjectGrabbing() {
|
public beginSelectedInstalledObjectGrabbing() {
|
||||||
@@ -1824,8 +1840,8 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async exitEditMode() {
|
public async exitEditMode() {
|
||||||
this.isEditMode = false;
|
|
||||||
this.selectObject(null);
|
this.selectObject(null);
|
||||||
|
this.isEditMode = false;
|
||||||
|
|
||||||
await this.bake();
|
await this.bake();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user