1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-22 19:54:03 +02:00
This commit is contained in:
syuilo
2026-04-08 22:21:42 +09:00
parent 9d9b47daca
commit 9b3424c5d3
4 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/*
* 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 radiometer = defineObject({
id: 'radiometer',
name: 'radiometer',
options: {
schema: {},
default: {},
},
placement: 'top',
createInstance: ({ scene, model }) => {
const vanes = model.findTransformNode('__X_VANES__');
model.bakeExcludeMeshes = [...vanes.getChildMeshes()];
return {
onInited: () => {
vanes.rotation = vanes.rotationQuaternion != null ? vanes.rotationQuaternion.toEulerAngles() : vanes.rotation;
const anim = new BABYLON.Animation('', 'rotation.y', 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
anim.setKeys([
{ frame: 0, value: 0 },
{ frame: 240, value: Math.PI * 2 },
]);
vanes.animations = [anim];
scene.beginAnimation(vanes, 0, 240, true);
},
interactions: {},
};
},
});