alot of effects fixes

This commit is contained in:
osiu97
2026-07-08 21:30:46 +02:00
parent a28dd7543d
commit 3a4b3ec2d6
2 changed files with 10 additions and 5 deletions
+8 -4
View File
@@ -58,10 +58,14 @@ export const MotionEffects = {
},
// Called to determine blending behaviour during queue checks
getQueueAction(mode, maxDist, blendThreshold) {
if (mode === 'jumpy') {
getQueueAction(targetMode, nextTargetMode, maxDist, blendThreshold) {
if (nextTargetMode === 'overshoot_settle') {
// Must physically reach the overshoot point before popping the settle command
if (maxDist <= 10) return { action: 'blend' };
return { action: 'continue' };
} else if (targetMode === 'jumpy') {
if (maxDist <= 5) return { action: 'wait', delay: 100 };
} else if (mode === 'hesitant') {
} else if (targetMode === 'hesitant') {
// Lower blend threshold prevents blasting all speed-change waypoints instantly
if (maxDist <= 30) return { action: 'blend' };
} else {
@@ -95,7 +99,7 @@ export const MotionEffects = {
} else if (mode === 'erratic') {
count = Math.max(count, Math.ceil(distance / 20)); // fewer, larger jumps
} else if (mode === 'hesitant') {
count = Math.max(count, Math.ceil(distance / 15)); // ensure we get middle waypoints for speed changes
count = Math.max(count, Math.ceil(distance / 15)); // ensure enough waypoints for speed changes
}
return Math.max(1, count);
},
+2 -1
View File
@@ -95,7 +95,8 @@ async function executeQueue() {
const maxDist = Math.max(dist1, dist2);
if (motionQueue.length > 0) {
const queueAction = MotionEffects.getQueueAction(target.mode, maxDist, CONFIG.BLEND_THRESHOLD_STEPS);
const nextTarget = motionQueue[0];
const queueAction = MotionEffects.getQueueAction(target.mode, nextTarget.mode, maxDist, CONFIG.BLEND_THRESHOLD_STEPS);
if (queueAction.action === 'wait') {
clearInterval(queueCheckInterval);
setTimeout(executeQueue, queueAction.delay);