1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-20 10:35:40 +02:00

Update engine.ts

This commit is contained in:
syuilo
2026-02-14 21:48:01 +09:00
parent 1dec481a7e
commit 52a1b30503

View File

@@ -46,10 +46,10 @@ type ObjectDef = {
receiveShadows?: boolean; receiveShadows?: boolean;
castShadows?: boolean; castShadows?: boolean;
isChair?: boolean; isChair?: boolean;
onInit?: (room: RoomEngine, o: RoomDef['objects'][0], rootNode: BABYLON.TransformNode) => void; onInit?: (room: RoomEngine, o: RoomDef['objects'][0], rootNode: BABYLON.Mesh) => void;
}; };
function yuge(room: RoomEngine, mesh: BABYLON.TransformNode, offset: BABYLON.Vector3) { function yuge(room: RoomEngine, mesh: BABYLON.Mesh, offset: BABYLON.Vector3) {
const emitter = new BABYLON.TransformNode('emitter', room.scene); const emitter = new BABYLON.TransformNode('emitter', room.scene);
emitter.parent = mesh; emitter.parent = mesh;
emitter.position = offset; emitter.position = offset;
@@ -432,10 +432,10 @@ export class RoomEngine {
private birdeyeCamera: BABYLON.ArcRotateCamera; private birdeyeCamera: BABYLON.ArcRotateCamera;
private intervalIds: number[] = []; private intervalIds: number[] = [];
private timeoutIds: number[] = []; private timeoutIds: number[] = [];
private objectMeshs: Map<string, BABYLON.TransformNode> = new Map(); private objectMeshs: Map<string, BABYLON.Mesh> = new Map();
private grabbing: { private grabbing: {
objectId: string; objectId: string;
mesh: BABYLON.TransformNode; mesh: BABYLON.Mesh;
startOffset: BABYLON.Vector3; startOffset: BABYLON.Vector3;
startRotationY: number; startRotationY: number;
distance: number; distance: number;
@@ -1149,7 +1149,7 @@ export class RoomEngine {
public toggleGrab() { public toggleGrab() {
if (this.grabbing != null) { if (this.grabbing != null) {
// 親から先に外していく // 親から先に外していく
const removeStickyParentRecursively = (mesh: BABYLON.TransformNode) => { const removeStickyParentRecursively = (mesh: BABYLON.Mesh) => {
const stickyObjectIds = Array.from(this.def.objects.filter(o => o.sticky === mesh.metadata.objectId)).map(o => o.id); const stickyObjectIds = Array.from(this.def.objects.filter(o => o.sticky === mesh.metadata.objectId)).map(o => o.id);
for (const soid of stickyObjectIds) { for (const soid of stickyObjectIds) {
const soMesh = this.objectMeshs.get(soid)!; const soMesh = this.objectMeshs.get(soid)!;