mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-16 06:15:30 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
Binary file not shown.
@@ -716,7 +716,7 @@ export class MuseumEnvManager extends EnvManager<MuseumEnvOptions> {
|
||||
this.shadowGenerators.push(shadowGeneratorForRoomLight);
|
||||
}
|
||||
|
||||
for (const node of this.loaderResult.transformNodes.filter(node => node.name.includes('__LIGHT__'))) {
|
||||
for (const node of this.meshes.filter(mesh => mesh.name.includes('__LIGHT__'))) {
|
||||
const light = new BABYLON.SpotLight('museumEnv:SubRoomLight', node.position, new BABYLON.Vector3(0, -1, 0), 16, 8, this.engine.scene, true);
|
||||
light.diffuse = new BABYLON.Color3(...this.engine.roomState.roomLightColor);
|
||||
light.range = cm(500);
|
||||
|
||||
@@ -25,6 +25,7 @@ import { cuboid } from './objects/cuboid.js';
|
||||
import { cupNoodle } from './objects/cupNoodle.js';
|
||||
import { custardPudding } from './objects/custardPudding.js';
|
||||
import { debugHipoly } from './objects/debugHipoly.js';
|
||||
import { descriptionPlate } from './objects/descriptionPlate.js';
|
||||
import { desk } from './objects/desk.js';
|
||||
import { desktopPc } from './objects/desktopPc.js';
|
||||
import { djMixer } from './objects/djMixer.js';
|
||||
@@ -48,6 +49,7 @@ import { laptopPc } from './objects/laptopPc.js';
|
||||
import { largeMousepad } from './objects/largeMousepad.js';
|
||||
import { lavaLamp } from './objects/lavaLamp.js';
|
||||
import { letterCase } from './objects/letterCase.js';
|
||||
import { lowPartitionBar } from './objects/lowPartitionBar.js';
|
||||
import { miObjet } from './objects/mi-objet.js';
|
||||
import { milk } from './objects/milk.js';
|
||||
import { miPlate } from './objects/miPlate.js';
|
||||
@@ -209,6 +211,8 @@ export const OBJECT_DEFS = [
|
||||
woodSoundAbsorbingPanel,
|
||||
hangingDuctRail,
|
||||
spotLight,
|
||||
lowPartitionBar,
|
||||
descriptionPlate,
|
||||
];
|
||||
|
||||
export function getObjectDef(type: string): typeof OBJECT_DEFS[number] {
|
||||
|
||||
23
packages/frontend/src/world/room/objects/descriptionPlate.ts
Normal file
23
packages/frontend/src/world/room/objects/descriptionPlate.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineObject } from '../object.js';
|
||||
|
||||
export const descriptionPlate = defineObject({
|
||||
id: 'descriptionPlate',
|
||||
name: 'descriptionPlate',
|
||||
options: {
|
||||
schema: {},
|
||||
default: {},
|
||||
},
|
||||
placement: 'side',
|
||||
hasCollisions: false,
|
||||
hasTexture: true,
|
||||
createInstance: () => {
|
||||
return {
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
64
packages/frontend/src/world/room/objects/lowPartitionBar.ts
Normal file
64
packages/frontend/src/world/room/objects/lowPartitionBar.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../object.js';
|
||||
|
||||
export const lowPartitionBar = defineObject({
|
||||
id: 'lowPartitionBar',
|
||||
name: 'lowPartitionBar',
|
||||
options: {
|
||||
schema: {
|
||||
bodyColor: {
|
||||
type: 'color',
|
||||
label: 'Body color',
|
||||
},
|
||||
width: {
|
||||
type: 'range',
|
||||
label: 'Width',
|
||||
min: 0,
|
||||
max: 1,
|
||||
step: 0.01,
|
||||
},
|
||||
},
|
||||
default: {
|
||||
bodyColor: [0.8, 0.8, 0.8],
|
||||
width: 0.5,
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
//hasCollisions: true,
|
||||
createInstance: ({ options, model }) => {
|
||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||
|
||||
const applyBodyColor = () => {
|
||||
const [r, g, b] = options.bodyColor;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyBodyColor();
|
||||
|
||||
const applySize = () => {
|
||||
for (const mesh of model.root.getChildMeshes()) {
|
||||
if (mesh.morphTargetManager != null && mesh.morphTargetManager.getTargetByName('W') != null) {
|
||||
mesh.morphTargetManager.getTargetByName('W').influence = options.width;
|
||||
}
|
||||
}
|
||||
model.updated();
|
||||
};
|
||||
|
||||
applySize();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
switch (k) {
|
||||
case 'bodyColor': applyBodyColor(); break;
|
||||
case 'width': applySize(); break;
|
||||
}
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user