【发布时间】:2014-07-29 07:10:29
【问题描述】:
我正在尝试使用 SCNGeometrySource 的 init(vertices: CMutablePointer<SCNVector3>, count: Int) 初始化程序,但我不知道如何制作 CMutablePointer<SCNVector3>。
在 Objective-C 中,我会使用 C 数组,但我不认为 Swift 中的 SCNVector3[] 是这样布局的。
【问题讨论】:
-
试试:
init(&vertices, yourCount). -
"'SCNVector3[]' 不是 '@lvalue $T1' 的子类型"
-
你的顶点是如何声明的?
-
let vertices: SCNVector3[] = [ ... ] -
知道了,我需要
var!谢谢!