Structure

SCNVector3

A representation of a three-component vector.

Declaration

struct SCNVector3

Overview

SceneKit uses three-component vectors for a variety of purposes, such as describing node or vertex positions, surface normals, and scale or translation transforms. The different vector components should be interpreted based on the context in which the vector is being used.

Topics

Components

var x: Float

The first component in the vector.

var y: Float

The second component in the vector.

var z: Float

The third component in the vector.

Converting Vector Types

func SCNVector3FromGLKVector3(GLKVector3) -> SCNVector3

Returns a three-element SceneKit vector structure corresponding to a GLKit vector structure.

func SCNVector3ToGLKVector3(SCNVector3) -> GLKVector3

Returns a three-element GLKit vector structure corresponding to a SceneKit vector structure.

Comparing Vectors

func SCNVector3EqualToVector3(SCNVector3, SCNVector3) -> Bool

Returns a Boolean value that indicates whether the corresponding components of two vectors are equal.

Zero Constant

let SCNVector3Zero: SCNVector3

The three-component vector whose every component is 0.0.

See Also

Vectors

struct SCNVector4

A representation of a four-component vector.