mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
wip
This commit is contained in:
BIN
packages/frontend/assets/room/objects/a4-case/a4-case.blend
Normal file
BIN
packages/frontend/assets/room/objects/a4-case/a4-case.blend
Normal file
Binary file not shown.
BIN
packages/frontend/assets/room/objects/a4-case/a4-case.glb
Normal file
BIN
packages/frontend/assets/room/objects/a4-case/a4-case.glb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 20 KiB |
@@ -311,6 +311,7 @@ export class RoomEngine {
|
||||
this.shadowGenerator1.forceBackFacesOnly = true;
|
||||
this.shadowGenerator1.bias = 0.0001;
|
||||
this.shadowGenerator1.usePercentageCloserFiltering = true;
|
||||
this.shadowGenerator1.filteringQuality = BABYLON.ShadowGenerator.QUALITY_HIGH;
|
||||
//this.shadowGenerator1.useContactHardeningShadow = true;
|
||||
|
||||
const sunLight = new BABYLON.DirectionalLight('sunLight', new BABYLON.Vector3(0.2, -1, -1), this.scene);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { a4Case } from './objects/a4Case.js';
|
||||
import { aircon } from './objects/aircon.js';
|
||||
import { aquarium } from './objects/aquarium.js';
|
||||
import { banknote } from './objects/banknote.js';
|
||||
@@ -45,6 +46,7 @@ import { wallShelf } from './objects/wallShelf.js';
|
||||
import { woodSoundAbsorbingPanel } from './objects/woodSoundAbsorbingPanel.js';
|
||||
|
||||
export const OBJECT_DEFS = [
|
||||
a4Case,
|
||||
aircon,
|
||||
aquarium,
|
||||
banknote,
|
||||
|
||||
42
packages/frontend/src/utility/room/objects/a4Case.ts
Normal file
42
packages/frontend/src/utility/room/objects/a4Case.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
|
||||
export const a4Case = defineObject({
|
||||
id: 'a4Case',
|
||||
name: 'A4 Case',
|
||||
options: {
|
||||
schema: {
|
||||
color: {
|
||||
type: 'color',
|
||||
label: 'Color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
color: [0.9, 0.9, 0.9],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
createInstance: ({ options, root }) => {
|
||||
const bodyMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh;
|
||||
const bodyMaterial = bodyMesh.material as BABYLON.PBRMaterial;
|
||||
|
||||
const applyColor = () => {
|
||||
const [r, g, b] = options.color;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user