-
Descubre las mejoras en el seguimiento de objetos de visionOS
Descubre cómo visionOS está mejorando el seguimiento de objetos y la entrada de accesorios espaciales. Descubre nuevas formas de rastrear objetos en movimiento y dispositivos portátiles, lo que te permitirá tender un puente entre el mundo físico y el digital. Obtén información sobre las nuevas categorías de accesorios espaciales compatibles y lo que necesitas para crear tus propios accesorios personalizados, con el fin de habilitar modelos de interacción únicos en tus apps.
Capítulos
- 0:00 - Introducción
- 2:20 - Seguimiento de objetos
- 7:20 - Accesorios espaciales
- 7:47 - Cómo crear un accesorio espacial
- 11:48 - Accesorios plug-and-play
- 12:22 - Implementación en tu app
- 13:03 - Próximos pasos
Recursos
- Implementing object tracking in your app
- Working with generic spatial accessories
- Preparing spatial accessories for tracking in your visionOS app
- Spatial accessory design guidelines for Apple devices (check section 20)
- Exploring object tracking with ARKit
Videos relacionados
WWDC25
WWDC24
-
Buscar este video…
-
-
3:50 - Enable high frame rate tracking
// Enable high frame rate tracking // Create reference object configuration var configuration = ReferenceObject.Configuration() configuration.highFrameRateTrackingEnabled = true // Load the reference object with ARKit API let refObjURL = Bundle.main.url(forResource: "flashlight", withExtension: ".referenceobject") let refObject = try? await ReferenceObject(from: refObjURL!, configuration: configuration) -
4:50 - Extended training mode via command-line
// Extended training mode on Mac using command-line interface % xrun createml objecttracker --source flashlight.usdz --output flashlight.referenceobject --training-mode extended --all-angles -
5:25 - Object pose coordinate spaces
// Different object pose spaces // Obtain anchor transform with display corrections let renderingPose = myObjectAnchor.coordinateSpace(correction: .rendered) // Obtain anchor transform in metric space let metricPose = myObjectAnchor.coordinateSpace(correction: .none) -
6:22 - Implement object tracking in iOS
// Implement object tracking in iOS import ARKit import RealityKit class ObjectTrackingARSessionDelegate: NSObject, ARSessionDelegate { let arView = ARView(frame: .zero) var entities: [UUID: AnchorEntity] = [:] func start() throws { let stationaryObject = try ARReferenceObject(archiveURL: Bundle.main.url(forResource: "stationary", withExtension: "referenceobject")!) let movingObject = try ARReferenceObject(archiveURL: Bundle.main.url(forResource: "moving", withExtension: "referenceobject")!) let configuration = ARWorldTrackingConfiguration() configuration.detectionObjects = [stationaryObject] // Low frame rate configuration.trackingObjects = [movingObject] // High frame rate arView.session.delegate = self arView.session.run(configuration) } func session(_ session: ARSession, didAdd anchors: [ARAnchor]) { for case let anchor as ARObjectAnchor in anchors { let entity = AnchorEntity(anchor: anchor) entities[anchor.identifier] = entity arView.scene.addAnchor(entity) } } func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) { for case let anchor as ARObjectAnchor in anchors { entities[anchor.identifier]?.isEnabled = anchor.isTracked } } func session(_ session: ARSession, didRemove anchors: [ARAnchor]) { for case let anchor as ARObjectAnchor in anchors { if let entity = entities.removeValue(forKey: anchor.identifier) { arView.scene.removeAnchor(entity) } } } } -
12:26 - Discover and connect a spatial accessory
import ARKit import GameController // Generic accessory discovery if let device = GCSpatialAccessory.spatialAccessories.first { // Resolves the .referenceaccessory bundle automatically let accessory = try await Accessory(device: device) let provider = AccessoryTrackingProvider(accessories: [accessory]) try await arkitSession.run([provider]) } // Update tracked accessories without restarting the session try await provider.updateAccessories([newAccessory])
-