Hello, during the transplant from Objective-C to Swift, I was unable to convert the following substitution parts, so I asked you a question.
Source Code
let positionsArray: vector_float3 =_templeVertexPositions.contents()
Origin Code
vector_float3*positionsArray=(vector_float3*)_templeVertexPositions.contents;
Error Code
Cannot convert value of type 'UnsafeMutableRawPointer' to specified type 'vector_float3' (aka'SIMD3<Float>')
Transplanting code
https://developer.apple.com/documentation/metal/migrating_opengl_code_to_metal
vector_float3 is also having trouble converting.
I think I can do it by converting different types of arrays, but I can't solve it.
I look forward to working with you if there is any good way.
I solved myself!
let positionsArray: [vector_float3] = [vector_float3] (_impossibleCocoaArray:_templeVertexPositions)
*Additional note This one seems to be more correct
let positionsArray:UnsafeMutableRawPointer=_templeVertexPositions.contents()
© 2024 OneMinuteCode. All rights reserved.