You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
977 B
36 lines
977 B
//
|
|
// ARConfiguration+SCConfiguration.m
|
|
// Snapchat
|
|
//
|
|
// Created by Max Goedjen on 11/7/17.
|
|
//
|
|
|
|
#import "ARConfiguration+SCConfiguration.h"
|
|
|
|
#import "SCCapturerDefines.h"
|
|
|
|
@implementation ARConfiguration (SCConfiguration)
|
|
|
|
+ (BOOL)sc_supportedForDevicePosition:(SCManagedCaptureDevicePosition)position
|
|
{
|
|
return [[[self sc_configurationForDevicePosition:position] class] isSupported];
|
|
}
|
|
|
|
+ (ARConfiguration *)sc_configurationForDevicePosition:(SCManagedCaptureDevicePosition)position
|
|
{
|
|
if (@available(iOS 11.0, *)) {
|
|
if (position == SCManagedCaptureDevicePositionBack) {
|
|
ARWorldTrackingConfiguration *config = [[ARWorldTrackingConfiguration alloc] init];
|
|
config.planeDetection = ARPlaneDetectionHorizontal;
|
|
config.lightEstimationEnabled = NO;
|
|
return config;
|
|
} else {
|
|
#ifdef SC_USE_ARKIT_FACE
|
|
return [[ARFaceTrackingConfiguration alloc] init];
|
|
#endif
|
|
}
|
|
}
|
|
return nil;
|
|
}
|
|
|
|
@end
|