mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 16:25:44 +02:00
wip
This commit is contained in:
@@ -25,6 +25,10 @@ const canvas = useTemplateRef('canvas');
|
||||
|
||||
let engine: RoomEngine;
|
||||
|
||||
function resize() {
|
||||
if (engine != null) engine.resize();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
engine = new RoomEngine({
|
||||
roomType: 'default',
|
||||
@@ -184,10 +188,14 @@ onMounted(() => {
|
||||
engine.init();
|
||||
|
||||
canvas.value!.focus();
|
||||
|
||||
window.addEventListener('resize', resize);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
engine.destroy();
|
||||
|
||||
window.removeEventListener('resize', resize);
|
||||
});
|
||||
|
||||
function onKeydown(ev: KeyboardEvent) {
|
||||
|
||||
@@ -286,8 +286,7 @@ const OBJECTS = {
|
||||
castShadows: false,
|
||||
onInit: (room, o, obj) => {
|
||||
const rotor = obj.meshes[0].getChildMeshes().find(m => m.name === 'Rotor') as BABYLON.Mesh;
|
||||
rotor.rotationQuaternion = null;
|
||||
console.log(obj.meshes, obj.meshes[0].getChildMeshes().map(x => x.name), rotor, rotor.getChildMeshes());
|
||||
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 },
|
||||
@@ -1049,6 +1048,10 @@ export class RoomEngine {
|
||||
}
|
||||
}
|
||||
|
||||
public resize() {
|
||||
this.engine.resize();
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
for (const id of this.intervalIds) {
|
||||
window.clearInterval(id);
|
||||
|
||||
Reference in New Issue
Block a user