Platforms to show: All Mac Windows Linux Cross-Platform

SCNReplicatorConstraintMBS class

Superclass: SCNConstraintMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class SceneKit MBS Mac64bit Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A SCNReplicatorConstraint replicates the position/orientation/scale of a target node
Example
// This example needs a window with SCNControl1, a DesktopSCNControlMBS.
// a small box follows a moving sphere at a fixed offset
Var node As New SCNNodeMBS
Var leader As New SCNNodeMBS(New SCNSphereMBS(0.4))
leader.runAction SCNActionMBS.repeatActionForever(SCNActionMBS.sequence(Array(SCNActionMBS.moveBy(2, 0, 0, 1), SCNActionMBS.moveBy(-2, 0, 0, 1))))
node.addChildNode leader

Var follower As New SCNNodeMBS(New SCNBoxMBS(0.3, 0.3, 0.3, 0))
Var copyPosition As New SCNReplicatorConstraintMBS(leader)
copyPosition.positionOffset = New SCNVector3MBS(0, 1, 0) // one unit above
copyPosition.replicatesOrientation = False
Var constraints() As SCNConstraintMBS
constraints.Add copyPosition
follower.setConstraints constraints
node.addChildNode follower

Var scene As New SCNSceneMBS
scene.rootNode.addChildNode node


Var view As SCNViewMBS = SCNControl1.View
view.scene = scene
view.allowsCameraControl = True // rotate with the mouse
view.autoenablesDefaultLighting = True

Subclass of the SCNConstraintMBS class.

Superclass SCNConstraintMBS

This class has no subclasses.

Blog Entries

Release notes

Some related classes:


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


SCNPyramidMBS   -   SCNSceneMBS


The biggest plugin in space...