2014 snapchat source code
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

  1. //
  2. // ARConfiguration+SCConfiguration.m
  3. // Snapchat
  4. //
  5. // Created by Max Goedjen on 11/7/17.
  6. //
  7. #import "ARConfiguration+SCConfiguration.h"
  8. #import "SCCapturerDefines.h"
  9. @implementation ARConfiguration (SCConfiguration)
  10. + (BOOL)sc_supportedForDevicePosition:(SCManagedCaptureDevicePosition)position
  11. {
  12. return [[[self sc_configurationForDevicePosition:position] class] isSupported];
  13. }
  14. + (ARConfiguration *)sc_configurationForDevicePosition:(SCManagedCaptureDevicePosition)position
  15. {
  16. if (@available(iOS 11.0, *)) {
  17. if (position == SCManagedCaptureDevicePositionBack) {
  18. ARWorldTrackingConfiguration *config = [[ARWorldTrackingConfiguration alloc] init];
  19. config.planeDetection = ARPlaneDetectionHorizontal;
  20. config.lightEstimationEnabled = NO;
  21. return config;
  22. } else {
  23. #ifdef SC_USE_ARKIT_FACE
  24. return [[ARFaceTrackingConfiguration alloc] init];
  25. #endif
  26. }
  27. }
  28. return nil;
  29. }
  30. @end