#[repr(C)]pub struct SCNReferenceNode { /* private fields */ }SCNNode and SCNReferenceNode only.Expand description
Node that references an external file.
See also Apple’s documentation
Implementations§
Source§impl SCNReferenceNode
impl SCNReferenceNode
Sourcepub unsafe fn initWithURL(
this: Allocated<Self>,
reference_url: &NSURL,
) -> Option<Retained<Self>>
pub unsafe fn initWithURL( this: Allocated<Self>, reference_url: &NSURL, ) -> Option<Retained<Self>>
Creates a reference node with a url.
Sourcepub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>
pub unsafe fn initWithCoder( this: Allocated<Self>, a_decoder: &NSCoder, ) -> Option<Retained<Self>>
Support coding and decoding via NSKeyedArchiver.
Sourcepub unsafe fn referenceNodeWithURL(
reference_url: &NSURL,
) -> Option<Retained<Self>>
pub unsafe fn referenceNodeWithURL( reference_url: &NSURL, ) -> Option<Retained<Self>>
Creates a reference node with a url.
Sourcepub unsafe fn referenceURL(&self) -> Retained<NSURL>
pub unsafe fn referenceURL(&self) -> Retained<NSURL>
Specifies the url to resolve.
Sourcepub unsafe fn setReferenceURL(&self, reference_url: &NSURL)
pub unsafe fn setReferenceURL(&self, reference_url: &NSURL)
Setter for referenceURL.
Sourcepub unsafe fn loadingPolicy(&self) -> SCNReferenceLoadingPolicy
pub unsafe fn loadingPolicy(&self) -> SCNReferenceLoadingPolicy
Specifies when to load the reference. see SCNReferenceLoadingPolicy above. Defaults to SCNReferenceLoadingPolicyImmediately.
Sourcepub unsafe fn setLoadingPolicy(&self, loading_policy: SCNReferenceLoadingPolicy)
pub unsafe fn setLoadingPolicy(&self, loading_policy: SCNReferenceLoadingPolicy)
Setter for loadingPolicy.
Source§impl SCNReferenceNode
Methods declared on superclass SCNNode.
impl SCNReferenceNode
Methods declared on superclass SCNNode.
Methods from Deref<Target = SCNNode>§
Sourcepub unsafe fn addAudioPlayer(&self, player: &SCNAudioPlayer)
Available on crate feature SCNAudioSource only.
pub unsafe fn addAudioPlayer(&self, player: &SCNAudioPlayer)
SCNAudioSource only.Add an audio player to the node and starts playing it right away.
Sourcepub unsafe fn removeAllAudioPlayers(&self)
Available on crate feature SCNAudioSource only.
pub unsafe fn removeAllAudioPlayers(&self)
SCNAudioSource only.Remove all audio players from this node and stop playing them.
Sourcepub unsafe fn removeAudioPlayer(&self, player: &SCNAudioPlayer)
Available on crate feature SCNAudioSource only.
pub unsafe fn removeAudioPlayer(&self, player: &SCNAudioPlayer)
SCNAudioSource only.Remove the given audio player from this node and stop playing it.
Sourcepub unsafe fn audioPlayers(&self) -> Retained<NSArray<SCNAudioPlayer>>
Available on crate feature SCNAudioSource only.
pub unsafe fn audioPlayers(&self) -> Retained<NSArray<SCNAudioPlayer>>
SCNAudioSource only.Get an array with all the audio players connected and playing on this node.
Sourcepub unsafe fn clone(&self) -> Retained<Self>
pub unsafe fn clone(&self) -> Retained<Self>
Returns a copy of the receiver. The returned instance is autoreleased.
The copy is recursive: every child node will be cloned, too. For a non-recursive copy, use copy instead. The copied nodes will share their attached objects (light, geometry, camera, …) with the original instances; if you want, for example, to change the materials of the copy independently of the original object, you’ll have to copy the geometry of the node separately.
pub unsafe fn flattenedClone(&self) -> Retained<Self>
Sourcepub unsafe fn light(&self) -> Option<Retained<SCNLight>>
Available on crate feature SCNLight only.
pub unsafe fn light(&self) -> Option<Retained<SCNLight>>
SCNLight only.Determines the light attached to the receiver.
Sourcepub unsafe fn setLight(&self, light: Option<&SCNLight>)
Available on crate feature SCNLight only.
pub unsafe fn setLight(&self, light: Option<&SCNLight>)
SCNLight only.Setter for light.
Sourcepub unsafe fn camera(&self) -> Option<Retained<SCNCamera>>
Available on crate feature SCNCamera only.
pub unsafe fn camera(&self) -> Option<Retained<SCNCamera>>
SCNCamera only.Determines the camera attached to the receiver.
Sourcepub unsafe fn setCamera(&self, camera: Option<&SCNCamera>)
Available on crate feature SCNCamera only.
pub unsafe fn setCamera(&self, camera: Option<&SCNCamera>)
SCNCamera only.Setter for camera.
Sourcepub unsafe fn geometry(&self) -> Option<Retained<SCNGeometry>>
Available on crate feature SCNGeometry only.
pub unsafe fn geometry(&self) -> Option<Retained<SCNGeometry>>
SCNGeometry only.Returns the geometry attached to the receiver.
Sourcepub unsafe fn setGeometry(&self, geometry: Option<&SCNGeometry>)
Available on crate feature SCNGeometry only.
pub unsafe fn setGeometry(&self, geometry: Option<&SCNGeometry>)
SCNGeometry only.Setter for geometry.
Sourcepub unsafe fn skinner(&self) -> Option<Retained<SCNSkinner>>
Available on crate feature SCNSkinner only.
pub unsafe fn skinner(&self) -> Option<Retained<SCNSkinner>>
SCNSkinner only.Returns the skinner attached to the receiver.
Sourcepub unsafe fn setSkinner(&self, skinner: Option<&SCNSkinner>)
Available on crate feature SCNSkinner only.
pub unsafe fn setSkinner(&self, skinner: Option<&SCNSkinner>)
SCNSkinner only.Setter for skinner.
Sourcepub unsafe fn morpher(&self) -> Option<Retained<SCNMorpher>>
Available on crate feature SCNMorpher only.
pub unsafe fn morpher(&self) -> Option<Retained<SCNMorpher>>
SCNMorpher only.Returns the morpher attached to the receiver.
Sourcepub unsafe fn setMorpher(&self, morpher: Option<&SCNMorpher>)
Available on crate feature SCNMorpher only.
pub unsafe fn setMorpher(&self, morpher: Option<&SCNMorpher>)
SCNMorpher only.Setter for morpher.
Sourcepub unsafe fn transform(&self) -> SCNMatrix4
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn transform(&self) -> SCNMatrix4
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Determines the receiver’s transform. Animatable.
The transform is the combination of the position, rotation and scale defined below. So when the transform is set, the receiver’s position, rotation and scale are changed to match the new transform.
Sourcepub unsafe fn setTransform(&self, transform: SCNMatrix4)
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn setTransform(&self, transform: SCNMatrix4)
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Setter for transform.
Sourcepub unsafe fn worldTransform(&self) -> SCNMatrix4
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn worldTransform(&self) -> SCNMatrix4
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Determines the receiver’s transform in world space (relative to the scene’s root node). Animatable.
pub unsafe fn setWorldTransform(&self, world_transform: SCNMatrix4)
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Sourcepub unsafe fn position(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn position(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s position. Animatable.
Sourcepub unsafe fn setPosition(&self, position: SCNVector3)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setPosition(&self, position: SCNVector3)
SceneKitTypes and objc2-core-foundation only.Setter for position.
Sourcepub unsafe fn worldPosition(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn worldPosition(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s position in world space (relative to the scene’s root node).
Sourcepub unsafe fn setWorldPosition(&self, world_position: SCNVector3)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setWorldPosition(&self, world_position: SCNVector3)
SceneKitTypes and objc2-core-foundation only.Setter for worldPosition.
Sourcepub unsafe fn rotation(&self) -> SCNVector4
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn rotation(&self) -> SCNVector4
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s rotation. Animatable.
The rotation is axis angle rotation. The three first components are the axis, the fourth one is the rotation (in radian).
Sourcepub unsafe fn setRotation(&self, rotation: SCNVector4)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setRotation(&self, rotation: SCNVector4)
SceneKitTypes and objc2-core-foundation only.Setter for rotation.
Sourcepub unsafe fn orientation(&self) -> SCNQuaternion
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn orientation(&self) -> SCNQuaternion
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s orientation as a unit quaternion. Animatable.
Sourcepub unsafe fn setOrientation(&self, orientation: SCNQuaternion)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setOrientation(&self, orientation: SCNQuaternion)
SceneKitTypes and objc2-core-foundation only.Setter for orientation.
Sourcepub unsafe fn worldOrientation(&self) -> SCNQuaternion
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn worldOrientation(&self) -> SCNQuaternion
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s orientation in world space (relative to the scene’s root node). Animatable.
Sourcepub unsafe fn setWorldOrientation(&self, world_orientation: SCNQuaternion)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setWorldOrientation(&self, world_orientation: SCNQuaternion)
SceneKitTypes and objc2-core-foundation only.Setter for worldOrientation.
Sourcepub unsafe fn eulerAngles(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn eulerAngles(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s euler angles. Animatable.
The order of components in this vector matches the axes of rotation:
- Pitch (the x component) is the rotation about the node’s x-axis (in radians)
- Yaw (the y component) is the rotation about the node’s y-axis (in radians)
- Roll (the z component) is the rotation about the node’s z-axis (in radians) SceneKit applies these rotations in the reverse order of the components:
- first roll
- then yaw
- then pitch
Sourcepub unsafe fn setEulerAngles(&self, euler_angles: SCNVector3)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setEulerAngles(&self, euler_angles: SCNVector3)
SceneKitTypes and objc2-core-foundation only.Setter for eulerAngles.
Sourcepub unsafe fn scale(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn scale(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Determines the receiver’s scale. Animatable.
Sourcepub unsafe fn setScale(&self, scale: SCNVector3)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn setScale(&self, scale: SCNVector3)
SceneKitTypes and objc2-core-foundation only.Setter for scale.
Sourcepub unsafe fn pivot(&self) -> SCNMatrix4
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn pivot(&self) -> SCNMatrix4
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Determines the receiver’s pivot. Animatable.
Sourcepub unsafe fn setPivot(&self, pivot: SCNMatrix4)
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn setPivot(&self, pivot: SCNMatrix4)
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Setter for pivot.
Sourcepub unsafe fn isHidden(&self) -> bool
pub unsafe fn isHidden(&self) -> bool
Determines whether the receiver is displayed. Defaults to NO. Animatable.
Sourcepub unsafe fn opacity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn opacity(&self) -> CGFloat
objc2-core-foundation only.Determines the opacity of the receiver. Default is 1. Animatable.
Sourcepub unsafe fn setOpacity(&self, opacity: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setOpacity(&self, opacity: CGFloat)
objc2-core-foundation only.Setter for opacity.
Sourcepub unsafe fn renderingOrder(&self) -> NSInteger
pub unsafe fn renderingOrder(&self) -> NSInteger
Determines the rendering order of the receiver.
Nodes with greater rendering orders are rendered last. Defaults to 0.
Sourcepub unsafe fn setRenderingOrder(&self, rendering_order: NSInteger)
pub unsafe fn setRenderingOrder(&self, rendering_order: NSInteger)
Setter for renderingOrder.
Sourcepub unsafe fn castsShadow(&self) -> bool
pub unsafe fn castsShadow(&self) -> bool
Determines if the node is rendered in shadow maps. Defaults to YES.
Sourcepub unsafe fn setCastsShadow(&self, casts_shadow: bool)
pub unsafe fn setCastsShadow(&self, casts_shadow: bool)
Setter for castsShadow.
Sourcepub unsafe fn movabilityHint(&self) -> SCNMovabilityHint
pub unsafe fn movabilityHint(&self) -> SCNMovabilityHint
Communicates to SceneKit’s rendering system about how you want to move content in your scene; it does not affect your ability to change the node’s position or add animations or physics to the node. Defaults to SCNMovabilityHintFixed.
Sourcepub unsafe fn setMovabilityHint(&self, movability_hint: SCNMovabilityHint)
pub unsafe fn setMovabilityHint(&self, movability_hint: SCNMovabilityHint)
Setter for movabilityHint.
Sourcepub unsafe fn parentNode(&self) -> Option<Retained<SCNNode>>
pub unsafe fn parentNode(&self) -> Option<Retained<SCNNode>>
Returns the parent node of the receiver.
Sourcepub unsafe fn childNodes(&self) -> Retained<NSArray<SCNNode>>
pub unsafe fn childNodes(&self) -> Retained<NSArray<SCNNode>>
Returns the child node array of the receiver.
Sourcepub unsafe fn addChildNode(&self, child: &SCNNode)
pub unsafe fn addChildNode(&self, child: &SCNNode)
Appends the node to the receiver’s childNodes array.
Parameter child: The node to be added to the receiver’s childNodes array.
Sourcepub unsafe fn insertChildNode_atIndex(&self, child: &SCNNode, index: NSUInteger)
pub unsafe fn insertChildNode_atIndex(&self, child: &SCNNode, index: NSUInteger)
Insert a node in the childNodes array at the specified index.
Parameter child: The node to insert.
Parameter index: Index in the childNodes array to insert the node.
Sourcepub unsafe fn removeFromParentNode(&self)
pub unsafe fn removeFromParentNode(&self)
Removes the node from the childNodes array of the receiver’s parentNode.
Sourcepub unsafe fn replaceChildNode_with(
&self,
old_child: &SCNNode,
new_child: &SCNNode,
)
pub unsafe fn replaceChildNode_with( &self, old_child: &SCNNode, new_child: &SCNNode, )
Remove `child’ from the childNode array of the receiver and insert ‘child2’ if non-nil in its position.
If the parentNode of `child’ is not the receiver, the behavior is undefined.
Parameter oldChild: The node to replace in the childNodes array.
Parameter newChild: The new node that will replace the previous one.
Sourcepub unsafe fn childNodeWithName_recursively(
&self,
name: &NSString,
recursively: bool,
) -> Option<Retained<SCNNode>>
pub unsafe fn childNodeWithName_recursively( &self, name: &NSString, recursively: bool, ) -> Option<Retained<SCNNode>>
Returns the first node found in the node tree with the specified name.
The search uses a pre-order tree traversal.
Parameter name: The name of the node you are searching for.
Parameter recursively: Set to YES if you want the search to look through the sub-nodes recursively.
Sourcepub unsafe fn childNodesPassingTest(
&self,
predicate: &Block<dyn Fn(NonNull<SCNNode>, NonNull<Bool>) -> Bool + '_>,
) -> Retained<NSArray<SCNNode>>
Available on crate feature block2 only.
pub unsafe fn childNodesPassingTest( &self, predicate: &Block<dyn Fn(NonNull<SCNNode>, NonNull<Bool>) -> Bool + '_>, ) -> Retained<NSArray<SCNNode>>
block2 only.Returns the child nodes of the receiver that passes a test in a given Block.
The search is recursive and uses a pre-order tree traversal.
Parameter predicate: The block to apply to child nodes of the receiver. The block takes two arguments: “child” is a child node and “stop” is a reference to a Boolean value. The block can set the value to YES to stop further processing of the node hierarchy. The stop argument is an out-only argument. You should only ever set this Boolean to YES within the Block. The Block returns a Boolean value that indicates whether “child” passed the test.
Sourcepub unsafe fn enumerateChildNodesUsingBlock(
&self,
block: &Block<dyn Fn(NonNull<SCNNode>, NonNull<Bool>) + '_>,
)
Available on crate feature block2 only.
pub unsafe fn enumerateChildNodesUsingBlock( &self, block: &Block<dyn Fn(NonNull<SCNNode>, NonNull<Bool>) + '_>, )
block2 only.Executes a given block on each child node under the receiver.
The search is recursive and uses a pre-order tree traversal.
Parameter block: The block to apply to child nodes of the receiver. The block takes two arguments: “child” is a child node and “stop” is a reference to a Boolean value. The block can set the value to YES to stop further processing of the node hierarchy. The stop argument is an out-only argument. You should only ever set this Boolean to YES within the Block.
Sourcepub unsafe fn enumerateHierarchyUsingBlock(
&self,
block: &Block<dyn Fn(NonNull<SCNNode>, NonNull<Bool>) + '_>,
)
Available on crate feature block2 only.
pub unsafe fn enumerateHierarchyUsingBlock( &self, block: &Block<dyn Fn(NonNull<SCNNode>, NonNull<Bool>) + '_>, )
block2 only.Executes a given block on the receiver and its child nodes.
The search is recursive and uses a pre-order tree traversal.
Parameter block: The block to apply to the receiver and its child nodes. The block takes two arguments: “node” is a node in the hierarchy of the receiver (including the receiver) and “stop” is a reference to a Boolean value. The block can set the value to YES to stop further processing of the node hierarchy. The stop argument is an out-only argument. You should only ever set this Boolean to YES within the Block.
Sourcepub unsafe fn convertPosition_toNode(
&self,
position: SCNVector3,
node: Option<&SCNNode>,
) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn convertPosition_toNode( &self, position: SCNVector3, node: Option<&SCNNode>, ) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Converts a position from the receiver’s coordinate system to that of the specified node.
Parameter position: A position specified in the local coordinate system of the receiver.
Parameter node: The node into whose coordinate system “position” is to be converted. If “node” is nil, this method instead converts to world coordinates.
Sourcepub unsafe fn convertPosition_fromNode(
&self,
position: SCNVector3,
node: Option<&SCNNode>,
) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn convertPosition_fromNode( &self, position: SCNVector3, node: Option<&SCNNode>, ) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Converts a position from the coordinate system of a given node to that of the receiver.
Parameter position: A position specified in the local coordinate system of “node”.
Parameter node: The node from whose coordinate system “position” is to be converted. If “node” is nil, this method instead converts from world coordinates.
Sourcepub unsafe fn convertVector_toNode(
&self,
vector: SCNVector3,
node: Option<&SCNNode>,
) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn convertVector_toNode( &self, vector: SCNVector3, node: Option<&SCNNode>, ) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Converts a vector from the coordinate system of a given node to that of the receiver.
Parameter vector: A vector specified in the local coordinate system the receiver.
Parameter node: The node defining the space from which the vector should be transformed. If “node” is nil, this method instead converts from world coordinates.
Returns: vector transformed from receiver local space to node local space.
Sourcepub unsafe fn convertVector_fromNode(
&self,
vector: SCNVector3,
node: Option<&SCNNode>,
) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn convertVector_fromNode( &self, vector: SCNVector3, node: Option<&SCNNode>, ) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Converts a vector from the coordinate system of a given node to that of the receiver.
Parameter vector: A vector specified in the local coordinate system of “node”.
Parameter node: The node defining the space to which the vector should be transformed to. If “node” is nil, this method instead converts from world coordinates.
Returns: vector transformed from node space to reveiver local space.
Sourcepub unsafe fn convertTransform_toNode(
&self,
transform: SCNMatrix4,
node: Option<&SCNNode>,
) -> SCNMatrix4
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn convertTransform_toNode( &self, transform: SCNMatrix4, node: Option<&SCNNode>, ) -> SCNMatrix4
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Converts a transform from the receiver’s coordinate system to that of the specified node.
Parameter transform: A transform specified in the local coordinate system of the receiver.
Parameter node: The node into whose coordinate system “transform” is to be converted. If “node” is nil, this method instead converts to world coordinates.
Sourcepub unsafe fn convertTransform_fromNode(
&self,
transform: SCNMatrix4,
node: Option<&SCNNode>,
) -> SCNMatrix4
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn convertTransform_fromNode( &self, transform: SCNMatrix4, node: Option<&SCNNode>, ) -> SCNMatrix4
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Converts a transform from the coordinate system of a given node to that of the receiver.
Parameter transform: A transform specified in the local coordinate system of “node”.
Parameter node: The node from whose coordinate system “transform” is to be converted. If “node” is nil, this method instead converts from world coordinates.
Sourcepub unsafe fn physicsBody(&self) -> Option<Retained<SCNPhysicsBody>>
Available on crate feature SCNPhysicsBody only.
pub unsafe fn physicsBody(&self) -> Option<Retained<SCNPhysicsBody>>
SCNPhysicsBody only.The description of the physics body of the receiver.
Default is nil.
Sourcepub unsafe fn setPhysicsBody(&self, physics_body: Option<&SCNPhysicsBody>)
Available on crate feature SCNPhysicsBody only.
pub unsafe fn setPhysicsBody(&self, physics_body: Option<&SCNPhysicsBody>)
SCNPhysicsBody only.Setter for physicsBody.
Sourcepub unsafe fn physicsField(&self) -> Option<Retained<SCNPhysicsField>>
Available on crate feature SCNPhysicsField only.
pub unsafe fn physicsField(&self) -> Option<Retained<SCNPhysicsField>>
SCNPhysicsField only.The description of the physics field of the receiver.
Default is nil.
Sourcepub unsafe fn setPhysicsField(&self, physics_field: Option<&SCNPhysicsField>)
Available on crate feature SCNPhysicsField only.
pub unsafe fn setPhysicsField(&self, physics_field: Option<&SCNPhysicsField>)
SCNPhysicsField only.Setter for physicsField.
Sourcepub unsafe fn constraints(&self) -> Option<Retained<NSArray<SCNConstraint>>>
Available on crate feature SCNConstraint only.
pub unsafe fn constraints(&self) -> Option<Retained<NSArray<SCNConstraint>>>
SCNConstraint only.An array of SCNConstraint that are applied to the receiver.
Adding or removing a constraint can be implicitly animated based on the current transaction.
Sourcepub unsafe fn setConstraints(
&self,
constraints: Option<&NSArray<SCNConstraint>>,
)
Available on crate feature SCNConstraint only.
pub unsafe fn setConstraints( &self, constraints: Option<&NSArray<SCNConstraint>>, )
SCNConstraint only.Setter for constraints.
Sourcepub unsafe fn filters(&self) -> Option<Retained<NSArray<CIFilter>>>
Available on crate feature objc2-core-image and non-watchOS only.
pub unsafe fn filters(&self) -> Option<Retained<NSArray<CIFilter>>>
objc2-core-image and non-watchOS only.An array of Core Image filters that are applied to the rendering of the receiver and its child nodes. Animatable.
Defaults to nil. Filter properties should be modified by calling setValue:forKeyPath: on each node that the filter is attached to. If the inputs of the filter are modified directly after the filter is attached to a node, the behavior is undefined.
Sourcepub unsafe fn setFilters(&self, filters: Option<&NSArray<CIFilter>>)
Available on crate feature objc2-core-image and non-watchOS only.
pub unsafe fn setFilters(&self, filters: Option<&NSArray<CIFilter>>)
objc2-core-image and non-watchOS only.Setter for filters.
Sourcepub unsafe fn presentationNode(&self) -> Retained<SCNNode>
pub unsafe fn presentationNode(&self) -> Retained<SCNNode>
Returns the presentation node.
Returns a copy of the node containing all the properties as they were at the start of the current transaction, with any active animations applied. This gives a close approximation to the version of the node that is currently displayed. The effect of attempting to modify the returned node in any way is undefined. The returned node has no parent and no child nodes.
Sourcepub unsafe fn isPaused(&self) -> bool
pub unsafe fn isPaused(&self) -> bool
Controls whether or not the node’s actions and animations are updated or paused. Defaults to NO.
Sourcepub unsafe fn rendererDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn SCNNodeRendererDelegate>>>
pub unsafe fn rendererDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn SCNNodeRendererDelegate>>>
Specifies the receiver’s renderer delegate object.
Setting a renderer delegate prevents the SceneKit renderer from drawing the node and lets you use custom OpenGL code instead. The preferred way to customize the rendering is to tweak the material properties of the different materials of the node’s geometry. SCNMaterial conforms to the SCNShadable protocol and allows for more advanced rendering using GLSL. You would typically use a renderer delegate with a node that has no geometry and only serves as a location in space. An example would be attaching a particle system to that node and render it with custom OpenGL code.
Sourcepub unsafe fn setRendererDelegate(
&self,
renderer_delegate: Option<&ProtocolObject<dyn SCNNodeRendererDelegate>>,
)
pub unsafe fn setRendererDelegate( &self, renderer_delegate: Option<&ProtocolObject<dyn SCNNodeRendererDelegate>>, )
Setter for rendererDelegate.
Sourcepub unsafe fn hitTestWithSegmentFromPoint_toPoint_options(
&self,
point_a: SCNVector3,
point_b: SCNVector3,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<NSArray<SCNHitTestResult>>
Available on crate features SCNHitTest and SceneKitTypes and objc2-core-foundation only.
pub unsafe fn hitTestWithSegmentFromPoint_toPoint_options( &self, point_a: SCNVector3, point_b: SCNVector3, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<NSArray<SCNHitTestResult>>
SCNHitTest and SceneKitTypes and objc2-core-foundation only.Returns an array of SCNHitTestResult for each node in the receiver’s sub tree that intersects the specified segment.
Parameter pointA: The first point of the segment relative to the receiver.
Parameter pointB: The second point of the segment relative to the receiver.
Parameter options: Optional parameters (see the “Hit test options” section in SCNSceneRenderer.h for the available options).
See SCNSceneRenderer.h for a screen-space hit testing method.
Sourcepub unsafe fn categoryBitMask(&self) -> NSUInteger
pub unsafe fn categoryBitMask(&self) -> NSUInteger
Defines what logical ‘categories’ the receiver belongs too. Defaults to 1.
Categories can be used to
- exclude nodes from the influence of a given light (see SCNLight.categoryBitMask)
- include/exclude nodes from render passes (see SCNTechnique.h)
- specify which nodes to use when hit-testing (see SCNHitTestOptionCategoryBitMask)
Sourcepub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger)
pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger)
Setter for categoryBitMask.
Sourcepub unsafe fn worldUp(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn worldUp(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.The local unit Y axis (0, 1, 0) in world space.
Sourcepub unsafe fn worldRight(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn worldRight(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.The local unit X axis (1, 0, 0) in world space.
Sourcepub unsafe fn worldFront(&self) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn worldFront(&self) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.The local unit -Z axis (0, 0, -1) in world space.
Sourcepub unsafe fn lookAt(&self, world_target: SCNVector3)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn lookAt(&self, world_target: SCNVector3)
SceneKitTypes and objc2-core-foundation only.Convenience for calling lookAt:up:localFront: with worldUp set to self.worldUp
and localFront [SCNNode localFront].
Parameter worldTarget: target position in world space.
Sourcepub unsafe fn lookAt_up_localFront(
&self,
world_target: SCNVector3,
world_up: SCNVector3,
local_front: SCNVector3,
)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn lookAt_up_localFront( &self, world_target: SCNVector3, world_up: SCNVector3, local_front: SCNVector3, )
SceneKitTypes and objc2-core-foundation only.Set the orientation of the node so its front vector is pointing toward a given target. Using a reference up vector in world space and a front vector in local space.
Parameter worldTarget: position in world space.
Parameter worldUp: the up vector in world space.
Parameter localFront: the front vector in local space.
Sourcepub unsafe fn localTranslateBy(&self, translation: SCNVector3)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn localTranslateBy(&self, translation: SCNVector3)
SceneKitTypes and objc2-core-foundation only.Translate the current node position along the given vector in local space.
Parameter translation: the translation in local space.
Sourcepub unsafe fn localRotateBy(&self, rotation: SCNQuaternion)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn localRotateBy(&self, rotation: SCNQuaternion)
SceneKitTypes and objc2-core-foundation only.Apply a the given rotation to the current one.
Parameter rotation: rotation in local space.
Sourcepub unsafe fn rotateBy_aroundTarget(
&self,
world_rotation: SCNQuaternion,
world_target: SCNVector3,
)
Available on crate features SceneKitTypes and objc2-core-foundation only.
pub unsafe fn rotateBy_aroundTarget( &self, world_rotation: SCNQuaternion, world_target: SCNVector3, )
SceneKitTypes and objc2-core-foundation only.Apply a rotation relative to a target point in parent space.
Parameter worldRotation: rotation to apply in world space.
Parameter worldTarget: position of the target in world space.
Sourcepub unsafe fn focusBehavior(&self) -> SCNNodeFocusBehavior
pub unsafe fn focusBehavior(&self) -> SCNNodeFocusBehavior
Controls the behavior of the receiver regarding the UIFocus system. Defaults to SCNNodeFocusBehaviorNone.
Sourcepub unsafe fn setFocusBehavior(&self, focus_behavior: SCNNodeFocusBehavior)
pub unsafe fn setFocusBehavior(&self, focus_behavior: SCNNodeFocusBehavior)
Setter for focusBehavior.
pub unsafe fn addParticleSystem(&self, system: &SCNParticleSystem)
SCNParticleSystem only.pub unsafe fn removeAllParticleSystems(&self)
SCNParticleSystem only.pub unsafe fn removeParticleSystem(&self, system: &SCNParticleSystem)
SCNParticleSystem only.pub unsafe fn particleSystems( &self, ) -> Option<Retained<NSArray<SCNParticleSystem>>>
SCNParticleSystem only.Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject has the precise class NSObject.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.Use Ivar::load instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Attempt to downcast the object to a class of type T.
This is the reference-variant. Use Retained::downcast if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString to a NSMutableString,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass: for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject.
§Panics
This works internally by calling isKindOfClass:. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject and
NSProxy implement this method.
§Examples
Cast an NSString back and forth from NSObject.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();Try (and fail) to cast an NSObject to an NSString.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}Trait Implementations§
Source§impl AsRef<AnyObject> for SCNReferenceNode
impl AsRef<AnyObject> for SCNReferenceNode
Source§impl AsRef<NSObject> for SCNReferenceNode
impl AsRef<NSObject> for SCNReferenceNode
Source§impl AsRef<SCNNode> for SCNReferenceNode
impl AsRef<SCNNode> for SCNReferenceNode
Source§impl AsRef<SCNReferenceNode> for SCNReferenceNode
impl AsRef<SCNReferenceNode> for SCNReferenceNode
Source§impl Borrow<AnyObject> for SCNReferenceNode
impl Borrow<AnyObject> for SCNReferenceNode
Source§impl Borrow<NSObject> for SCNReferenceNode
impl Borrow<NSObject> for SCNReferenceNode
Source§impl Borrow<SCNNode> for SCNReferenceNode
impl Borrow<SCNNode> for SCNReferenceNode
Source§impl ClassType for SCNReferenceNode
impl ClassType for SCNReferenceNode
Source§const NAME: &'static str = "SCNReferenceNode"
const NAME: &'static str = "SCNReferenceNode"
Source§type ThreadKind = <<SCNReferenceNode as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<SCNReferenceNode as ClassType>::Super as ClassType>::ThreadKind
Source§impl CopyingHelper for SCNReferenceNode
impl CopyingHelper for SCNReferenceNode
Source§type Result = SCNReferenceNode
type Result = SCNReferenceNode
Self if the type has no
immutable counterpart. Read moreSource§impl Debug for SCNReferenceNode
impl Debug for SCNReferenceNode
Source§impl Deref for SCNReferenceNode
impl Deref for SCNReferenceNode
Source§impl Hash for SCNReferenceNode
impl Hash for SCNReferenceNode
Source§impl Message for SCNReferenceNode
impl Message for SCNReferenceNode
Source§impl NSCoding for SCNReferenceNode
impl NSCoding for SCNReferenceNode
Source§impl NSCopying for SCNReferenceNode
impl NSCopying for SCNReferenceNode
Source§impl NSObjectProtocol for SCNReferenceNode
impl NSObjectProtocol for SCNReferenceNode
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass directly, or cast your objects with AnyObject::downcast_refSource§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
Source§impl NSSecureCoding for SCNReferenceNode
impl NSSecureCoding for SCNReferenceNode
Source§impl PartialEq for SCNReferenceNode
impl PartialEq for SCNReferenceNode
Source§impl RefEncode for SCNReferenceNode
impl RefEncode for SCNReferenceNode
Source§const ENCODING_REF: Encoding = <SCNNode as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <SCNNode as ::objc2::RefEncode>::ENCODING_REF
Source§impl SCNActionable for SCNReferenceNode
Available on crate feature SCNAction only.
impl SCNActionable for SCNReferenceNode
SCNAction only.Source§unsafe fn runAction(&self, action: &SCNAction)
unsafe fn runAction(&self, action: &SCNAction)
Source§unsafe fn runAction_completionHandler(
&self,
action: &SCNAction,
block: Option<&Block<dyn Fn()>>,
)
unsafe fn runAction_completionHandler( &self, action: &SCNAction, block: Option<&Block<dyn Fn()>>, )
block2 only.Source§unsafe fn runAction_forKey(&self, action: &SCNAction, key: Option<&NSString>)
unsafe fn runAction_forKey(&self, action: &SCNAction, key: Option<&NSString>)
Source§unsafe fn runAction_forKey_completionHandler(
&self,
action: &SCNAction,
key: Option<&NSString>,
block: Option<&Block<dyn Fn()>>,
)
unsafe fn runAction_forKey_completionHandler( &self, action: &SCNAction, key: Option<&NSString>, block: Option<&Block<dyn Fn()>>, )
block2 only.Source§unsafe fn hasActions(&self) -> bool
unsafe fn hasActions(&self) -> bool
Source§unsafe fn actionForKey(&self, key: &NSString) -> Option<Retained<SCNAction>>
unsafe fn actionForKey(&self, key: &NSString) -> Option<Retained<SCNAction>>
Source§unsafe fn removeActionForKey(&self, key: &NSString)
unsafe fn removeActionForKey(&self, key: &NSString)
Source§unsafe fn removeAllActions(&self)
unsafe fn removeAllActions(&self)
Source§impl SCNAnimatable for SCNReferenceNode
Available on crate feature SCNAnimation only.
impl SCNAnimatable for SCNReferenceNode
SCNAnimation only.Source§unsafe fn addAnimation_forKey(
&self,
animation: &ProtocolObject<dyn SCNAnimationProtocol>,
key: Option<&NSString>,
)
unsafe fn addAnimation_forKey( &self, animation: &ProtocolObject<dyn SCNAnimationProtocol>, key: Option<&NSString>, )
Source§unsafe fn addAnimationPlayer_forKey(
&self,
player: &SCNAnimationPlayer,
key: Option<&NSString>,
)
unsafe fn addAnimationPlayer_forKey( &self, player: &SCNAnimationPlayer, key: Option<&NSString>, )
Source§unsafe fn removeAllAnimations(&self)
unsafe fn removeAllAnimations(&self)
Source§unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
objc2-core-foundation only.Source§unsafe fn removeAnimationForKey(&self, key: &NSString)
unsafe fn removeAnimationForKey(&self, key: &NSString)
Source§unsafe fn removeAnimationForKey_blendOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
unsafe fn removeAnimationForKey_blendOutDuration( &self, key: &NSString, duration: CGFloat, )
objc2-core-foundation only.Source§unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
Source§unsafe fn animationPlayerForKey(
&self,
key: &NSString,
) -> Option<Retained<SCNAnimationPlayer>>
unsafe fn animationPlayerForKey( &self, key: &NSString, ) -> Option<Retained<SCNAnimationPlayer>>
Source§unsafe fn removeAnimationForKey_fadeOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
unsafe fn removeAnimationForKey_fadeOutDuration( &self, key: &NSString, duration: CGFloat, )
objc2-core-foundation only.Source§unsafe fn animationForKey(
&self,
key: &NSString,
) -> Option<Retained<CAAnimation>>
unsafe fn animationForKey( &self, key: &NSString, ) -> Option<Retained<CAAnimation>>
objc2-quartz-core and non-watchOS only.Source§unsafe fn pauseAnimationForKey(&self, key: &NSString)
unsafe fn pauseAnimationForKey(&self, key: &NSString)
Source§unsafe fn resumeAnimationForKey(&self, key: &NSString)
unsafe fn resumeAnimationForKey(&self, key: &NSString)
Source§impl SCNBoundingVolume for SCNReferenceNode
Available on crate feature SCNBoundingVolume only.
impl SCNBoundingVolume for SCNReferenceNode
SCNBoundingVolume only.Source§unsafe fn getBoundingBoxMin_max(
&self,
min: *mut SCNVector3,
max: *mut SCNVector3,
) -> bool
unsafe fn getBoundingBoxMin_max( &self, min: *mut SCNVector3, max: *mut SCNVector3, ) -> bool
SceneKitTypes and objc2-core-foundation only.Source§unsafe fn setBoundingBoxMin_max(
&self,
min: *mut SCNVector3,
max: *mut SCNVector3,
)
unsafe fn setBoundingBoxMin_max( &self, min: *mut SCNVector3, max: *mut SCNVector3, )
SceneKitTypes and objc2-core-foundation only.Source§unsafe fn getBoundingSphereCenter_radius(
&self,
center: *mut SCNVector3,
radius: *mut CGFloat,
) -> bool
unsafe fn getBoundingSphereCenter_radius( &self, center: *mut SCNVector3, radius: *mut CGFloat, ) -> bool
SceneKitTypes and objc2-core-foundation only.