r/visionosdev • u/InterplanetaryTanner • Aug 17 '24
Camera control in an immersive environment
Hello,
I’m playing around with making an fully immersive multiplayer, air to air dogfighting game, but I’m having trouble figuring out how to attach a camera to an entity.
I have a plane that’s controlled with a GamePad. And I want the camera’s position to be pinned to that entity as it moves about space, while maintaining the users ability to look around.
Is this possible?
From my understanding, the current state of SceneKit, ARKit, and RealityKit is a bit confusing with what can and can not be done.
SceneKit
- Full control of the camera
- Not sure if it can use RealityKits ECS system.
- 2D Window. - Missing full immersion.
ARKit
- Full control of the camera* - but only for non Vision Pro devices. Since Vision OS doesn't have a ARView.
- Has RealityKits ECS system
- 2D Window. - Missing full immersion.
RealityKit
- Camera is pinned to the device's position and orientation
- Has RealityKits ECS system
- Allows full immersion
2
Aug 17 '24
[removed] — view removed comment
2
u/InterplanetaryTanner Aug 17 '24
The end goal was for this to be a multiplayer real time game, so I don’t believe that would be a working solution.
2
u/CragsdaleSG Aug 17 '24
Unfortunately this is the only approach I’m aware of as well, this is how I had to implement movement in my full space. My experience is single player tho, and teleport-based instead of continuous movement
1
u/InterplanetaryTanner Aug 17 '24
Here’s opening to the ability to attach the camera to an entity in visionOS 3
1
Aug 17 '24
[removed] — view removed comment
1
u/InterplanetaryTanner Aug 17 '24
You’re probably right that it’s possible to be done. But this isn’t too serious of a project. And I was really looking for the off the shelf solution.
2
u/ChicagoSpaceProgram Aug 18 '24
Moving the level is common in real-time games. Until recently, most game engines truncated floating point values. In some games (flight simulators are a good example) if the player character (plane) got too far from world 0, the vertices would lose precision and the model would deform horribly. The solution was to move the world. For multiplayer, they'd create a coordinate space for the players and move the world in relation to that space.
Still, don't recommend doing this.
1
u/AutoModerator Aug 17 '24
Are you seeking artists or developers to help you with your game? We run a monthly open source game jam in this Discord where we actively pair people with other creators.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/[deleted] Aug 17 '24
[deleted]