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.childNodes as SCNNodeMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An array of the node’s children in the scene graph hierarchy.

SCNNodeMBS.childNodeWithName(Name as String, recursively as Boolean = false) as SCNNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Returns the first node in the node’s child node subtree with the specified name.

name: The name of the node to search for.
recursively: True to search the entire child node subtree, or false to search only the node’s immediate children.

If the recursive parameter is true, SceneKit uses a preorder traversal to search the child node subtree—that is, the block searches a node before it searches each of the node’s children, and it searches all children of a node before searching any of that node’s sibling nodes. Otherwise, SceneKit searches only those nodes in the node’s childNodes array.

SCNNodeMBS.clearGeometry

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 22.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Clears geometry property.
Example
if MyScene <> nil then
// clear geometry for all nodes in this Scene
MyScene.rootNode.clearGeometry
end if

Recursively walks over child nodes to also clear geometry by assigning nil.
Calling this method can help to mitigate problems where textures would not unload properly due to bugs in SceneKit framework.

SCNNodeMBS.clone 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 a copy of the node and its children.

This method recursively copies the node and its child nodes. For a nonrecursive copy, use the inherited copy method, which creates a copy of the node without any child nodes.
Cloning or copying a node creates a duplicate of the node object, but not the geometries, lights, cameras, and other SceneKit objects attached to it—instead, each copied node shares references to these objects.

This behavior means that you can use cloning to, for example, place the same geometry at several locations within a scene without maintaining multiple copies of the geometry and its materials. However, it also means that changes to the objects attached to one node will affect other nodes that share the same attachments. For example, to render two copies of a node using different materials, you must copy both the node and its geometry before assigning a new material.

Multiple copies of an SCNGeometryMBS object efficiently share the same vertex data, so you can copy geometries without a significant performance penalty.

SCNNodeMBS.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
A 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.

SCNNodeMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates and returns a new node object.

See also:

