Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCNNodeMBS class.

SCNNodeMBS.addAudioPlayer(player as SCNAudioPlayerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 22.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds the specified auto player to the node and begins playback.

player: An audio player object.

Positional audio effects from a player attached to a node are based on that node’s position relative to the audioListener position in the scene.
After playback has completed, SceneKit automatically removes the audio player from the node.

You may need to have the scene/view in play mode to hear something.

SCNNodeMBS.addChildNode(node as SCNNodeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds a node to the node’s array of children.

child: The node to be added.

Calling this method appends the node to the end of the childNodes array.

Some examples using this method:

SCNNodeMBS.audioPlayers as SCNAudioPlayerMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 22.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The audio players currently attached to the node.

Positional audio effects from a player attached to a node are based on that node’s position relative to the audioListener position in the scene.
After an audio player completes playback, SceneKit automatically removes it from the node. Therefore, this array always contains audio players that are currently playing back audio.

SCNNodeMBS.flattenedClone as SCNNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates an optimized copy of the node and its children.

A new single node containing the combined geometries and materials of the node and its child node subtree.

Rendering complex node hierarchies can incur a performance cost. Each geometry and material requires a separate draw command to be sent to the GPU, and each draw command comes with a performance overhead. If you plan for a portion of your scene’s node hierarchy to remain static (with respect to itself, if not the rest of the scene), use this method to create a single node containing all elements of that node hierarchy that SceneKit can render using fewer draw commands.

SCNNodeMBS.hitTestWithSegment(PointA as SCNVector3MBS, PointB as SCNVector3MBS, Options as Dictionary = nil) as SCNHitTestResultMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Searches the node’s child node subtree for objects intersecting a line segment between two specified points.

pointA: An endpoint of the line segment to search along, specified in the node’s local coordinate system.
pointB: The other endpoint of the line segment to search along, specified in the node’s local coordinate system.
options: A dictionary of options affecting the search. See Key shared methods in SCNHitTestResultMBS class for acceptable values.

Returns an array of SCNHitTestResultMBS objects representing search results.

Hit-testing is the process of finding elements of a scene located along a specified line segment in the scene’s coordinate space (or that of a particular node in the scene). For example, you can use this method to determine whether a projectile launched by a game character will hit its target.

To search for the scene element corresponding to a two-dimensional point in the rendered image, use the renderer’s hitTest method instead.

SCNNodeMBS.insertChildNode(newNode as SCNNodeMBS, atIndex as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds a node to the node’s array of children at a specified index.

SCNNodeMBS.localRotateBy(rotation as SCNVector4MBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Changes the node's orientation relative to its current orientation.

rotation: The axis and angle of rotation to apply, in node-local space, expressed as a quaternion.

This method rotates the node according to its pivot transform.
The effects of this method are animatable; that is, calling this method during an implicit-animation transaction animates the rotation effect.

Available in macOS 10.13 or later.

SCNNodeMBS.localTranslateBy(translation as SCNVector3MBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Changes the node's position relative to its current position.

translation: The distance, in node-local space, by which to move the node.

The effects of this method are animatable; that is, calling this method during an implicit-animation transaction animates the move.

Available in macOS 10.13 or later.

SCNNodeMBS.lookAt(worldTarget as SCNVector3MBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Changes the node's orientation so that its local forward vector points toward the specified location.

worldTarget: The point, in world space, to face the node toward.

Using this method is equivalent to calling the other lookAt method and passing the node's worldUp and localFront vectors for the corresponding parameters.
The effects of this method are animatable; that is, calling this method during an implicit-animation transaction animates the rotation effect.

Available in macOS 10.13 or later.

See also:

SCNNodeMBS.lookAt(worldTarget as SCNVector3MBS, worldUp as SCNVector3MBS, localFront as SCNVector3MBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Changes the node's orientation so that the specified forward vector points toward the specified location.

worldTarget: The point, in world space, to face the node toward.
worldUp: The direction vector, in world space, that should appear as "up" from the rotated node's point of view.
localFront: The direction vector, in the node's local space, that should orient toward the target point.

The effects of this method are animatable; that is, calling this method during an implicit-animation transaction animates the rotation effect.

Available in macOS 10.13 or later.

See also:

SCNNodeMBS.setConstraints(constraints() as SCNConstraintMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Sets the list of constraints affecting the node’s transformation.

An array of constraint objects. Before rendering, SceneKit evaluates all constraints attached to a node hierarchy and adjusts node transformations appropriately.
Use the SCNLookAtConstraintMBS class to make a node always point toward another node even as both are moved, or the SCNTransformConstraintMBS class to apply arbitrary transformations at constraint evaluation time.

Some examples using this method:

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...