优化碰撞识别,加入暖场帧数
This commit is contained in:
1 parent
b8652acce0
commit
fed1015849
21 files changed
+195
-23
No files matched your search
@@ -86,6 +86,24 @@
|
||||
<NumSlider :label="$t('scene.rotation')" :min="-360" :max="360" :step="1" v-model="sys.config.rootRotation" />
|
||||
<NumSlider :label="$t('scene.scaleX')" :min="0.05" :max="10" :step="0.05" v-model="sys.config.rootScaleX" />
|
||||
<NumSlider :label="$t('scene.scaleY')" :min="0.05" :max="10" :step="0.05" v-model="sys.config.rootScaleY" />
|
||||
<div class="seed-row scene-warmup">
|
||||
<label for="system-warmup">{{ $t('scene.warmupFrames') }}</label>
|
||||
<div class="scene-number-unit" :class="{ disabled: warmupDisabled }">
|
||||
<input
|
||||
id="system-warmup"
|
||||
class="seed-input"
|
||||
type="number"
|
||||
min="0"
|
||||
step="1"
|
||||
:disabled="warmupDisabled"
|
||||
:value="warmupFramesText"
|
||||
@input="warmupFramesText = ($event.target as HTMLInputElement).value"
|
||||
@change="commitWarmupFrames"
|
||||
@blur="commitWarmupFrames"
|
||||
/>
|
||||
<span>f</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="seed-row scene-seed">
|
||||
<label for="system-seed">{{ $t('scene.seed') }}</label>
|
||||
<input id="system-seed" class="seed-input" type="number" min="0" step="1" v-model.number="sys.config.seed" :title="$t('scene.seedTitle')" />
|
||||
@@ -184,18 +202,37 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import NumSlider from '../NumSlider.vue'
|
||||
import CurveEditor from '../CurveEditor.vue'
|
||||
import ParticleAttributeControl from '../ParticleAttributeControl.vue'
|
||||
import ColorGradientEditor from '../ColorGradientEditor.vue'
|
||||
import ImageResourceCard from '../ImageResourceCard.vue'
|
||||
import SpineObjectPanel from '../../spine/SpineObjectPanel.vue'
|
||||
import { collectSubEmitterIds } from '../../core/subEmitterIds'
|
||||
import { useParticlePanelContext } from './particlePanelContext'
|
||||
const { store, resolvedCurveEditorMode, sys, activeObjectType, activeCollider, activePath, activeSpine, canCopyObject, collapsed, toggle, sectionOpen, addSys, addCollider, addPath, addSpine, copySelectedObject, applyPathPreset, clearPathAnchors, randomizeSeed, LINEAR_CURVE } = useParticlePanelContext()
|
||||
|
||||
type DisplaySystem = { system: (typeof store.systems)[number]; depth: number }
|
||||
|
||||
const warmupDisabled = computed(() => !!sys.value && (
|
||||
collectSubEmitterIds(store.systems).has(sys.value.id)
|
||||
|| (sys.value.config.mode === 'stream' && sys.value.config.streamBehavior === 'loop')
|
||||
))
|
||||
const warmupFramesText = ref('0')
|
||||
watch(
|
||||
() => [sys.value?.id, sys.value?.config.warmupFrames] as const,
|
||||
() => { warmupFramesText.value = String(sys.value?.config.warmupFrames ?? 0) },
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
function commitWarmupFrames() {
|
||||
if (!sys.value || warmupDisabled.value) return
|
||||
const frames = Math.max(0, Math.floor(Number(warmupFramesText.value) || 0))
|
||||
warmupFramesText.value = String(frames)
|
||||
sys.value.config.warmupFrames = frames
|
||||
}
|
||||
|
||||
/** 子发射器嵌在父系统下方显示,方便直接选中;移除引用后自动回到普通行。 */
|
||||
const displaySystems = computed<DisplaySystem[]>(() => {
|
||||
const byId = new Map(store.systems.map((system) => [system.id, system]))
|
||||
@@ -314,5 +351,11 @@ const displaySystems = computed<DisplaySystem[]>(() => {
|
||||
.seed-random { width: 34px; height: 30px; border: 1px solid #3a4860; border-radius: 6px; background: #2c3950; color: #d7def0; cursor: pointer; }
|
||||
.seed-random:hover { background: #394964; }
|
||||
.scene-seed { margin-top: 10px; }
|
||||
.scene-warmup { margin-top: 10px; }
|
||||
.scene-number-unit { min-width: 0; flex: 1; display: flex; align-items: center; border: 1px solid #344158; border-radius: 6px; background: #0f1625; }
|
||||
.scene-number-unit:focus-within { border-color: #625ff1; }
|
||||
.scene-number-unit .seed-input { border: 0; background: transparent; }
|
||||
.scene-number-unit > span { padding-right: 8px; color: #7e8aa3; font-size: 12px; }
|
||||
.scene-number-unit.disabled { opacity: .5; }
|
||||
.seed-hint { margin: 5px 0 1px 72px; color: #657188; font-size: 9px; line-height: 1.45; }
|
||||
</style>
|
||||
Reference in new issue
Block a user