Target: visionOS 2+, Apple Vision Pro. Reference impl Month 2 (hardware-gated).
import XRAIKit // MIT package, ships Month 2
let graph = try XraiLoader.parse(data: jsonData)
let entity = try XraiSceneBuilder.build(graph: graph)
arView.scene.anchors.append(AnchorEntity(world: .zero))
arView.scene.anchors.first?.addChild(entity)
| XRAI | RealityKit |
|---|---|
entity.type = object.primitive, model_id = 0..5 |
MeshResource.generateBox/Sphere/... + ModelEntity |
entity.type = object.glb |
Convert glTF → USDZ → Entity.load(named:) (glTFast-like bridge) |
entity.type = object.light |
DirectionalLight / PointLight / SpotLight |
entity.transform.position |
entity.position = SIMD3<Float>(...) |
entity.transform.rotation (quat) |
entity.orientation = simd_quatf(ix: x, iy: y, iz: z, r: w) |
entity.transform.scale |
entity.scale = SIMD3<Float>(...) |
entity.material.color |
SimpleMaterial(color:, roughness:, isMetallic:) |
relation.type = parent-of |
parentEntity.addChild(child) |
graph.origin.handedness === "right"XRAI can REFERENCE USDZ assets in entity.type = object.usdz (v1.1+ addition). This lets Apple’s ecosystem flow through XRAI graphs without forcing asset re-authoring.
XRAIKit)