1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-19 14:45:38 +02:00
This commit is contained in:
syuilo
2026-04-24 10:16:13 +09:00
parent 1de4440dbd
commit 7c170a21e5
9 changed files with 186 additions and 84 deletions

View File

@@ -33,11 +33,8 @@ export const randomBooks = defineObject({
label: 'Stack vertically',
},
seed: {
type: 'range',
type: 'seed',
label: 'Seed',
min: 0,
max: 1000,
step: 1,
},
},
default: {
@@ -51,7 +48,7 @@ export const randomBooks = defineObject({
hasCollisions: false,
hasTexture: true,
canPreMeshesMerging: false,
createInstance: ({ options, model, scene, id }) => {
createInstance: ({ options, model, scene }) => {
const bodyMesh = model.findMesh('__X_BODY__');
const tex = new BABYLON.Texture('/client-assets/room/objects/random-books/texture.png', scene, {
invertY: false,
@@ -69,7 +66,7 @@ export const randomBooks = defineObject({
}
bookMeshes = [];
const rng = seedrandom(options.seed === 0 ? id : options.seed.toString());
const rng = seedrandom(options.seed.toString());
const randomRange = (min: number, max: number) => rng() * (max - min) + min;
let accumulatedPos = 0;