1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 06:25:52 +02:00
This commit is contained in:
syuilo
2026-04-03 13:45:43 +09:00
parent e8d8242c09
commit f367bc37f8
4 changed files with 45 additions and 45 deletions

View File

@@ -25,16 +25,16 @@ export const cardboardBox = defineObject({
createInstance: ({ scene, options, root }) => { createInstance: ({ scene, options, root }) => {
return { return {
onInited: () => { onInited: () => {
const boxMesh = root.getChildMeshes().find(m => m.name === 'Box') as BABYLON.Mesh; //const boxMesh = root.getChildMeshes().find(m => m.name === 'Box') as BABYLON.Mesh;
if (options.variation === 'mikan') { //if (options.variation === 'mikan') {
const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/mikan.png', scene, false, false); // const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/mikan.png', scene, false, false);
(boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex; // (boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex;
(boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1); // (boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1);
} else if (options.variation === 'aizon') { //} else if (options.variation === 'aizon') {
const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/aizon.png', scene, false, false); // const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/aizon.png', scene, false, false);
(boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex; // (boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex;
(boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1); // (boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1);
} //}
}, },
interactions: {}, interactions: {},
}; };

View File

@@ -16,10 +16,10 @@ export const ceilingFanLight = defineObject({
placement: 'ceiling', placement: 'ceiling',
receiveShadows: false, receiveShadows: false,
castShadows: false, castShadows: false,
createInstance: ({ scene, root }) => { createInstance: ({ scene, model }) => {
return { return {
onInited: () => { onInited: () => {
const rotor = root.getChildMeshes().find(m => m.name === 'Rotor') as BABYLON.Mesh; const rotor = model.findMesh('Rotor');
rotor.rotation = rotor.rotationQuaternion != null ? rotor.rotationQuaternion.toEulerAngles() : rotor.rotation; rotor.rotation = rotor.rotationQuaternion != null ? rotor.rotationQuaternion.toEulerAngles() : rotor.rotation;
const anim = new BABYLON.Animation('', 'rotation.y', 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); const anim = new BABYLON.Animation('', 'rotation.y', 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
anim.setKeys([ anim.setKeys([

View File

@@ -33,41 +33,41 @@ export const tabletopDigitalClock = defineObject({
}, },
}, },
placement: 'top', placement: 'top',
createInstance: ({ room, options, root }) => { createInstance: ({ room, options, model }) => {
const segmentMeshes = { const segmentMeshes = {
'1a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1A__')), '1a': model.findMesh('__TIME_7SEG_1A__'),
'1b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1B__')), '1b': model.findMesh('__TIME_7SEG_1B__'),
'1c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1C__')), '1c': model.findMesh('__TIME_7SEG_1C__'),
'1d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1D__')), '1d': model.findMesh('__TIME_7SEG_1D__'),
'1e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1E__')), '1e': model.findMesh('__TIME_7SEG_1E__'),
'1f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1F__')), '1f': model.findMesh('__TIME_7SEG_1F__'),
'1g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1G__')), '1g': model.findMesh('__TIME_7SEG_1G__'),
'2a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2A__')), '2a': model.findMesh('__TIME_7SEG_2A__'),
'2b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2B__')), '2b': model.findMesh('__TIME_7SEG_2B__'),
'2c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2C__')), '2c': model.findMesh('__TIME_7SEG_2C__'),
'2d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2D__')), '2d': model.findMesh('__TIME_7SEG_2D__'),
'2e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2E__')), '2e': model.findMesh('__TIME_7SEG_2E__'),
'2f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2F__')), '2f': model.findMesh('__TIME_7SEG_2F__'),
'2g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2G__')), '2g': model.findMesh('__TIME_7SEG_2G__'),
'3a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3A__')), '3a': model.findMesh('__TIME_7SEG_3A__'),
'3b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3B__')), '3b': model.findMesh('__TIME_7SEG_3B__'),
'3c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3C__')), '3c': model.findMesh('__TIME_7SEG_3C__'),
'3d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3D__')), '3d': model.findMesh('__TIME_7SEG_3D__'),
'3e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3E__')), '3e': model.findMesh('__TIME_7SEG_3E__'),
'3f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3F__')), '3f': model.findMesh('__TIME_7SEG_3F__'),
'3g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3G__')), '3g': model.findMesh('__TIME_7SEG_3G__'),
'4a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4A__')), '4a': model.findMesh('__TIME_7SEG_4A__'),
'4b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4B__')), '4b': model.findMesh('__TIME_7SEG_4B__'),
'4c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4C__')), '4c': model.findMesh('__TIME_7SEG_4C__'),
'4d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4D__')), '4d': model.findMesh('__TIME_7SEG_4D__'),
'4e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4E__')), '4e': model.findMesh('__TIME_7SEG_4E__'),
'4f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4F__')), '4f': model.findMesh('__TIME_7SEG_4F__'),
'4g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4G__')), '4g': model.findMesh('__TIME_7SEG_4G__'),
}; };
const colonMeshes = root.getChildMeshes().filter(m => m.name.includes('__TIME_7SEG_COLON__')); const colonMeshes = model.findMeshes('__TIME_7SEG_COLON__');
const bodyMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh; const bodyMesh = model.findMesh('__X_BODY__');
const bodyMaterial = bodyMesh.material as BABYLON.PBRMaterial; const bodyMaterial = bodyMesh.material as BABYLON.PBRMaterial;
const applyBodyColor = () => { const applyBodyColor = () => {

View File

@@ -15,8 +15,8 @@ export const tv = defineObject({
default: {}, default: {},
}, },
placement: 'top', placement: 'top',
createInstance: ({ room, root }) => { createInstance: ({ room, model }) => {
const screenMesh = root.getChildMeshes().find(m => m.name.includes('__TV_SCREEN__')) as BABYLON.Mesh; const screenMesh = model.findMesh('__TV_SCREEN__');
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true); screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
initTv(room, screenMesh); initTv(room, screenMesh);