//
//  MyARView.swift
//  SwiftARKit
//
//  Created by Pierre FERREIRA on 11/06/2024.
//

import SwiftUI
import ARKit
import RealityKit

struct MyARViewRepresentable : UIViewRepresentable{
    
    public func makeUIView(context: Context) -> MyARView {
//        
//        let arView = MyARView(frame: .zero)
//        let mesh = MeshResource.generateBox(size: 0.1, cornerRadius: 0.005)
//
//        //let mesh = MeshResource.generateBox(width: 150, height: 500, depth: 50)
//        let material = SimpleMaterial(color: .red, isMetallic: true)
//        let model = ModelEntity(mesh: mesh, materials: [material]) //, materials: material
//        model.transform.translation.y = 0.05
//
//        let anchor = AnchorEntity(.plane(.horizontal, classification: .table, minimumBounds: .zero))
//
//        arView.scene.anchors.append(anchor)
//        return arView
//        
        return MyARView()
    }

    public func updateUIView(_ uiView: UIViewType, context: Context) { }
}
