1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-13 14:05:35 +02:00
This commit is contained in:
syuilo
2026-04-19 17:11:59 +09:00
parent c0690c9b80
commit a211d0df51
3 changed files with 10 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../object.js';
import { cm } from '../../utility.js';
import { cm, remap } from '../../utility.js';
import { createOverridedStates } from '../utility.js';
export const blind = defineObject({
@@ -74,6 +74,15 @@ export const blind = defineObject({
blades.push(b);
}
const length = Math.abs(blades.at(-1).position.y * Math.abs(scale.y));
for (const mesh of model.root.getChildMeshes()) {
if (mesh.morphTargetManager != null && mesh.morphTargetManager.getTargetByName('Length') != null) {
mesh.morphTargetManager.getTargetByName('Length').influence = remap(length, cm(10), cm(200), 0, 1);
}
}
model.updated();
model.updated();
};