Expose more ar config options

This commit is contained in:
Georg Hagen
2024-07-04 09:24:15 +02:00
parent 4af5dbd596
commit d5e0331525
2 changed files with 14 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ namespace OpenVulkano::AR::ArKit
auto vidFormats = [ARWorldTrackingConfiguration supportedVideoFormats];
for (ARVideoFormat* format: vidFormats)
{
if (ss.gcount() > 1) ss << ", ";
if (ss.tellp() > std::streampos(5)) ss << ", ";
ss << format.imageResolution.width << 'x' << format.imageResolution.height;
ss << '@' << format.framesPerSecond;
if (@available(iOS 16.0, *))
@@ -67,6 +67,12 @@ namespace OpenVulkano::AR::ArKit
{
m_arConfig.frameSemantics = ARFrameSemanticSceneDepth;
}
if (config.sceneReconstruction)
{
m_arConfig.sceneReconstruction = ARSceneReconstructionMesh;
}
m_arConfig.planeDetection = config.planeDetection ? (ARPlaneDetectionVertical | ARPlaneDetectionHorizontal) : ARPlaneDetectionNone;
m_arConfig.autoFocusEnabled = config.autoFocus;
// Set video format
{
@@ -74,8 +80,8 @@ namespace OpenVulkano::AR::ArKit
//TODO handle ar video format in settings
if (@available(iOS 16.0, *))
{
//m_arConfig.videoFormat = [ARWorldTrackingConfiguration recommendedVideoFormatFor4KResolution];
//m_arConfig.videoFormat = [ARWorldTrackingConfiguration recommendedVideoFormatForHighResolutionFrameCapturing];
if (config.preferHDR) m_arConfig.videoFormat = [ARWorldTrackingConfiguration recommendedVideoFormatForHighResolutionFrameCapturing];
//TODO resolution handling
}
LogFormat("Using video format", m_arConfig.videoFormat);
}