Slide 11
Slide 11 text
タイトル
RealityRendererにシーンを追加する時 注意点
I'm trying to develop an immersive visionOS app, which you can move an Entity having a
PerspectiveCamera as its child in immersive space, and render the camera view on 2D window.
According to this thread, this seems to can be achieved using RealityRenderer. But when I added the scene
entity loaded from realityKitContentBundle to realityRenderer.entities, I needed to clone all entities of
the scene, otherwise all entities in the immersive space will disappear.
Is this the expected behavior? Or is there any other way to do this (move camera in immersive space and
render its output on 2D window)?
I really like your use case! Super creative.
The behavior you're observing is expected. An entity can only have a single parent. Anytime you add an
entity to another entity, it is removed from its parent. In this case, when you add scene to renderer it
removes scene from the immersive space's content.
Cloning the entity is a reasonable solution. Alternatively you can load 2 copies of your RealityKitContent;
one for the immersive view and another for the reality renderer.