mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-21 00:35:25 +02:00
wip
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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 ceilingFanLight = defineObject({
|
||||
id: 'ceilingFanLight',
|
||||
defaultOptions: {},
|
||||
placement: 'ceiling',
|
||||
createInstance: ({ room, o, root }) => {
|
||||
return {
|
||||
onInited: () => {
|
||||
const rotor = root.getChildMeshes().find(m => m.name === 'Rotor') as BABYLON.Mesh;
|
||||
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);
|
||||
anim.setKeys([
|
||||
{ frame: 0, value: 0 },
|
||||
{ frame: 100, value: Math.PI * 2 },
|
||||
]);
|
||||
rotor.animations = [anim];
|
||||
room.scene.beginAnimation(rotor, 0, 100, true);
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user