Skip to main content

Technical Details

A peek under the hood!

note

Details are changing rapidly. Check out the repository!

How Godot and RealityKit combine

Godot has been modified to exist as an embedded library in a RealityKit app (see Dependencies below).

We run Godot in "--headless" mode (details here) which means that all graphics and windows are disabled.

Then, every RealityKit frame, we call into Godot to pass it input, and to ask it to "tick" its world forward.

When new Godot Nodes enter the tree (see SceneTree docs), we create corresponding RealityKit Entitys for them, so there is a "mirrored" tree. Godot Meshes become RealityKit MeshResources, etc.

Once a frame, we stream any changed Node transforms to RealityKit to modify their positions/rotations/scales.

A diagram illustrating how RealityKit's and Godot's event loops have been intertwined

Corresponding Godot and RealityKit concepts

GodotRealityKitRole
NodeEntityThe thing that exists in a tree (has a parent, and children), that you make up your game scene with. Each of these has a position, rotation and scale that gets applied downward in the tree.
ComponentRealityKit has an Entity-Component-System, but Godot does not.
MeshMeshResourceThe data that makes up the triangles and textures that is an object you can render in your game.

Dependencies

GodotVision depends on SwiftGodotKit, SwiftGodot--and, of course--Godot.

SwiftGodotKit embeds Godot in a Swift application. SwiftGodot provides bindings from Swift to Godot via Godot's GDExtension mechanism.