SceneKit SCNNode init(mdlObject:) missing?

[亡魂溺海] 提交于 2019-12-10 00:56:48

问题


I'm using Xcode 7.3.1, Swift 2.x, iOS target is 9.3. I can find convenience init init(MDLObject mdlObject: MDLObject) in Apple docs, but I don't see it in my project. I opened standard game project starter, SceneKit is imported. I've tried:

  • Double checking iOS version
  • Adding import ModelIO
  • Finding "mdlObject:" in header files in SceneKit.framework - not found
  • Looking for alternative methods (maybe Apple moved it somewhere) but there are no other inits with that parameter, no class function, nor I found any corresponding export function in MDLObject
  • Cleaning project...

I can see all SceneKit classes, and I can create MDLAsset (part of ModelIO, can return MDLObjects) instance. Any ideas, maybe I've overlooked something obvious?


回答1:


the following should do

import SceneKit.ModelIO


来源:https://stackoverflow.com/questions/39425510/scenekit-scnnode-initmdlobject-missing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!