Reject nonexistent native projection IDs and verify real split selection assignment
This commit is contained in:
@@ -23,7 +23,9 @@ function Step([string]$Name,[string[]]$Arguments=@(),[int]$Delay=500) {
|
||||
function Save([string]$Name) { Adb @('pull',$remote,(Join-Path $EvidenceDir "$Name.json")) | Out-Null; return Get-Content -LiteralPath (Join-Path $EvidenceDir "$Name.json") -Raw | ConvertFrom-Json }
|
||||
function Same($First,$Second) { return ($First | ConvertTo-Json -Depth 12 -Compress) -eq ($Second | ConvertTo-Json -Depth 12 -Compress) }
|
||||
function BallPoint($Board,[string]$Id) {
|
||||
$ball=@($Board.balls | Where-Object id -eq $Id)[0]; $camera=$Board.camera
|
||||
$matching=@($Board.balls | Where-Object id -eq $Id)
|
||||
if ($matching.Count -ne 1) { throw "Native projection requires exactly one existing ball ID: $Id" }
|
||||
$ball=$matching[0]; $camera=$Board.camera
|
||||
$rotation=[Numerics.Quaternion]::new($camera.rotation.x,$camera.rotation.y,$camera.rotation.z,$camera.rotation.w)
|
||||
$origin=[Numerics.Vector3]::new($camera.target.x,($camera.target.y+.65),$camera.target.z)+[Numerics.Vector3]::Transform([Numerics.Vector3]::new(0,0,-$camera.distance),$rotation)
|
||||
$local=[Numerics.Vector3]::Transform([Numerics.Vector3]::new($ball.position.x,$ball.position.y,$ball.position.z)-$origin,[Numerics.Quaternion]::Inverse($rotation))
|
||||
@@ -128,4 +130,3 @@ function CompareAudio([string]$Name,[string[]]$Ids) {
|
||||
Check "pcm-$Name-$id" ($exit -eq 0 -and $match.passed -and $match.normalizedCorrelation -ge .95 -and $match.rmsPcm -gt 32) ($match | ConvertTo-Json -Compress)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user