SCNVector3

struct SCNVector3
  • SwifterSwift: Returns the absolute values of the vector’s components.

        SCNVector3(2, -3, -6).abs -> SCNVector3(2, 3, 6)
    

    Declaration

    Swift

    var absolute: SCNVector3 { get }
  • SwifterSwift: Returns the length of the vector.

        SCNVector3(2, 3, 6).length -> 7
    

    Declaration

    Swift

    var length: SceneKitFloat { get }
  • SwifterSwift: Add two SCNVector3s.

    SCNVector3(10, 10, 10) + SCNVector3(10, 20, -30) -> SCNVector3(20, 30, -20)
    

    Declaration

    Swift

    static func + (lhs: SCNVector3, rhs: SCNVector3) -> SCNVector3

    Parameters

    lhs

    SCNVector3 to add to.

    rhs

    SCNVector3 to add.

    Return Value

    result of addition of the two given SCNVector3s.

  • SwifterSwift: Add a SCNVector3 to self.

    SCNVector3(10, 10, 10) += SCNVector3(10, 20, -30) -> SCNVector3(20, 30, -20)
    

    Declaration

    Swift

    static func += (lhs: inout SCNVector3, rhs: SCNVector3)

    Parameters

    lhs

    self

    rhs

    SCNVector3 to add.

  • SwifterSwift: Subtract two SCNVector3s.

    SCNVector3(10, 10, 10) - SCNVector3(10, 20, -30) -> SCNVector3(0, -10, 40)
    

    Declaration

    Swift

    static func - (lhs: SCNVector3, rhs: SCNVector3) -> SCNVector3

    Parameters

    lhs

    SCNVector3 to subtract from.

    rhs

    SCNVector3 to subtract.

    Return Value

    result of subtract of the two given SCNVector3s.

  • SwifterSwift: Subtract a SCNVector3 from self.

    SCNVector3(10, 10, 10) -= SCNVector3(10, 20, -30) -> SCNVector3(0, -10, 40)
    

    Declaration

    Swift

    static func -= (lhs: inout SCNVector3, rhs: SCNVector3)

    Parameters

    lhs

    self

    rhs

    SCNVector3 to subtract.

  • SwifterSwift: Multiply a SCNVector3 with a scalar

    SCNVector3(10, 20, -30) * 3 -> SCNVector3(30, 60, -90)
    

    Declaration

    Swift

    static func * (vector: SCNVector3, scalar: SceneKitFloat) -> SCNVector3

    Parameters

    vector

    SCNVector3 to multiply.

    scalar

    scalar value.

    Return Value

    result of multiplication of the given SCNVector3 with the scalar.

  • SwifterSwift: Multiply self with a scalar

    SCNVector3(10, 20, -30) *= 3 -> SCNVector3(30, 60, -90)
    

    Declaration

    Swift

    static func *= (vector: inout SCNVector3, scalar: SceneKitFloat)

    Parameters

    vector

    self.

    scalar

    scalar value.

    Return Value

    result of multiplication of the given CGPoint with the scalar.

  • SwifterSwift: Multiply a scalar with a SCNVector3

    3 * SCNVector3(10, 20, -30) -> SCNVector3(30, 60, -90)
    

    Declaration

    Swift

    static func * (scalar: SceneKitFloat, vector: SCNVector3) -> SCNVector3

    Parameters

    scalar

    scalar value.

    vector

    SCNVector3 to multiply.

    Return Value

    result of multiplication of the given CGPoint with the scalar.