View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vídeos

Abrir menu Fechar menu
  • Coleções
  • Todos os vídeos
  • Sobre

Mais vídeos

  • Sobre
  • Código
  • What's new in RealityKit

    RealityKit is Apple's rendering, animation, physics, and audio engine built from the ground up for augmented reality: It reimagines the traditional 3D renderer to make it easy for developers to prototype and produce high-quality AR experiences. Learn how to effectively implement each of the latest improvements to RealityKit in your app. Discover features like video textures, scene understanding using the LiDAR scanner on iPad Pro, Location Anchors, face tracking, and improved debugging tools.

    To get the most out of this session, you should understand the building blocks of developing RealityKit-based apps and games. Watch “Introducing RealityKit and Reality Composer” for a primer.

    For more on how you can integrate Reality Composer into your augmented reality workflow, watch "The artist's AR toolkit".

    Recursos

    • Creating a game with scene understanding
    • RealityKit
      • Vídeo HD
      • Vídeo SD

    Vídeos relacionados

    WWDC21

    • Dive into RealityKit 2
    • Explore advanced rendering with RealityKit 2

    WWDC20

    • Explore ARKit 4
    • The artist’s AR toolkit

    WWDC19

    • Introducing RealityKit and Reality Composer
  • Buscar neste vídeo...
    • 4:52 - Loading a video material

      // Use AVFoundation to load a video
      let asset = AVURLAsset(url: Bundle.main.url(forResource: "glow", withExtension: "mp4")!)
      let playerItem = AVPlayerItem(asset: asset)
      
      // Create a Material and assign it to your model entity...
      let player = AVPlayer()
      bugEntity.materials = [VideoMaterial(player: player)]
      
      // Tell the player to load and play
      player.replaceCurrentItem(with: playerItem)
      player.play()
    • 13:58 - Implementing object avoidance with scene understanding

      // Get the position and forward direction of the bug in world space
      let bugOrigin = bug.position(relativeTo: nil)
      let bugForward = bug.convert(direction: [0, 0, 1], relativeTo: nil)
      
      // Perform a raycast 
      let collisionResults = arView.scene.raycast(origin: bugOrigin, direction: bugForward)
      
      // Get all hits against a Scene Understanding Entity
      let filteredResults = collisionResults.filter { $0.entity as? HasSceneUnderstanding }
      
      // Pick the closest one and get the collision point
      guard let closestCollisionPoint = filteredResults.first?.position else {
      	return
      }
      
      if length(bugOrigin - closestCollisionPoint) < safeDistance {
        // Avoid obstacle too close to object’s forward
      }
    • 14:48 - Using collision events with a scene understanding entity

      // Subscribe to all collision events
      arView.scene.subscribe(to: CollisionEvents.Began.self) { event in
          // Get any entity if it conforms to HasSceneUnderstanding
          guard let sceneUnderstandingEntity = (event.entityA as? HasSceneUnderstanding) 
                                            ?? (event.entityB as? HasSceneUnderstanding)   
          else { 
             // Did not collide with real world    
             return 
          } 
          // The bug entity is the one that is not the scene understanding entity
          let bugEntity = (sceneUnderstandingEntity == event.entityA)
                         ? event.entityB : event.entityA 
      
         // Disintegrate the bug entity
         …
      }
    • 16:00 - Real world collision filtering

      // Only collide with real world
      entity.collision?.filter.mask = [.sceneUnderstanding]
      
      // Never collide with real world
      entity.collision?.filter.mask = CollisionGroup.all.subtracting(.sceneUnderstanding)

Developer Footer

  • Vídeos
  • WWDC20
  • What's new in RealityKit
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines