A representation of a four-component vector.
SDKs
- iOS 8.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Scene
Kit
Declaration
typedef struct SCNVector4 {
...
} SCNVector4;
Overview
SceneKit uses four-component vectors to represent multiple kinds of data:
Axis-angle rotation or torque. The
x
,y
, andz
fields contain the normalized x-, y-, and z-components of the rotation axis, and thew
field contains the rotation angle, in radians, or torque magnitude, in newton-meters.Color value (or range). The
x
,y
,z
, andw
fields contain the red, green, blue, and alpha components of the color, or the width of the color variation range in each component.
Important
In macOS, the x
, y
, z
and w
fields in this structure are CGFloat
values. In iOS, tvOS, and watchOS, these fields are float
values.