Class

SK3DNode

A node that renders a Scene Kit scene as a 2D image.

Overview

Use SK3DNode objects to incorporate Scene Kit content into a Sprite Kit-based game. When Sprite Kit renders the node, the Scene Kit scene is animated and rendered first. Then this rendered image is composited into the Sprite Kit scene.Use the scnScene property to specify the Scene Kit scene to be rendered.

Symbols

Creating a 3D Node

init(viewportSize: CGSize)

Initializes a new 3D node.

Configuring the 3D Node

var viewportSize: CGSize

The size of the image rendered by the node.

var scnScene: SCNScene?

The Scene Kit scene to render.

var pointOfView: SCNNode?

The Scene Kit node from which the scene’s contents are viewed when rendered.

var autoenablesDefaultLighting: Bool

A Boolean value that determines whether Scene Kit automatically adds lights to a scene.

Animating the 3D Node’s Content in Scene Kit

var isPlaying: Bool

A Boolean value that determines whether the scene is playing.

var loops: Bool

A Boolean value that determines whether Scene Kit restarts the scene time after all animations in the scene have played.

var sceneTime: TimeInterval

The current scene time.

Projecting and Hit Testing

func hitTest(CGPoint, options: [String : Any]? = nil)

Searches the Scene Kit scene for objects corresponding to a point in the rendered image.

func projectPoint(vector_float3)

Projects a point from the 3D world coordinate system of the Scene Kit scene to the 2D viewport coordinate system of the Sprite Kit node.

func unprojectPoint(vector_float3)

Unprojects a point from the Sprite Kit node’s 2D viewport coordinate system to the 3D world coordinate system of the Scene Kit scene.

Relationships

Inherits From

Conforms To