<commit_before>//
//  RootVC.swift
//  Internet Map
//
//  Created by <NAME> on 2017-11-16.
//  Copyright © 2017 Peer1. All rights reserved.
//

import UIKit
import ARKit

private class CameraDelegate: NSObject, ARSessionDelegate {
    let renderer: ViewController

    init(renderer: ViewController) {
        self.renderer = renderer
        super.init()
    }

    public func session(_ session: ARSession, didUpdate frame: ARFrame) {
        renderer.overrideCamera(frame.camera.viewMatrix(for: .portrait), projection: frame.camera.projectionMatrix(for: .portrait, viewportSize: CGSize(width:1080, height: 1920), zNear: 0.05, zFar: 100))
    }
}

public class RootVC: UIViewController {
    private var rendererVC: ViewController!
    private var arkitView: ARSCNView!
    private var cameraDelegate : CameraDelegate!

   public override func viewDidLoad() {
        super.viewDidLoad()

        arkitView = ARSCNView()
        arkitView.frame = view.frame
        view.addSubview(arkitView)

        if UIDevice.current.userInterfaceIdiom == .phone {
            rendererVC = ViewController(nibName: "ViewController_iPhone", bundle: nil)
        }
        else {
            rendererVC = ViewController(nibName: "ViewController_iPad", bundle: nil)
        }

        rendererVC.view.frame = view.frame
        view.addSubview(rendererVC.view)
        addChildViewController(rendererVC)


        cameraDelegate = CameraDelegate(renderer: rendererVC)
        arkitView.session.delegate = cameraDelegate
<commit_msg>Fix iPad and other size devices<commit_after>//
//  RootVC.swift
//  Internet Map
//
//  Created by <NAME> on 2017-11-16.
//  Copyright © 2017 Peer1. All rights reserved.
//

import UIKit
import ARKit

private class CameraDelegate: NSObject, ARSessionDelegate {
    let renderer: ViewController

    init(renderer: ViewController) {
        self.renderer = renderer
        super.init()
    }

    public func session(_ session: ARSession, didUpdate frame: ARFrame) {
        let orientation = UIApplication.shared.statusBarOrientation
        let view = renderer.view as! GLKView
        let size = CGSize(width: view.drawableWidth, height: view.drawableHeight)

        renderer.overrideCamera(frame.camera.viewMatrix(for: orientation), projection: frame.camera.projectionMatrix(for: orientation, viewportSize: size, zNear: 0.05, zFar: 100))
    }
}

public class RootVC: UIViewController {
    private var rendererVC: ViewController!
    private var arkitView: ARSCNView!
    private var cameraDelegate : CameraDelegate!

   public override func viewDidLoad() {
        super.viewDidLoad()

        arkitView = ARSCNView()
        arkitView.frame = view.frame
        view.addSubview(arkitView)

        if UIDevice.current.userInterfaceIdiom == .phone {
            rendererVC = ViewController(nibName: "ViewController_iPhone", bundle: nil)
        }
        else {
            rendererVC = ViewController(nibName: "ViewController_iPad", bundle: nil)
        }

        rendererVC.view.frame = view.frame
        view.addSubview(rendererVC.view)
        addChildViewController(rendererVC)


        cameraDelegate = CameraDelegate(renderer: rendererVC)
        arkitView.session.delegate = cameraDelegate

{'fraction_non_alphanumeric': 0.09014869888475836, 'fraction_numerical': 0.014250309789343246, 'mean_word_length': 3.021170610211706, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1726854', 'n_tokens_mistral': 979, 'n_tokens_neox': 915, 'n_words': 223}