Add tank catalog with USDZ models and tank selection
Introduce TankDefinition/TankCatalog loaded from Tanks.json, bundle the Drachengas USDZ tank models, add tank selection and preview views, and update the AR experience, editor and project views to use the catalog. Includes tests for catalog loading and model selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -91,11 +91,24 @@ enum SafetyZoneFactory {
|
||||
let bounds = text.visualBounds(relativeTo: nil)
|
||||
text.position = -bounds.center
|
||||
|
||||
let radialDirection = SIMD3(sin(angle), 0, cos(angle))
|
||||
let tangentDirection = SIMD3(cos(angle), 0, -sin(angle))
|
||||
let holder = Entity()
|
||||
holder.addChild(text)
|
||||
holder.position = SIMD3(sin(angle) * zone.radius, 0.01, cos(angle) * zone.radius)
|
||||
holder.orientation = simd_quatf(angle: angle, axis: SIMD3(0, 1, 0))
|
||||
* simd_quatf(angle: -.pi / 2, axis: SIMD3(1, 0, 0))
|
||||
|
||||
// Wie bei der Längenbeschriftung: in die Bodenebene drehen und tangential
|
||||
// zum Kreis ausrichten. Der Text steht radial außerhalb des Rings.
|
||||
let textClearance: Float = 0.015
|
||||
let radialOffset = bounds.extents.y / 2 + textClearance
|
||||
holder.position = radialDirection * (zone.radius + radialOffset)
|
||||
holder.position.y = 0.01
|
||||
holder.orientation = simd_quatf(
|
||||
from: SIMD3(1, 0, 0),
|
||||
to: tangentDirection
|
||||
) * simd_quatf(
|
||||
angle: -.pi / 2,
|
||||
axis: tangentDirection
|
||||
)
|
||||
return holder
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user