Still no luck. For reference, this is my code so far:
import SwiftUI
import RealityKit
import RealityKitContent
import UIKit
struct RecordView: View {
@State private var rotateBy:Double = 0.0
let record: Record
var body: some View {
RealityView { content in
do {
let entity = try await Entity.init(named: "CDScene", in: realityKitContentBundle)
entity.generateCollisionShapes(recursive: false)
entity.components.set(InputTargetComponent())
entity.scale = SIMD3<Float>(repeating: 0.6)
content.add(entity)
} catch {
ProgressView()
}
}
.gesture(
DragGesture(minimumDistance: 0.0)
.targetedToAnyEntity()
.onChanged { value in
let location3d = value.convert(value.location3D, from: .local, to: .scene)
let startLocation = value.convert(value.startLocation3D, from: .local, to: .scene)
let delta = location3d - startLocation
rotateBy = Double(atan(delta.x * 200))
}
)
}
}
I have also tried to add collision support manually to the root of the scene in Reality Composer Pro, still nothing. For information, the scene only consists of a simple USDZ model that i have exported through Adobe Subtance Painter.