mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-26 06:44:15 +02:00
wip
This commit is contained in:
Binary file not shown.
BIN
packages/frontend/assets/room/objects/radiometer/radiometer.glb
Normal file
BIN
packages/frontend/assets/room/objects/radiometer/radiometer.glb
Normal file
Binary file not shown.
@@ -51,6 +51,7 @@ import { plant } from './objects/plant.js';
|
|||||||
import { plant2 } from './objects/plant2.js';
|
import { plant2 } from './objects/plant2.js';
|
||||||
import { poster } from './objects/poster.js';
|
import { poster } from './objects/poster.js';
|
||||||
import { powerStrip } from './objects/powerStrip.js';
|
import { powerStrip } from './objects/powerStrip.js';
|
||||||
|
import { radiometer } from './objects/radiometer.js';
|
||||||
import { rolledUpPoster } from './objects/rolledUpPoster.js';
|
import { rolledUpPoster } from './objects/rolledUpPoster.js';
|
||||||
import { roundRug } from './objects/roundRug.js';
|
import { roundRug } from './objects/roundRug.js';
|
||||||
import { router } from './objects/router.js';
|
import { router } from './objects/router.js';
|
||||||
@@ -118,6 +119,7 @@ export const OBJECT_DEFS = [
|
|||||||
plant2,
|
plant2,
|
||||||
poster,
|
poster,
|
||||||
powerStrip,
|
powerStrip,
|
||||||
|
radiometer,
|
||||||
rolledUpPoster,
|
rolledUpPoster,
|
||||||
roundRug,
|
roundRug,
|
||||||
router,
|
router,
|
||||||
|
|||||||
35
packages/frontend/src/utility/room/objects/radiometer.ts
Normal file
35
packages/frontend/src/utility/room/objects/radiometer.ts
Normal 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: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user