In the ARKit Placing Objects Demo, in the VirtualObject class, there is VirtualObjectDefinition function that looks for the models in the Models.scnassets folder and it also looks them up by their .scn extension. I'd like to know how to modify this call so it can look for more than just the .scn extension, but for .dae as well for example.
Here's the function:
init(definition: VirtualObjectDefinition) {
self.definition = definition
if let url = Bundle.main.url(forResource: "Models.scnassets/\(definition.modelName)/\(definition.modelName)", withExtension: "scn") {
super.init(url: url)!
} else {
fatalError("can't find expected virtual object bundle resources")
}
}
I'm guessing what needs to be modified is the withExtension component, but I'm not sure of the right format for adding multiple extensions.