渲染顺序功能

This commit is contained in:
tianmo committed 2026-10-22 11:16:50 +08:00
1 parent aabf4ff693
commit c041503004
22 files changed
+1904 -1291

No files matched your search

+5 -3
View File
@@ -189,7 +189,7 @@ useEditorShortcuts({
function syncEmitters() {
if (!world) return
emitterSync.sync(store, world, dotTex, trailTex)
emitterSync.sync(store, world, dotTex, trailTex, spineRuntime)
}
/**
@@ -243,13 +243,15 @@ function loop() {
background.applyTransform(store.settings.backgroundX, store.settings.backgroundY, store.settings.backgroundOpacity)
drawAxis(store, app, axisGfx, axisLabelLayer, axisLabels)
syncEmitters()
// 根节点(root)变换:位置(centerX/centerY)=位移,rotation/scale 绕 root 中心,与场景对象参数联动
const followFps = Math.max(1, store.timeline.fps)
const followFrame = store.timeline.frame
const followTime = followFrame / followFps
// 发射器读取骨骼变换前,先把 Spine 运行时同步到同一时间轴帧。
// 发射器读取骨骼变换、插槽 drawOrder 之前,先把 Spine 运行时同步到同一时间轴帧。
spineRuntime?.sync(store.spines, followFrame, followFps)
syncEmitters()
// 同步完成后计算插槽层级补偿,抵消插槽骨骼变换,保持粒子系统原有世界坐标表现。
emitterSync.updateRenderCompensation(store, spineRuntime)
previewColliders = buildPreviewColliders(store, followTime)
for (const sys of store.systems) {
const em = emitterSync.emitters.get(sys.id)