[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E6KZRCW6VTY6V2SE0V5JM4":3,"skill-same:01M6E6KZRCW6VTY6V2SE0V5JM4":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6E6KZRCW6VTY6V2SE0V5JM4","axiom-realitykit-ref",null,"RealityKit API reference — Entity, Component, System, RealityView, Model3D, anchor types, material system, physics, collision, animation, audio, accessibility","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FCharlesWiltgen\u002FAxiom\u002Faxiom-realitykit-ref\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"axiom realitykit ref","macos","accessibility","component","ios","api","Animation","Audio","system","reference","physics","anchor","material","2026-11-10 10:12:30",false,"---\nname: axiom-realitykit-ref\ndescription: RealityKit API reference — Entity, Component, System, RealityView, Model3D, anchor types, material system, physics, collision, animation, audio, accessibility\nlicense: MIT\ncompatibility: [iOS 13+, macOS 10.15+, visionOS 1.0+, tvOS 26+]\nmetadata:\n  version: \"1.0.0\"\n---\n\n# RealityKit API Reference\n\nComplete API reference for RealityKit organized by category.\n\n## When to Use This Reference\n\nUse this reference when:\n- Looking up specific RealityKit API signatures or properties\n- Checking which component types are available\n- Finding the right anchor type for an AR experience\n- Browsing material properties and options\n- Setting up physics body parameters\n- Looking up animation or audio API details\n- Checking platform availability for specific APIs\n\n---\n\n## Part 1: Entity API\n\n### Entity\n\n```swift\n\u002F\u002F Creation\nlet entity = Entity()\nlet entity = Entity(components: [TransformComponent(), ModelComponent(...)])\n\n\u002F\u002F Async loading\nlet entity = try await Entity(named: \"scene\", in: .main)\nlet entity = try await Entity(contentsOf: url)\n\n\u002F\u002F Clone\nlet clone = entity.clone(recursive: true)\n```\n\n### Entity Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `name` | `String` | Identifier for lookup |\n| `id` | `ObjectIdentifier` | Unique identity |\n| `isEnabled` | `Bool` | Local enabled state |\n| `isEnabledInHierarchy` | `Bool` | Effective enabled (considers parents) |\n| `isActive` | `Bool` | Entity is in an active scene |\n| `isAnchored` | `Bool` | Has anchoring or anchored ancestor |\n| `scene` | `RealityKit.Scene?` | Owning scene |\n| `parent` | `Entity?` | Parent entity |\n| `children` | `Entity.ChildCollection` | Child entities |\n| `components` | `Entity.ComponentSet` | All attached components |\n| `anchor` | `HasAnchoring?` | Nearest anchoring ancestor |\n\n### Entity Hierarchy Methods\n\n```swift\nentity.addChild(child)\nentity.addChild(child, preservingWorldTransform: true)\nentity.removeChild(child)\nentity.removeFromParent()\nentity.findEntity(named: \"name\")  \u002F\u002F Recursive search\n```\n\n### Entity Subclasses\n\n| Class | Purpose | Key Component |\n|-------|---------|---------------|\n| `Entity` | Base container | Transform only |\n| `ModelEntity` | Renderable object | ModelComponent |\n| `AnchorEntity` | AR anchor point | AnchoringComponent |\n| `PerspectiveCamera` | Virtual camera | PerspectiveCameraComponent |\n| `DirectionalLight` | Sun\u002Fdirectional | DirectionalLightComponent |\n| `PointLight` | Point light | PointLightComponent |\n| `SpotLight` | Spot light | SpotLightComponent |\n| `TriggerVolume` | Invisible collision zone | CollisionComponent |\n| `ViewAttachmentEntity` | SwiftUI view in 3D | visionOS |\n| `BodyTrackedEntity` | Body-tracked entity | BodyTrackingComponent |\n\n---\n\n## Part 2: Component Catalog\n\n### Transform\n\n```swift\n\u002F\u002F Properties\nentity.position                    \u002F\u002F SIMD3\u003CFloat>, local\nentity.orientation                 \u002F\u002F simd_quatf\nentity.scale                      \u002F\u002F SIMD3\u003CFloat>\nentity.transform                  \u002F\u002F Transform struct\n\n\u002F\u002F World-space\nentity.position(relativeTo: nil)\nentity.orientation(relativeTo: nil)\nentity.setPosition(pos, relativeTo: nil)\n\n\u002F\u002F Utilities\nentity.look(at: target, from: position, relativeTo: nil)\n```\n\n### ModelComponent\n\n```swift\nlet component = ModelComponent(\n    mesh: MeshResource.generateBox(size: 0.1),\n    materials: [SimpleMaterial(color: .red, isMetallic: true)]\n)\nentity.components[ModelComponent.self] = component\n```\n\n### MeshResource Built-in Generators\n\n| Method | Parameters |\n|--------|-----------|\n| `.generateBox(size:)` | `SIMD3\u003CFloat>` or single `Float` |\n| `.generateBox(size:cornerRadius:)` | Rounded box |\n| `.generateSphere(radius:)` | `Float` |\n| `.generatePlane(width:depth:)` | `Float`, `Float` |\n| `.generatePlane(width:height:)` | Vertical plane |\n| `.generateCylinder(height:radius:)` | `Float`, `Float` |\n| `.generateCone(height:radius:)` | `Float`, `Float` |\n| `.generateText(_:)` | `String`, with options |\n\n### CollisionComponent\n\n```swift\nlet component = CollisionComponent(\n    shapes: [\n        .generateBox(size: SIMD3(0.1, 0.2, 0.1)),\n        .generateSphere(radius: 0.05),\n        .generateCapsule(height: 0.3, radius: 0.05),\n        .generateConvex(from: meshResource)\n    ],\n    mode: .default,                    \u002F\u002F .default or .trigger\n    filter: CollisionFilter(\n        group: CollisionGroup(rawValue: 1),\n        mask: .all\n    )\n)\n```\n\n### ShapeResource Types\n\n| Method | Description | Performance |\n|--------|-------------|-------------|\n| `.generateBox(size:)` | Axis-aligned box | Fastest |\n| `.generateSphere(radius:)` | Sphere | Fast |\n| `.generateCapsule(height:radius:)` | Capsule | Fast |\n| `.generateConvex(from:)` | Convex hull from mesh | Moderate |\n| `.generateStaticMesh(from:)` | Exact mesh | Slowest (static only) |\n\n### PhysicsBodyComponent\n\n```swift\nlet component = PhysicsBodyComponent(\n    massProperties: .init(\n        mass: 1.0,\n        inertia: SIMD3(repeating: 0.1),\n        centerOfMass: .zero\n    ),\n    material: .generate(\n        staticFriction: 0.5,\n        dynamicFriction: 0.3,\n        restitution: 0.4\n    ),\n    mode: .dynamic                     \u002F\u002F .dynamic, .static, .kinematic\n)\n```\n\n| Mode | Behavior |\n|------|----------|\n| `.dynamic` | Physics simulation controls position |\n| `.static` | Immovable, participates in collisions |\n| `.kinematic` | Code-controlled, affects dynamic bodies |\n\n### PhysicsMotionComponent\n\n```swift\nvar motion = PhysicsMotionComponent()\nmotion.linearVelocity = SIMD3(0, 5, 0)\nmotion.angularVelocity = SIMD3(0, .pi, 0)\nentity.components[PhysicsMotionComponent.self] = motion\n```\n\n### CharacterControllerComponent\n\n```swift\nentity.components[CharacterControllerComponent.self] = CharacterControllerComponent(\n    radius: 0.3,\n    height: 1.8,\n    slopeLimit: .pi \u002F 4,\n    stepLimit: 0.3\n)\n\n\u002F\u002F Move character with gravity\nentity.moveCharacter(\n    by: SIMD3(0.1, -0.01, 0),\n    deltaTime: Float(context.deltaTime),\n    relativeTo: nil\n)\n```\n\n### AnchoringComponent\n\n```swift\n\u002F\u002F Plane detection\nAnchoringComponent(.plane(.horizontal, classification: .table,\n                           minimumBounds: SIMD2(0.2, 0.2)))\nAnchoringComponent(.plane(.vertical, classification: .wall,\n                           minimumBounds: SIMD2(0.5, 0.5)))\n\n\u002F\u002F World position\nAnchoringComponent(.world(transform: float4x4(...)))\n\n\u002F\u002F Image anchor\nAnchoringComponent(.image(group: \"AR Resources\", name: \"poster\"))\n\n\u002F\u002F Face tracking\nAnchoringComponent(.face)\n\n\u002F\u002F Body tracking\nAnchoringComponent(.body)\n```\n\n### Plane Classification\n\n| Classification | Description |\n|----------------|-------------|\n| `.table` | Horizontal table surface |\n| `.floor` | Floor surface |\n| `.ceiling` | Ceiling surface |\n| `.wall` | Vertical wall |\n| `.door` | Door |\n| `.window` | Window |\n| `.seat` | Chair\u002Fcouch |\n\n### Light Components\n\n```swift\n\u002F\u002F Directional\nlet light = DirectionalLightComponent(\n    color: .white,\n    intensity: 1000,\n    isRealWorldProxy: false\n)\nlight.shadow = DirectionalLightComponent.Shadow(\n    maximumDistance: 10,\n    depthBias: 0.01\n)\n\n\u002F\u002F Point\nPointLightComponent(\n    color: .white,\n    intensity: 1000,\n    attenuationRadius: 5\n)\n\n\u002F\u002F Spot\nSpotLightComponent(\n    color: .white,\n    intensity: 1000,\n    innerAngleInDegrees: 30,\n    outerAngleInDegrees: 60,\n    attenuationRadius: 10\n)\n```\n\n### Accessibility\n\n```swift\nvar accessibility = AccessibilityComponent()\naccessibility.label = \"Red cube\"\naccessibility.value = \"Interactive 3D object\"\naccessibility.traits = .button\naccessibility.isAccessibilityElement = true\nentity.components[AccessibilityComponent.self] = accessibility\n```\n\n### Additional Components\n\n| Component | Purpose | Platform |\n|-----------|---------|----------|\n| `OpacityComponent` | Fade entity in\u002Fout | All |\n| `GroundingShadowComponent` | Contact shadow beneath entity | All |\n| `InputTargetComponent` | Enable gesture input | visionOS |\n| `HoverEffectComponent` | Highlight on gaze\u002Fhover | visionOS |\n| `SynchronizationComponent` | Multiplayer entity sync | All |\n| `ImageBasedLightComponent` | Custom environment lighting | All |\n| `ImageBasedLightReceiverComponent` | Receive IBL from source | All |\n\n---\n\n## Part 3: System API\n\n### System Protocol\n\n```swift\nprotocol System {\n    init(scene: RealityKit.Scene)\n    func update(context: SceneUpdateContext)\n}\n```\n\n### SceneUpdateContext\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `deltaTime` | `TimeInterval` | Time since last update |\n| `scene` | `RealityKit.Scene` | The scene |\n\n```swift\n\u002F\u002F Query entities\ncontext.entities(matching: query, updatingSystemWhen: .rendering)\n```\n\n### EntityQuery\n\n```swift\n\u002F\u002F Has specific component\nEntityQuery(where: .has(HealthComponent.self))\n\n\u002F\u002F Has multiple components\nEntityQuery(where: .has(HealthComponent.self) && .has(ModelComponent.self))\n\n\u002F\u002F Does not have component\nEntityQuery(where: .has(EnemyComponent.self) && !.has(DeadComponent.self))\n```\n\n### Scene Events\n\n| Event | Trigger |\n|-------|---------|\n| `SceneEvents.Update` | Every frame |\n| `SceneEvents.DidAddEntity` | Entity added to scene |\n| `SceneEvents.DidRemoveEntity` | Entity removed from scene |\n| `SceneEvents.AnchoredStateChanged` | Anchor tracking changes |\n| `CollisionEvents.Began` | Two entities start colliding |\n| `CollisionEvents.Updated` | Collision continues |\n| `CollisionEvents.Ended` | Collision ends |\n| `AnimationEvents.PlaybackCompleted` | Animation finishes |\n\n```swift\nscene.subscribe(to: CollisionEvents.Began.self, on: entity) { event in\n    \u002F\u002F event.entityA, event.entityB, event.impulse\n}\n```\n\n---\n\n## Part 4: RealityView API\n\n### Initializers\n\n```swift\n\u002F\u002F Basic (iOS 18+, visionOS 1.0+)\nRealityView { content in\n    \u002F\u002F make: Add entities to content\n}\n\n\u002F\u002F With update\nRealityView { content in\n    \u002F\u002F make\n} update: { content in\n    \u002F\u002F update: Called when SwiftUI state changes\n}\n\n\u002F\u002F With placeholder\nRealityView { content in\n    \u002F\u002F make (async loading)\n} placeholder: {\n    ProgressView()\n}\n\n\u002F\u002F With attachments (visionOS)\nRealityView { content, attachments in\n    \u002F\u002F make\n} update: { content, attachments in\n    \u002F\u002F update\n} attachments: {\n    Attachment(id: \"label\") { Text(\"Hello\") }\n}\n```\n\n### RealityViewContent\n\n```swift\ncontent.add(entity)\ncontent.remove(entity)\ncontent.entities          \u002F\u002F EntityCollection\n\n\u002F\u002F iOS\u002FmacOS — camera content\ncontent.camera            \u002F\u002F RealityViewCameraContent (non-visionOS)\n```\n\n### Gestures on RealityView\n\n```swift\nRealityView { content in ... }\n    .gesture(TapGesture().targetedToAnyEntity().onEnded { value in\n        let entity = value.entity\n    })\n    .gesture(DragGesture().targetedToAnyEntity().onChanged { value in\n        value.entity.position = value.convert(value.location3D,\n            from: .local, to: .scene)\n    })\n    .gesture(RotateGesture().targetedToAnyEntity().onChanged { value in\n        \u002F\u002F Handle rotation\n    })\n    .gesture(MagnifyGesture().targetedToAnyEntity().onChanged { value in\n        \u002F\u002F Handle scale\n    })\n```\n\n---\n\n## Part 5: Model3D API\n\n```swift\n\u002F\u002F Simple display\nModel3D(named: \"robot\")\n\n\u002F\u002F With phases\nModel3D(named: \"robot\") { phase in\n    switch phase {\n    case .empty:\n        ProgressView()\n    case .success(let model):\n        model.resizable().scaledToFit()\n    case .failure(let error):\n        Text(\"Failed: \\(error.localizedDescription)\")\n    @unknown default:\n        EmptyView()\n    }\n}\n\n\u002F\u002F From URL\nModel3D(url: modelURL)\n```\n\n---\n\n## Part 6: Material System\n\n### SimpleMaterial\n\n```swift\nvar material = SimpleMaterial()\nmaterial.color = .init(tint: .blue)\nmaterial.metallic = .init(floatLiteral: 1.0)\nmaterial.roughness = .init(floatLiteral: 0.3)\n```\n\n### PhysicallyBasedMaterial\n\n```swift\nvar material = PhysicallyBasedMaterial()\nmaterial.baseColor = .init(tint: .white,\n    texture: .init(try .load(named: \"albedo\")))\nmaterial.metallic = .init(floatLiteral: 0.0)\nmaterial.roughness = .init(floatLiteral: 0.5)\nmaterial.normal = .init(texture: .init(try .load(named: \"normal\")))\nmaterial.ambientOcclusion = .init(texture: .init(try .load(named: \"ao\")))\nmaterial.emissiveColor = .init(color: .blue)\nmaterial.emissiveIntensity = 2.0\nmaterial.clearcoat = .init(floatLiteral: 0.8)\nmaterial.clearcoatRoughness = .init(floatLiteral: 0.1)\nmaterial.specular = .init(floatLiteral: 0.5)\nmaterial.sheen = .init(color: .white)\nmaterial.anisotropyLevel = .init(floatLiteral: 0.5)\nmaterial.blending = .transparent(opacity: .init(floatLiteral: 0.5))\nmaterial.faceCulling = .back            \u002F\u002F .none, .front, .back\n```\n\n### UnlitMaterial\n\n```swift\nvar material = UnlitMaterial()\nmaterial.color = .init(tint: .red,\n    texture: .init(try .load(named: \"texture\")))\nmaterial.blending = .transparent(opacity: .init(floatLiteral: 0.8))\n```\n\n### Special Materials\n\n```swift\n\u002F\u002F Occlusion — invisible but hides content behind it\nlet occlusionMaterial = OcclusionMaterial()\n\n\u002F\u002F Video\nlet videoMaterial = VideoMaterial(avPlayer: avPlayer)\n```\n\n### TextureResource Loading\n\n```swift\n\u002F\u002F From bundle\nlet texture = try await TextureResource(named: \"texture\")\n\n\u002F\u002F From URL\nlet texture = try await TextureResource(contentsOf: url)\n\n\u002F\u002F With options\nlet texture = try await TextureResource(named: \"texture\",\n    options: .init(semantic: .color))  \u002F\u002F .color, .raw, .normal, .hdrColor\n```\n\n---\n\n## Part 7: Animation\n\n### Transform Animation\n\n```swift\nentity.move(\n    to: Transform(\n        scale: .one,\n        rotation: targetRotation,\n        translation: targetPosition\n    ),\n    relativeTo: entity.parent,\n    duration: 1.5,\n    timingFunction: .easeInOut\n)\n```\n\n### Timing Functions\n\n| Function | Curve |\n|----------|-------|\n| `.default` | System default |\n| `.linear` | Constant speed |\n| `.easeIn` | Slow start |\n| `.easeOut` | Slow end |\n| `.easeInOut` | Slow start and end |\n\n### Playing Loaded Animations\n\n```swift\n\u002F\u002F All animations from USD\nfor animation in entity.availableAnimations {\n    let controller = entity.playAnimation(animation)\n}\n\n\u002F\u002F With options\nlet controller = entity.playAnimation(\n    animation.repeat(count: 3),\n    transitionDuration: 0.3,\n    startsPaused: false\n)\n```\n\n### AnimationPlaybackController\n\n```swift\nlet controller = entity.playAnimation(animation)\ncontroller.pause()\ncontroller.resume()\ncontroller.stop()\ncontroller.speed = 0.5            \u002F\u002F Half speed\ncontroller.blendFactor = 1.0      \u002F\u002F Full blend\ncontroller.isComplete             \u002F\u002F Check completion\n```\n\n---\n\n## Part 8: Audio\n\n### AudioFileResource\n\n```swift\n\u002F\u002F Load\nlet resource = try AudioFileResource.load(\n    named: \"sound.wav\",\n    configuration: .init(\n        shouldLoop: true,\n        shouldRandomizeStartTime: false,\n        mixGroupName: \"effects\"\n    )\n)\n```\n\n### Audio Components\n\n```swift\n\u002F\u002F Spatial (3D positional)\nentity.components[SpatialAudioComponent.self] = SpatialAudioComponent(\n    directivity: .beam(focus: 0.5),\n    distanceAttenuation: .rolloff(factor: 1.0),\n    gain: 0                          \u002F\u002F dB\n)\n\n\u002F\u002F Ambient (non-positional, uniform)\nentity.components[AmbientAudioComponent.self] = AmbientAudioComponent(\n    gain: -6\n)\n\n\u002F\u002F Channel (multi-channel output)\nentity.components[ChannelAudioComponent.self] = ChannelAudioComponent(\n    gain: 0\n)\n```\n\n### Playback\n\n```swift\nlet controller = entity.playAudio(resource)\ncontroller.pause()\ncontroller.stop()\ncontroller.gain = -3               \u002F\u002F Adjust volume (dB)\ncontroller.speed = 1.5             \u002F\u002F Pitch shift\n\nentity.stopAllAudio()\n```\n\n---\n\n## Part 9: RealityRenderer (Metal Integration)\n\n```swift\n\u002F\u002F Low-level Metal rendering of RealityKit content\nlet renderer = try RealityRenderer()\nrenderer.entities.append(entity)\n\n\u002F\u002F Render to Metal texture\nlet descriptor = RealityRenderer.CameraOutput.Descriptor(\n    colorFormat: .bgra8Unorm,\n    depthFormat: .depth32Float\n)\ntry renderer.render(\n    viewMatrix: viewMatrix,\n    projectionMatrix: projectionMatrix,\n    size: size,\n    colorTexture: colorTexture,\n    depthTexture: depthTexture\n)\n```\n\n---\n\n## Resources\n\n**WWDC**: 2019-603, 2019-605, 2021-10074, 2022-10074, 2023-10080, 2024-10103, 2024-10153\n\n**Docs**: \u002Frealitykit, \u002Frealitykit\u002Fentity, \u002Frealitykit\u002Fcomponent, \u002Frealitykit\u002Fsystem, \u002Frealitykit\u002Frealityview, \u002Frealitykit\u002Fmodel3d, \u002Frealitykit\u002Fmodelentity, \u002Frealitykit\u002Fanchorentity, \u002Frealitykit\u002Fphysicallybasedmaterial\n\n**Skills**: axiom-realitykit, axiom-realitykit-diag, axiom-scenekit-ref\n\n","# RealityKit API Reference\n\nComplete API reference for RealityKit organized by category.\n\n## When to Use This Reference\n\nUse this reference when:\n- Looking up specific RealityKit API signatures or properties\n- Checking which component types are available\n- Finding the right anchor type for an AR experience\n- Browsing material properties and options\n- Setting up physics body parameters\n- Looking up animation or audio API details\n- Checking platform availability for specific APIs\n\n---\n\n## Part 1: Entity API\n\n### Entity\n\n```swift\n\u002F\u002F Creation\nlet entity = Entity()\nlet entity = Entity(components: [TransformComponent(), ModelComponent(...)])\n\n\u002F\u002F Async loading\nlet entity = try await Entity(named: \"scene\", in: .main)\nlet entity = try await Entity(contentsOf: url)\n\n\u002F\u002F Clone\nlet clone = entity.clone(recursive: true)\n```\n\n### Entity Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `name` | `String` | Identifier for lookup |\n| `id` | `ObjectIdentifier` | Unique identity |\n| `isEnabled` | `Bool` | Local enabled state |\n| `isEnabledInHierarchy` | `Bool` | Effective enabled (considers parents) |\n| `isActive` | `Bool` | Entity is in an active scene |\n| `isAnchored` | `Bool` | Has anchoring or anchored ancestor |\n| `scene` | `RealityKit.Scene?` | Owning scene |\n| `parent` | `Entity?` | Parent entity |\n| `children` | `Entity.ChildCollection` | Child entities |\n| `components` | `Entity.ComponentSet` | All attached components |\n| `anchor` | `HasAnchoring?` | Nearest anchoring ancestor |\n\n### Entity Hierarchy Methods\n\n```swift\nentity.addChild(child)\nentity.addChild(child, preservingWorldTransform: true)\nentity.removeChild(child)\nentity.removeFromParent()\nentity.findEntity(named: \"name\")  \u002F\u002F Recursive search\n```\n\n### Entity Subclasses\n\n| Class | Purpose | Key Component |\n|-------|---------|---------------|\n| `Entity` | Base container | Transform only |\n| `ModelEntity` | Renderable object | ModelComponent |\n| `AnchorEntity` | AR anchor point | AnchoringComponent |\n| `PerspectiveCamera` | Virtual camera | PerspectiveCameraComponent |\n| `DirectionalLight` | Sun\u002Fdirectional | DirectionalLightComponent |\n| `PointLight` | Point light | PointLightComponent |\n| `SpotLight` | Spot light | SpotLightComponent |\n| `TriggerVolume` | Invisible collision zone | CollisionComponent |\n| `ViewAttachmentEntity` | SwiftUI view in 3D | visionOS |\n| `BodyTrackedEntity` | Body-tracked entity | BodyTrackingComponent |\n\n---\n\n## Part 2: Component Catalog\n\n### Transform\n\n```swift\n\u002F\u002F Properties\nentity.position                    \u002F\u002F SIMD3\u003CFloat>, local\nentity.orientation                 \u002F\u002F simd_quatf\nentity.scale                      \u002F\u002F SIMD3\u003CFloat>\nentity.transform                  \u002F\u002F Transform struct\n\n\u002F\u002F World-space\nentity.position(relativeTo: nil)\nentity.orientation(relativeTo: nil)\nentity.setPosition(pos, relativeTo: nil)\n\n\u002F\u002F Utilities\nentity.look(at: target, from: position, relativeTo: nil)\n```\n\n### ModelComponent\n\n```swift\nlet component = ModelComponent(\n    mesh: MeshResource.generateBox(size: 0.1),\n    materials: [SimpleMaterial(color: .red, isMetallic: true)]\n)\nentity.components[ModelComponent.self] = component\n```\n\n### MeshResource Built-in Generators\n\n| Method | Parameters |\n|--------|-----------|\n| `.generateBox(size:)` | `SIMD3\u003CFloat>` or single `Float` |\n| `.generateBox(size:cornerRadius:)` | Rounded box |\n| `.generateSphere(radius:)` | `Float` |\n| `.generatePlane(width:depth:)` | `Float`, `Float` |\n| `.generatePlane(width:height:)` | Vertical plane |\n| `.generateCylinder(height:radius:)` | `Float`, `Float` |\n| `.generateCone(height:radius:)` | `Float`, `Float` |\n| `.generateText(_:)` | `String`, with options |\n\n### CollisionComponent\n\n```swift\nlet component = CollisionComponent(\n    shapes: [\n        .generateBox(size: SIMD3(0.1, 0.2, 0.1)),\n        .generateSphere(radius: 0.05),\n        .generateCapsule(height: 0.3, radius: 0.05),\n        .generateConvex(from: meshResource)\n    ],\n    mode: .default,                    \u002F\u002F .default or .trigger\n    filter: CollisionFilter(\n        group: CollisionGroup(rawValue: 1),\n        mask: .all\n    )\n)\n```\n\n### ShapeResource Types\n\n| Method | Description | Performance |\n|--------|-------------|-------------|\n| `.generateBox(size:)` | Axis-aligned box | Fastest |\n| `.generateSphere(radius:)` | Sphere | Fast |\n| `.generateCapsule(height:radius:)` | Capsule | Fast |\n| `.generateConvex(from:)` | Convex hull from mesh | Moderate |\n| `.generateStaticMesh(from:)` | Exact mesh | Slowest (static only) |\n\n### PhysicsBodyComponent\n\n```swift\nlet component = PhysicsBodyComponent(\n    massProperties: .init(\n        mass: 1.0,\n        inertia: SIMD3(repeating: 0.1),\n        centerOfMass: .zero\n    ),\n    material: .generate(\n        staticFriction: 0.5,\n        dynamicFriction: 0.3,\n        restitution: 0.4\n    ),\n    mode: .dynamic                     \u002F\u002F .dynamic, .static, .kinematic\n)\n```\n\n| Mode | Behavior |\n|------|----------|\n| `.dynamic` | Physics simulation controls position |\n| `.static` | Immovable, participates in collisions |\n| `.kinematic` | Code-controlled, affects dynamic bodies |\n\n### PhysicsMotionComponent\n\n```swift\nvar motion = PhysicsMotionComponent()\nmotion.linearVelocity = SIMD3(0, 5, 0)\nmotion.angularVelocity = SIMD3(0, .pi, 0)\nentity.components[PhysicsMotionComponent.self] = motion\n```\n\n### CharacterControllerComponent\n\n```swift\nentity.components[CharacterControllerComponent.self] = CharacterControllerComponent(\n    radius: 0.3,\n    height: 1.8,\n    slopeLimit: .pi \u002F 4,\n    stepLimit: 0.3\n)\n\n\u002F\u002F Move character with gravity\nentity.moveCharacter(\n    by: SIMD3(0.1, -0.01, 0),\n    deltaTime: Float(context.deltaTime),\n    relativeTo: nil\n)\n```\n\n### AnchoringComponent\n\n```swift\n\u002F\u002F Plane detection\nAnchoringComponent(.plane(.horizontal, classification: .table,\n                           minimumBounds: SIMD2(0.2, 0.2)))\nAnchoringComponent(.plane(.vertical, classification: .wall,\n                           minimumBounds: SIMD2(0.5, 0.5)))\n\n\u002F\u002F World position\nAnchoringComponent(.world(transform: float4x4(...)))\n\n\u002F\u002F Image anchor\nAnchoringComponent(.image(group: \"AR Resources\", name: \"poster\"))\n\n\u002F\u002F Face tracking\nAnchoringComponent(.face)\n\n\u002F\u002F Body tracking\nAnchoringComponent(.body)\n```\n\n### Plane Classification\n\n| Classification | Description |\n|----------------|-------------|\n| `.table` | Horizontal table surface |\n| `.floor` | Floor surface |\n| `.ceiling` | Ceiling surface |\n| `.wall` | Vertical wall |\n| `.door` | Door |\n| `.window` | Window |\n| `.seat` | Chair\u002Fcouch |\n\n### Light Components\n\n```swift\n\u002F\u002F Directional\nlet light = DirectionalLightComponent(\n    color: .white,\n    intensity: 1000,\n    isRealWorldProxy: false\n)\nlight.shadow = DirectionalLightComponent.Shadow(\n    maximumDistance: 10,\n    depthBias: 0.01\n)\n\n\u002F\u002F Point\nPointLightComponent(\n    color: .white,\n    intensity: 1000,\n    attenuationRadius: 5\n)\n\n\u002F\u002F Spot\nSpotLightComponent(\n    color: .white,\n    intensity: 1000,\n    innerAngleInDegrees: 30,\n    outerAngleInDegrees: 60,\n    attenuationRadius: 10\n)\n```\n\n### Accessibility\n\n```swift\nvar accessibility = AccessibilityComponent()\naccessibility.label = \"Red cube\"\naccessibility.value = \"Interactive 3D object\"\naccessibility.traits = .button\naccessibility.isAccessibilityElement = true\nentity.components[AccessibilityComponent.self] = accessibility\n```\n\n### Additional Components\n\n| Component | Purpose | Platform |\n|-----------|---------|----------|\n| `OpacityComponent` | Fade entity in\u002Fout | All |\n| `GroundingShadowComponent` | Contact shadow beneath entity | All |\n| `InputTargetComponent` | Enable gesture input | visionOS |\n| `HoverEffectComponent` | Highlight on gaze\u002Fhover | visionOS |\n| `SynchronizationComponent` | Multiplayer entity sync | All |\n| `ImageBasedLightComponent` | Custom environment lighting | All |\n| `ImageBasedLightReceiverComponent` | Receive IBL from source | All |\n\n---\n\n## Part 3: System API\n\n### System Protocol\n\n```swift\nprotocol System {\n    init(scene: RealityKit.Scene)\n    func update(context: SceneUpdateContext)\n}\n```\n\n### SceneUpdateContext\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `deltaTime` | `TimeInterval` | Time since last update |\n| `scene` | `RealityKit.Scene` | The scene |\n\n```swift\n\u002F\u002F Query entities\ncontext.entities(matching: query, updatingSystemWhen: .rendering)\n```\n\n### EntityQuery\n\n```swift\n\u002F\u002F Has specific component\nEntityQuery(where: .has(HealthComponent.self))\n\n\u002F\u002F Has multiple components\nEntityQuery(where: .has(HealthComponent.self) && .has(ModelComponent.self))\n\n\u002F\u002F Does not have component\nEntityQuery(where: .has(EnemyComponent.self) && !.has(DeadComponent.self))\n```\n\n### Scene Events\n\n| Event | Trigger |\n|-------|---------|\n| `SceneEvents.Update` | Every frame |\n| `SceneEvents.DidAddEntity` | Entity added to scene |\n| `SceneEvents.DidRemoveEntity` | Entity removed from scene |\n| `SceneEvents.AnchoredStateChanged` | Anchor tracking changes |\n| `CollisionEvents.Began` | Two entities start colliding |\n| `CollisionEvents.Updated` | Collision continues |\n| `CollisionEvents.Ended` | Collision ends |\n| `AnimationEvents.PlaybackCompleted` | Animation finishes |\n\n```swift\nscene.subscribe(to: CollisionEvents.Began.self, on: entity) { event in\n    \u002F\u002F event.entityA, event.entityB, event.impulse\n}\n```\n\n---\n\n## Part 4: RealityView API\n\n### Initializers\n\n```swift\n\u002F\u002F Basic (iOS 18+, visionOS 1.0+)\nRealityView { content in\n    \u002F\u002F make: Add entities to content\n}\n\n\u002F\u002F With update\nRealityView { content in\n    \u002F\u002F make\n} update: { content in\n    \u002F\u002F update: Called when SwiftUI state changes\n}\n\n\u002F\u002F With placeholder\nRealityView { content in\n    \u002F\u002F make (async loading)\n} placeholder: {\n    ProgressView()\n}\n\n\u002F\u002F With attachments (visionOS)\nRealityView { content, attachments in\n    \u002F\u002F make\n} update: { content, attachments in\n    \u002F\u002F update\n} attachments: {\n    Attachment(id: \"label\") { Text(\"Hello\") }\n}\n```\n\n### RealityViewContent\n\n```swift\ncontent.add(entity)\ncontent.remove(entity)\ncontent.entities          \u002F\u002F EntityCollection\n\n\u002F\u002F iOS\u002FmacOS — camera content\ncontent.camera            \u002F\u002F RealityViewCameraContent (non-visionOS)\n```\n\n### Gestures on RealityView\n\n```swift\nRealityView { content in ... }\n    .gesture(TapGesture().targetedToAnyEntity().onEnded { value in\n        let entity = value.entity\n    })\n    .gesture(DragGesture().targetedToAnyEntity().onChanged { value in\n        value.entity.position = value.convert(value.location3D,\n            from: .local, to: .scene)\n    })\n    .gesture(RotateGesture().targetedToAnyEntity().onChanged { value in\n        \u002F\u002F Handle rotation\n    })\n    .gesture(MagnifyGesture().targetedToAnyEntity().onChanged { value in\n        \u002F\u002F Handle scale\n    })\n```\n\n---\n\n## Part 5: Model3D API\n\n```swift\n\u002F\u002F Simple display\nModel3D(named: \"robot\")\n\n\u002F\u002F With phases\nModel3D(named: \"robot\") { phase in\n    switch phase {\n    case .empty:\n        ProgressView()\n    case .success(let model):\n        model.resizable().scaledToFit()\n    case .failure(let error):\n        Text(\"Failed: \\(error.localizedDescription)\")\n    @unknown default:\n        EmptyView()\n    }\n}\n\n\u002F\u002F From URL\nModel3D(url: modelURL)\n```\n\n---\n\n## Part 6: Material System\n\n### SimpleMaterial\n\n```swift\nvar material = SimpleMaterial()\nmaterial.color = .init(tint: .blue)\nmaterial.metallic = .init(floatLiteral: 1.0)\nmaterial.roughness = .init(floatLiteral: 0.3)\n```\n\n### PhysicallyBasedMaterial\n\n```swift\nvar material = PhysicallyBasedMaterial()\nmaterial.baseColor = .init(tint: .white,\n    texture: .init(try .load(named: \"albedo\")))\nmaterial.metallic = .init(floatLiteral: 0.0)\nmaterial.roughness = .init(floatLiteral: 0.5)\nmaterial.normal = .init(texture: .init(try .load(named: \"normal\")))\nmaterial.ambientOcclusion = .init(texture: .init(try .load(named: \"ao\")))\nmaterial.emissiveColor = .init(color: .blue)\nmaterial.emissiveIntensity = 2.0\nmaterial.clearcoat = .init(floatLiteral: 0.8)\nmaterial.clearcoatRoughness = .init(floatLiteral: 0.1)\nmaterial.specular = .init(floatLiteral: 0.5)\nmaterial.sheen = .init(color: .white)\nmaterial.anisotropyLevel = .init(floatLiteral: 0.5)\nmaterial.blending = .transparent(opacity: .init(floatLiteral: 0.5))\nmaterial.faceCulling = .back            \u002F\u002F .none, .front, .back\n```\n\n### UnlitMaterial\n\n```swift\nvar material = UnlitMaterial()\nmaterial.color = .init(tint: .red,\n    texture: .init(try .load(named: \"texture\")))\nmaterial.blending = .transparent(opacity: .init(floatLiteral: 0.8))\n```\n\n### Special Materials\n\n```swift\n\u002F\u002F Occlusion — invisible but hides content behind it\nlet occlusionMaterial = OcclusionMaterial()\n\n\u002F\u002F Video\nlet videoMaterial = VideoMaterial(avPlayer: avPlayer)\n```\n\n### TextureResource Loading\n\n```swift\n\u002F\u002F From bundle\nlet texture = try await TextureResource(named: \"texture\")\n\n\u002F\u002F From URL\nlet texture = try await TextureResource(contentsOf: url)\n\n\u002F\u002F With options\nlet texture = try await TextureResource(named: \"texture\",\n    options: .init(semantic: .color))  \u002F\u002F .color, .raw, .normal, .hdrColor\n```\n\n---\n\n## Part 7: Animation\n\n### Transform Animation\n\n```swift\nentity.move(\n    to: Transform(\n        scale: .one,\n        rotation: targetRotation,\n        translation: targetPosition\n    ),\n    relativeTo: entity.parent,\n    duration: 1.5,\n    timingFunction: .easeInOut\n)\n```\n\n### Timing Functions\n\n| Function | Curve |\n|----------|-------|\n| `.default` | System default |\n| `.linear` | Constant speed |\n| `.easeIn` | Slow start |\n| `.easeOut` | Slow end |\n| `.easeInOut` | Slow start and end |\n\n### Playing Loaded Animations\n\n```swift\n\u002F\u002F All animations from USD\nfor animation in entity.availableAnimations {\n    let controller = entity.playAnimation(animation)\n}\n\n\u002F\u002F With options\nlet controller = entity.playAnimation(\n    animation.repeat(count: 3),\n    transitionDuration: 0.3,\n    startsPaused: false\n)\n```\n\n### AnimationPlaybackController\n\n```swift\nlet controller = entity.playAnimation(animation)\ncontroller.pause()\ncontroller.resume()\ncontroller.stop()\ncontroller.speed = 0.5            \u002F\u002F Half speed\ncontroller.blendFactor = 1.0      \u002F\u002F Full blend\ncontroller.isComplete             \u002F\u002F Check completion\n```\n\n---\n\n## Part 8: Audio\n\n### AudioFileResource\n\n```swift\n\u002F\u002F Load\nlet resource = try AudioFileResource.load(\n    named: \"sound.wav\",\n    configuration: .init(\n        shouldLoop: true,\n        shouldRandomizeStartTime: false,\n        mixGroupName: \"effects\"\n    )\n)\n```\n\n### Audio Components\n\n```swift\n\u002F\u002F Spatial (3D positional)\nentity.components[SpatialAudioComponent.self] = SpatialAudioComponent(\n    directivity: .beam(focus: 0.5),\n    distanceAttenuation: .rolloff(factor: 1.0),\n    gain: 0                          \u002F\u002F dB\n)\n\n\u002F\u002F Ambient (non-positional, uniform)\nentity.components[AmbientAudioComponent.self] = AmbientAudioComponent(\n    gain: -6\n)\n\n\u002F\u002F Channel (multi-channel output)\nentity.components[ChannelAudioComponent.self] = ChannelAudioComponent(\n    gain: 0\n)\n```\n\n### Playback\n\n```swift\nlet controller = entity.playAudio(resource)\ncontroller.pause()\ncontroller.stop()\ncontroller.gain = -3               \u002F\u002F Adjust volume (dB)\ncontroller.speed = 1.5             \u002F\u002F Pitch shift\n\nentity.stopAllAudio()\n```\n\n---\n\n## Part 9: RealityRenderer (Metal Integration)\n\n```swift\n\u002F\u002F Low-level Metal rendering of RealityKit content\nlet renderer = try RealityRenderer()\nrenderer.entities.append(entity)\n\n\u002F\u002F Render to Metal texture\nlet descriptor = RealityRenderer.CameraOutput.Descriptor(\n    colorFormat: .bgra8Unorm,\n    depthFormat: .depth32Float\n)\ntry renderer.render(\n    viewMatrix: viewMatrix,\n    projectionMatrix: projectionMatrix,\n    size: size,\n    colorTexture: colorTexture,\n    depthTexture: depthTexture\n)\n```\n\n---\n\n## Resources\n\n**WWDC**: 2019-603, 2019-605, 2021-10074, 2022-10074, 2023-10080, 2024-10103, 2024-10153\n\n**Docs**: \u002Frealitykit, \u002Frealitykit\u002Fentity, \u002Frealitykit\u002Fcomponent, \u002Frealitykit\u002Fsystem, \u002Frealitykit\u002Frealityview, \u002Frealitykit\u002Fmodel3d, \u002Frealitykit\u002Fmodelentity, \u002Frealitykit\u002Fanchorentity, \u002Frealitykit\u002Fphysicallybasedmaterial\n\n**Skills**: axiom-realitykit, axiom-realitykit-diag, axiom-scenekit-ref\n\n",{"name":5,"license":15,"metadata":37,"description":7,"compatibility":39},{"version":38},"1.0.0",[40,41,42,43],"iOS 13+","macOS 10.15+","visionOS 1.0+","tvOS 26+","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FCharlesWiltgen\u002FAxiom\u002Faxiom-realitykit-ref",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill axiom-realitykit-ref",{"tool":59,"command":60},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill axiom-realitykit-ref",{"tool":62,"command":63},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill axiom-realitykit-ref","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FCharlesWiltgen\u002FAxiom\u002Faxiom-realitykit-ref\u002FSKILL.md",true,[],[68,77,86,95,101,107],{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":32},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[74,75,76],"model","model hierarchy","model hierarchy skill",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":32},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[83,84,85],"MCP","zoom","zoom mcp",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":32},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[92,93,94,84],"sdk","zoom apps sdk","apps",{"skillNo":96,"name":97,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":32},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[97],{"skillNo":102,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":32},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[103],{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":32},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[109]]