I read the Apple's documentation about both classes but I am not quite sure when and when not to use which one? Since SCNVector3's constructor(s) also accept same parameters and return the same thing that's so confusing to have a method named SCNVector3Make
SCNVector3Make is a convenience function, it is not a class.
SCNVector3 is a struct, not a class.
Either works if your x, y, and z values are Float.
let vector = SCNVector3(x, y, z)
or:
let vector = SCNVectorMake(x, y, z)
Both give you a SCNVector3 initialized with the 3 Float values.
If your values are other types (Int, Double, CGFloat), use the associated SCNVector3 initializer since SCNVector3Make only works with Float.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With