AppleSCNNode - UBogun/Xojo-iosLib GitHub Wiki
Inherits from AppleSCNObject
Memory leak check: not yet done.
Status: incomplete, NodeWithMDLObject constructor missing
An SCNNode object represents a portion of a scene graph. A node by itself has no visible content when the scene containing it is rendered—it represents only a position in space (and transformation of coordinate spaces) relative to its parent node. To construct a scene, you use a hierarchy of nodes to create its structure, then add lights, cameras, and geometry to nodes to create visible content.
SCNMaterialNode includes the SCNAnimatable Interface, which means you can use AppleCAAnimations to animate these properties. Convenience methods have not been introduced to this class. Please check out the Animate… methods of the AppleView class to get an idea of how to create own property animations for this class.
Constructors
Constructor(): Creates a node object.
Constructor (Geometry As AppleSCNGeometry): Creates a node object with the specified geometry attached.
Properties
ActionKeys As AppleArray Of CFStringRef: The list of keys for which the node has attached actions. (read-only)
AnimationKeys As AppleArray Of CFStringRef: An array containing the keys of all animations currently attached to the object. (read-only)
AudioPlayers As AppleArray of AppleSCNAudioPlayer: The audio players currently attached to the node. (read-only) Available in iOS 9.0 and later.
Camera As AppleSCNCamera: The camera attached to the node.
To use a camera for displaying a scene, set the the pointOfView property of the view (or layer or renderer) displaying the scene to the node containing the camera. A camera looks in the direction of the node’s negative z-axis, so you aim the camera by changing the position and orientation of the node containing it. You control geometric and optical parameters of the camera—projection, field of view, and depth of field—using the attached SCNCamera object.
CastsShadow As Boolean: Whether SceneKit renders the node’s contents into shadow maps.
CategoryBitMask As UInteger: A mask that defines which categories the node belongs to.
ChildNodes As AppleArray of AppleSCNNode: An array of the node’s children in the scene graph hierarchy. (read-only)
Constraints As AppleArray of AppleSCNConstraint: A list of constraints affecting the node’s transformation.
EulerAngles As SCNVector3: The node’s orientation, expressed as pitch, yaw, and roll angles, each in radians. Animatable.
Filters As AppleArray of AppleCIFilter: An array of Core Image filters to be applied to the rendered contents of the node.
Geometry As AppleSCNGeometry: The geometry attached to the node.
A node can have only one geometry attached to it. To combine geometries so they can be controlled or animated together, create a node with no geometry and add other nodes to it.
HasActions As Boolean: Whether the node is currently executing any actions. (read-only)
Hidden As Boolean: A Boolean value that determines the visibility of the node’s contents. Animatable.
Light As AppleSCNLight: The light attached to the node.
Morpher As AppleSCNMorpher: The morpher object responsible for blending the node’s geometry.
Name As Text: A name associated with the node.
Opacity As Double: The opacity value of the node. Animatable.
Orientation As SCNVector4: The node’s orientation, expressed as a quaternion. Animatable.
ParentNode As AppleSCNNode: The node’s parent in the scene graph hierarchy. (read-only)
ParticleSystems As AppleArray Of AppleSCNParticleSystem: The particle systems attached to the node. (read-only)
Paused As Boolean: Whether to run actions and animations attached to the node and its child nodes.
PhysicsBody As AppleSCNPhysicsBody: The physics body associated with the node.
PhysicsField As AppleSCNPhysicsField: The physics field associated with the node.
Pivot As SCNMatrix4: The pivot point for the node’s position, rotation, and scale. Animatable.
Position As SCNVector3: The translation applied to the node. Animatable.
RendererDelegate As AppleObject: An optional object responsible for rendering custom contents for the node using Metal or OpenGL.
RenderingOrder As Integer: The order the node’s content is drawn in relative to that of other nodes.
Rotation As AppleSCNVector4: The node’s orientation, expressed as a rotation angle about an axis. Animatable.
Scale As SCNVector3: The scale factor applied to the node. Animatable.
Skinner As AppleSCNSkinner: The skinner object responsible for skeletal animations of node’s contents.
Transform As SCNMatrix4: The transformation applied to the node relative to its parent. Animatable.
WorldTransform As SCNMatrix4: The world transform applied to the node. (read-only)
Methods
Action (Key As Text) As AppleSCNAction: Returns an action associated with a specific key.
AddAnimation (Animation As AppleCAAnimation, Key As Text): Adds an animation object for the specified key.
AddAudioPlayer (Player As AppleSCNAudioPlayer): Adds the specified auto player to the node and begins playback. Available in iOS 9.0 and later.
AddChildNode (Child As AppleSCNNode): Adds a node to the node’s array of children.
AddParticleSystem (ParticleSystem As AppleSCNParticleSystem): Attaches a particle system to the node.
Animation (Key as Text) As AppleCAAnimation: Returns the animation with the specified key.
AnimationPaused (Key As Text) As Boolean: Returns a Boolean value indicating whether the animation attached to the object with the specified key is paused.
BoundingBox (Byref Min As SCNVector3, Byref Max as SCNVector3) As Boolean: Gets the minimum and maximum corner points of the object’s bounding box. Returns True if the node has a valid volume.
BoundingSphereCenter (Byref Center As SCNVector3, Byref Radius as Double) As Boolean: Gets the center point and radius of the object’s bounding sphere. Returns True if the node has a valid volume.
ChildNode (Name As CFStringRef, opt. Recursively As Boolean = true) As AppleSCNNode: Returns the first node in the node’s child node subtree with the specified name. Will search the whole child node subtree if recursively is true.
ChildNodesPassingTest (Block As AppleBlock) As AppleArray Of AppleSCNNode: Returns all nodes in the node’s child node subtree that satisfy the test applied by a block. See the ChildNodeTestTemplate method for the block structure.
Clone() As AppleSCNNode: 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.
ConvertPositionFromNode (Position as SCNVector3, Node as AppleSCNNode) As SCNVector3: Converts a position to the node’s coordinate space from that defined by another node.
ConvertPositionToNode (Position as SCNVector3, Node as AppleSCNNode) As SCNVector3: Converts a position from the node’s coordinate space to that defined by another node.
ConvertTransformFromNode (Transform as SCNVector4, Node as AppleSCNNode) As SCNVector4: Converts a transformation to the node’s coordinate space from that defined by another node.
ConvertTransformToNode (Transform as SCNVector4, Node as AppleSCNNode) As SCNVector4: Converts a transformation from the node’s coordinate space to that defined by another node.
Copy() As AppleSCNNode: Creates a copy of the node without children.
EnumerateChildNodes (Block As AppleBlock): Executes the specified block for each of the node’s child and descendant nodes. See the ChildNodeEnumerationTemplate method for the block structure.
FlattenedClone() As AppleSCNNode: Creates an optimized copy of the node and its children.
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.
HitTest (PointA As SCNVector3, PointB As SCNVector3, Options As AppleSCNHitTestingDictionary = nil) As AppleArray of AppleSCNNode: Searches the node’s child node subtree for objects intersecting a line segment between two specified points. If you define no hit testing dictionary, a standard dictionary for the node will be created.
InsertChildNode (Child as AppleSCNNode, Index as UInteger): Adds a node to the node’s array of children at a specified index.
PauseAnimation (Key As Text): Pauses the animation attached to the object with the specified key.
PresentationNode() As AppleSCNNode: Returns a node object representing the state of the node as it currently appears onscreen.
RemoveAction (ActionKey As Text): Removes an action associated with a specific key.
RemoveAllActions(): Ends and removes all actions from the node.
RemoveAllAnimations(): Removes all the animations currently attached to the object.
RemoveAllAudioPlayers(): Removes all audio players attached to the node, stopping playback. Available in iOS 9.0 and later.
RemoveAllParticleSystems(): Removes any particle systems directly attached to the node.
RemoveAnimation (Key As Text, opt. FadeOutDuration As Double): Removes the animation attached to the object with the specified key. If you specify a FadeOutDuration, smoothly transitioning out of the animation’s effect.
RemoveAudioPlayer (Player As AppleSCNAudioPlayer): Removes the specified audio player from the node, stopping playback. Available in iOS 9.0 and later.
RemoveFromParentNode(): Removes the node from its parent’s array of child nodes.
RemoveParticleSystem (ParticleSystem As AppleSCNParticleSystem): Removes a particle system attached to the node.
ReplaceChildNode (OldChild as AppleSCNNode, NewChild as AppleSCNNode): Removes a child from the node’s array of children and inserts another node in its place.
ResumeAnimation (Key As Text): Resumes a previously paused animation attached to the object with the specified key.
RunAction (Action As AppleSCNAction): Adds an action to the list of actions executed by the node.
RunAction (Action As AppleSCNAction, Block As AppleBlock): Adds an action to the list of actions executed by the node. SceneKit calls the specified block when the action completes. This block takes and returns no values.
RunAction (Action As AppleSCNAction, Key As Text): Adds an identifiable action to the list of actions executed by the node.
RunAction (Action As AppleSCNAction, Key As Text, Block As AppleBlock): Adds an identifiable action to the list of actions executed by the node. SceneKit calls the specified block when the action completes.
SetBoundingBox (Min As SCNVector3, Max as SCNVector3): Sets the minimum and maximum corner points of the object’s bounding box.