如何从vector_float3中提取单个值

时间:2018-01-16 20:23:24

标签: ios scenekit arkit

ARKit ARFaceGeometry类有一个属性

@property (nonatomic, readonly) const vector_float3 *vertices NS_REFINED_FOR_SWIFT;

如何从vector_float3类型中提取包含3个浮点值的单个浮点值?

1 个答案:

答案 0 :(得分:0)

SCNVector3FromFloat3中有一个方法SceneKitTypes.h

vector_float3 vertex = anchor.geometry.vertices[i];
SCNVector3 vector3 = SCNVector3FromFloat3(vertex);
float x = vector3.x;