1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-21 11:05:37 +02:00
This commit is contained in:
syuilo
2026-03-05 11:54:25 +09:00
parent 354504b534
commit bdc34305be
12 changed files with 44 additions and 2 deletions

View File

@@ -48,8 +48,35 @@ type RoomStateObject<Options = any> = {
sticky?: string | null;
};
type SimpleHeyaWallBase = {
material: null | 'wood' | 'concrete';
color: [number, number, number];
};
type Heya = {
type: 'simple';
options: {
size: [number, number];
window: 'none' | 'kosidakamado' | 'demado' | 'hakidasimado';
wallN: SimpleHeyaWallBase;
wallE: SimpleHeyaWallBase;
wallS: SimpleHeyaWallBase;
wallW: SimpleHeyaWallBase;
flooring: {
material: null | 'wood' | 'concrete';
color: [number, number, number];
};
ceiling: {
material: null | 'wood' | 'concrete';
color: [number, number, number];
};
};
} | {
type: 'japanese';
};
type RoomState = {
roomType: 'default';
heya: Heya;
installedObjects: RoomStateObject<any>[];
};
@@ -865,7 +892,6 @@ export class RoomEngine {
// シェイプキー(morph)を考慮してbounding boxを更新するために必要
mesh.refreshBoundingInfo({ applyMorph: true });
//mesh.showBoundingBox = _DEV_;
mesh.metadata = metadata;
mesh.checkCollisions = !hasCollisionMesh;
@@ -1289,6 +1315,14 @@ export class RoomEngine {
}
}
public showBoundingBox() {
for (const mesh of this.objectMeshs.values()) {
for (const m of mesh.getChildMeshes()) {
m.showBoundingBox = true;
}
}
}
public resize() {
this.engine.resize();
}

View File

@@ -125,6 +125,7 @@ export const pictureFrame = defineObject({
matMesh.morphTargetManager!.getTargetByName('MatV')!.influence = options.matVThickness * options.height;
pictureMesh.morphTargetManager!.getTargetByName('Width')!.influence = options.width * (1 - options.matHThickness);
pictureMesh.morphTargetManager!.getTargetByName('Height')!.influence = options.height * (1 - options.matVThickness);
matMesh.isVisible = options.matHThickness > 0 || options.matVThickness > 0;
meshUpdated();
applyFit();

View File

@@ -130,6 +130,7 @@ export const tabletopPictureFrame = defineObject({
pictureMesh.morphTargetManager!.getTargetByName('Height')!.influence = options.height * (1 - options.matVThickness);
pictureMesh.morphTargetManager!.getTargetByName('MatH')!.influence = options.matHThickness * options.width;
pictureMesh.morphTargetManager!.getTargetByName('MatV')!.influence = options.matVThickness * options.height;
matMesh.isVisible = options.matHThickness > 0 || options.matVThickness > 0;
meshUpdated();
applyFit();