SCNNodeMBS.Constructor(geometry as SCNGeometryMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates and returns a node object with the specified geometry attached.

geometry: The geometry to be attached.

Returns a new node object with the geometry attached, or nil if initialization is not successful.

See also:

SCNNodeMBS.convertPositionFromNode(position as SCNVector3MBS, node as SCNNodeMBS) as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a position to the node’s local coordinate space from that of another node.

position: A position in the local coordinate space defined by the other node.
node: Another node in the same scene graph as the node, or nil to convert from the scene’s world coordinate space.

Returns a position in the node’s local coordinate space.

SCNNodeMBS.convertPositionToNode(position as SCNVector3MBS, node as SCNNodeMBS) as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a position from the node’s local coordinate space to that of another node.

position: A position in the node’s local coordinate space.
node: Another node in the same scene graph as the node, or nil to convert to the scene’s world coordinate space.

Returns a position in the local coordinate space defined by the other node.

SCNNodeMBS.convertTransformFromNode(position as SCNMatrix4MBS, node as SCNNodeMBS) as SCNMatrix4MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a transform to the node’s local coordinate space from that of another node.

transform: A transform relative to the local coordinate space defined by the other node.
node: Another node in the same scene graph as the node, or nil to convert from the scene’s world coordinate space.

Returns a transform relative to the node’s coordinate space.

SCNNodeMBS.convertTransformToNode(position as SCNMatrix4MBS, node as SCNNodeMBS) as SCNMatrix4MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a transform from the node’s local coordinate space to that of another node.

transform: A transform relative to the node’s coordinate space.
node: Another node in the same scene graph as the node, or nil to convert to the scene’s world coordinate space.

Returns a transform relative to the local coordinate space defined by the other node.

SCNNodeMBS.convertVectorFromNode(position as SCNVector3MBS, node as SCNNodeMBS) as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a direction vector to the node’s local coordinate space from that of another node.

vector: A direction vector in the local coordinate space defined by the other node.
node: Another node in the same scene graph as the node, or nil to convert from the scene’s world coordinate space.

Returns a direction vector in the node’s local coordinate space.

Unlike the convertPositionFromNode method, this method ignores the translational aspect of both nodes' transforms. As such, this method is more appropriate for use with vectors that represent only directional information, such as velocity or facing.

SCNNodeMBS.convertVectorToNode(position as SCNVector3MBS, node as SCNNodeMBS) as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Converts a direction vector from the node’s local coordinate space to that of another node.

vector: A direction vector in the node’s local coordinate space.
node: Another node in the same scene graph as the node, or nil to convert to the scene’s world coordinate space.

Returns a direction vector in the local coordinate space defined by the other node.

Unlike the convertPositionToNode method, this method ignores the translational aspect of both nodes' transforms. As such, this method is more appropriate for use with vectors that represent only directional information, such as velocity or facing.

SCNNodeMBS.copy 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 a copy of the node.

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.removeAllActions

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Ends and removes all actions from the node.

When SceneKit removes an action from a node, it skips any remaining animation the action would perform. However, any changes the action has already made to the node’s state remain in effect.

SCNNodeMBS.removeAllAudioPlayers

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 22.3 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Removes all audio players attached to the node, stopping playback.

SCNNodeMBS.removeAudioPlayer(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
Removes the specified audio player from the node, stopping playback.

player: An audio player attached to the node.

This method has no effect if the player parameter does not reference an audio player directly attached to the node.

SCNNodeMBS.removeFromParentNode

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Removes the node from its parent’s array of child nodes.

Removing nodes from the node hierarchy serves two purposes. Nodes own their contents (child nodes or attached lights, geometries, and other objects), so deallocating unneeded nodes can reduce memory usage. Additionally, SceneKit does more work at rendering time with a large, complex node hierarchy, so removing nodes whose contents you don’t need to display can improve rendering performance.

SCNNodeMBS.replaceChildNode(oldNode as SCNNodeMBS, newNode as SCNNodeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Removes a child from the node’s array of children and inserts another node in its place.

oldNode: The existing child node to be replaced.
newNode: The node with which to replace the child node.

If both the oldNode and newNode nodes are children of the node, calling this method swaps their positions in the array. Note that removing a node from the node hierarchy may result in it being deallocated.
Calling this method results in undefined behavior if the child parameter does not refer to a child of this node.

SCNNodeMBS.rotateBy(worldRotation as SCNVector4MBS, 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 position and orientation, relative to its current transform, through a rotation around the specified point in scene space.

worldRotation: The axis and angle of rotation to apply, in scene space, expressed as a quaternion.
worldTarget: The center point, in scene space, about which to rotate.

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.runAction(action as SCNActionMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds an action to the list of actions executed by the node.

action: The action to be performed.

SceneKit begins running a newly added action when it prepares to render the next frame.

See also:

Some examples using this method:

SCNNodeMBS.runAction(action as SCNActionMBS, del as SCNNodeRunActionCompletedMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds an action to the list of actions executed by the node. SceneKit calls the specified block when the action completes.

action: The action to be performed.
del: The method that SceneKit calls when the action completes.
tag: The tag is passed through to delegate method.

The new action is processed the next time SceneKit prepares to render a frame.
SceneKit calls your method after the action’s duration is complete. For example, in a game you could use this method to show a Game Over message after performing a fade-out action on a node that displays a player character.

See also:

SCNNodeMBS.runAction(action as SCNActionMBS, key as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds an identifiable action to the list of actions executed by the node.

action: The action to be performed.
key: A unique key used to identify the action.

This method is identical to runAction, but the action is stored and identified so that you can retrieve or cancel it later. If an action using the same key is already running, SceneKit removes it before adding the new action.

See also:

SCNNodeMBS.runAction(action as SCNActionMBS, key as string, del as SCNNodeRunActionCompletedMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Adds an identifiable action to the list of actions executed by the node.

SceneKit calls the specified block when the action completes.

action: The action to be performed.
key: A unique key used to identify the action.
del: A completion block called when the action completes.
tag: The tag is passed through to delegate method.

This method is identical to runAction, but the action is stored and identified so that you can retrieve or cancel it later. If an action using the same key is already running, SceneKit removes it before adding the new action.
SceneKit calls your method after the action’s duration is complete. For example, you can use this method with a wait action to execute some code after a timed delay. If during the delay period you need to prevent the code from running, use the removeActionForKey method to cancel it.

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...