mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-24 03:24:18 +02:00
wip
This commit is contained in:
@@ -46,7 +46,19 @@ export const desktopPc = defineObject({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
createInstance: ({ options, model }) => {
|
createInstance: ({ options, model, root, scene, room }) => {
|
||||||
|
const light1 = new BABYLON.SpotLight('', new BABYLON.Vector3(0, 10/*cm*/, 22/*cm*/), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||||
|
light1.parent = root;
|
||||||
|
light1.intensity = 500;
|
||||||
|
light1.range = 30/*cm*/;
|
||||||
|
if (room?.lightContainer != null) room.lightContainer.addLight(light1);
|
||||||
|
|
||||||
|
const light2 = new BABYLON.SpotLight('', new BABYLON.Vector3(-5/*cm*/, 33/*cm*/, -9/*cm*/), new BABYLON.Vector3(1, 0, 0), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||||
|
light2.parent = root;
|
||||||
|
light2.intensity = 500;
|
||||||
|
light2.range = 30/*cm*/;
|
||||||
|
if (room?.lightContainer != null) room.lightContainer.addLight(light2);
|
||||||
|
|
||||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||||
const coverMaterial = model.findMaterial('__X_COVER__');
|
const coverMaterial = model.findMaterial('__X_COVER__');
|
||||||
const inner1Material = model.findMaterial('__X_INNER__');
|
const inner1Material = model.findMaterial('__X_INNER__');
|
||||||
@@ -94,6 +106,8 @@ export const desktopPc = defineObject({
|
|||||||
const applyLedColor = () => {
|
const applyLedColor = () => {
|
||||||
const [r, g, b] = options.ledColor;
|
const [r, g, b] = options.ledColor;
|
||||||
ledMaterial.emissiveColor = new BABYLON.Color3(r, g, b);
|
ledMaterial.emissiveColor = new BABYLON.Color3(r, g, b);
|
||||||
|
light1.diffuse = new BABYLON.Color3(r, g, b);
|
||||||
|
light2.diffuse = new BABYLON.Color3(r, g, b);
|
||||||
};
|
};
|
||||||
|
|
||||||
applyLedColor();
|
applyLedColor();
|
||||||
|
|||||||
@@ -33,7 +33,13 @@ export const tabletopDigitalClock = defineObject({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
createInstance: ({ room, options, model }) => {
|
createInstance: ({ root, room, options, model, scene }) => {
|
||||||
|
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0, 3/*cm*/, 1/*cm*/), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||||
|
light.parent = root;
|
||||||
|
light.intensity = 100;
|
||||||
|
light.range = 30/*cm*/;
|
||||||
|
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||||
|
|
||||||
const segmentMeshes = {
|
const segmentMeshes = {
|
||||||
'1a': model.findMesh('__TIME_7SEG_1A__'),
|
'1a': model.findMesh('__TIME_7SEG_1A__'),
|
||||||
'1b': model.findMesh('__TIME_7SEG_1B__'),
|
'1b': model.findMesh('__TIME_7SEG_1B__'),
|
||||||
@@ -85,6 +91,7 @@ export const tabletopDigitalClock = defineObject({
|
|||||||
const mat = segmentMeshes['1a'].material as BABYLON.PBRMaterial;
|
const mat = segmentMeshes['1a'].material as BABYLON.PBRMaterial;
|
||||||
const [r, g, b] = options.lcdColor;
|
const [r, g, b] = options.lcdColor;
|
||||||
mat.emissiveColor = new BABYLON.Color3(r, g, b);
|
mat.emissiveColor = new BABYLON.Color3(r, g, b);
|
||||||
|
light.diffuse = new BABYLON.Color3(r, g, b);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user