Use double scalars for bounded native depth steering

This commit is contained in:
NINI
2026-10-10 08:44:52 +09:00
parent db340b41ed
commit 24f0347404
2 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ function ApproachDepth([string]$Name,$Source){
$sourcePoint=@($friends|Sort-Object {[Math]::Pow($_.x-$pointer[0],2)+[Math]::Pow($_.y-$pointer[1],2)})[0]
$targetPoint=@($friends|Where-Object {$_-ne$sourcePoint})[0]
$dx=$targetPoint.x-$sourcePoint.x;$dy=$targetPoint.y-$sourcePoint.y;$length=[Math]::Sqrt($dx*$dx+$dy*$dy)
if($length-lt2){break};$scale=[Math]::Min(1,12/$length)
if($length-lt2){break};$scale=[Math]::Min(1.0,12.0/$length)
$next=@([int][Math]::Round($pointer[0]+$dx*$scale),[int][Math]::Round($pointer[1]+$dy*$scale))
if(!(WorldSafe $next)){throw 'Live depth approach leaves UI-safe input region'}
$pointer=$next;NativeTouch @($pointer[0],$pointer[1],73,1024)