The apple documentation gives the declaration of SCNVector3 :
typedef struct SCNVector3 { CGFloat x, y , z; } SCNVector3;
Or whe
In the iOS 8.1 SDK headers, the SCNVectorX
types are based on Float
, as can be seen
by command-clicking on SCNVector3
:
struct SCNVector3 {
var x: Float
var y: Float
var z: Float
}
func SCNVector3Make(x: Float, y: Float, z: Float) -> SCNVector3
This is different from the OS X 10.10 SDK where CGFloat
is used. So the documentation
seems to be wrong. The following compiles in an iOS project:
func * (left: SCNVector3, right: Float) -> SCNVector3 {
return SCNVector3Make(left.x * right, left.y * right, left.z * right)
}