Structure

SCNVector4

A representation of a four-component vector.

Overview

SceneKit uses four-component vectors to represent multiple kinds of data:

  • Axis-angle rotation or torque. The x, y, and z fields contain the normalized x-, y-, and z-components of the rotation axis, and the w field contains the rotation angle, in radians, or torque magnitude, in newton-meters.

  • Color value (or range). The x, y, z, and w fields contain the red, green, blue, and alpha components of the color, or the width of the color variation range in each component.

Topics

Components

x

The first component in the vector.

y

The second component in the vector.

z

The third component in the vector.

w

The fourth component in the vector.

Creating Vectors

SCNVector4Make

Returns a new four-component vector created from individual component values.

Converting Vector Types

SCNVector4FromGLKVector4

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

SCNVector4ToGLKVector4

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

Comparing Vectors

SCNVector4EqualToVector4

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

Zero Constant

SCNVector4Zero

The four-component vector whose every component is 0.0.

See Also

Vectors

SCNVector3

A representation of a three-component vector.