Files
blitzkit/packages/website/src/hooks/useSkinAnimation.ts
T

15 lines
400 B
TypeScript
Raw Normal View History

2026-10-20 18:41:01 +13:00
import { invalidate, useFrame } from "@react-three/fiber";
2026-11-30 22:42:12 -06:00
import { sceneChangeEvent } from "../core/three/sceneChange";
2026-10-20 18:41:01 +13:00
import type { Skin } from "./useSkin";
export function useSkinAnimation(skins: Skin[]) {
useFrame((_, delta) => {
for (const { mixer } of skins) {
if (!mixer) continue;
2026-10-20 18:41:01 +13:00
mixer.update(delta);
2026-10-20 18:41:01 +13:00
invalidate();
2026-11-30 22:42:12 -06:00
sceneChangeEvent.dispatch();
2026-10-20 18:41:01 +13:00
}
});
}