Use double scalars for bounded native depth steering
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user