SCNAnimatable

Trait SCNAnimatable 

Source
pub unsafe trait SCNAnimatable: NSObjectProtocol {
Show 14 methods // Provided methods unsafe fn addAnimation_forKey( &self, animation: &ProtocolObject<dyn SCNAnimationProtocol>, key: Option<&NSString>, ) where Self: Sized + Message { ... } unsafe fn addAnimationPlayer_forKey( &self, player: &SCNAnimationPlayer, key: Option<&NSString>, ) where Self: Sized + Message { ... } unsafe fn removeAllAnimations(&self) where Self: Sized + Message { ... } unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat) where Self: Sized + Message { ... } unsafe fn removeAnimationForKey(&self, key: &NSString) where Self: Sized + Message { ... } unsafe fn removeAnimationForKey_blendOutDuration( &self, key: &NSString, duration: CGFloat, ) where Self: Sized + Message { ... } unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>> where Self: Sized + Message { ... } unsafe fn animationPlayerForKey( &self, key: &NSString, ) -> Option<Retained<SCNAnimationPlayer>> where Self: Sized + Message { ... } unsafe fn removeAnimationForKey_fadeOutDuration( &self, key: &NSString, duration: CGFloat, ) where Self: Sized + Message { ... } unsafe fn animationForKey( &self, key: &NSString, ) -> Option<Retained<CAAnimation>> where Self: Sized + Message { ... } unsafe fn pauseAnimationForKey(&self, key: &NSString) where Self: Sized + Message { ... } unsafe fn resumeAnimationForKey(&self, key: &NSString) where Self: Sized + Message { ... } unsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString) where Self: Sized + Message { ... } unsafe fn isAnimationForKeyPaused(&self, key: &NSString) -> bool where Self: Sized + Message { ... }
}
Available on crate feature SCNAnimation only.
Expand description

The SCNAnimatable protocol defines an animatable property. Objects that implement this protocol can be animated through these methods.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn addAnimation_forKey( &self, animation: &ProtocolObject<dyn SCNAnimationProtocol>, key: Option<&NSString>, )
where Self: Sized + Message,

Adds and runs an animation

Parameter animation: Added animation.

Parameter key: May be any string such that only one animation per unique key is added per animatable object.

Only SCNAnimation (preferred), CABasicAnimation, CAKeyframeAnimation and CAAnimationGroup are supported. The animation starts playing right away. The animation is automatically removed on completion unless if removedOnCompletion is explicitly set to NO.

See also: -[id <SCNAnimation

removedOnCompletion]

Source

unsafe fn addAnimationPlayer_forKey( &self, player: &SCNAnimationPlayer, key: Option<&NSString>, )
where Self: Sized + Message,

Add an animation player.

Parameter player: Added animation player.

Parameter key: May be any string such that only one animation per unique key is added per animatable object.

The animation player is not removed automatically on completion. The animation doesn’t start playing immediatelly. Call “play” on the player to start playing it.

See also: -[SCNAnimationPlayer play]

Source

unsafe fn removeAllAnimations(&self)
where Self: Sized + Message,

Remove all animations.

Source

unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.

Smoothly remove all animations.

Parameter duration: The blend out duration used to remove the animation.

Source

unsafe fn removeAnimationForKey(&self, key: &NSString)
where Self: Sized + Message,

Remove the animation with the given identifier.

Parameter key: The identifier for the animation to remove.

Source

unsafe fn removeAnimationForKey_blendOutDuration( &self, key: &NSString, duration: CGFloat, )
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.

Smoothly remove the animation with the given identifier.

Parameter key: The identifier for the animation to remove.

Parameter duration: The blend out duration used to remove the animation.

Source

unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
where Self: Sized + Message,

Returns an array containing the keys of all animations currently attached to the receiver.

Source

unsafe fn animationPlayerForKey( &self, key: &NSString, ) -> Option<Retained<SCNAnimationPlayer>>
where Self: Sized + Message,

Returns the animation player with the given identifier

Parameter key: The identifier for the animation player to retrieve.

This will return nil if no such animation player exists.

Source

unsafe fn removeAnimationForKey_fadeOutDuration( &self, key: &NSString, duration: CGFloat, )
where Self: Sized + Message,

👎Deprecated
Available on crate feature objc2-core-foundation only.

Smoothly remove the animation with the given identifier.

Parameter key: The identifier for the animation to remove.

Parameter duration: The fade out duration used to remove the animation.

Source

unsafe fn animationForKey( &self, key: &NSString, ) -> Option<Retained<CAAnimation>>
where Self: Sized + Message,

👎Deprecated
Available on crate feature objc2-quartz-core and non-watchOS only.

Returns the animation with the given identifier

Parameter key: The identifier for the animation to retrieve.

This will return nil if no such animation exists. Attempting to modify any properties of the returned object will result in undefined behavior.

Source

unsafe fn pauseAnimationForKey(&self, key: &NSString)
where Self: Sized + Message,

👎Deprecated: Use -[SCNAnimationPlayer setPaused:] instead

Pause the animation with the given identifier.

Parameter key: The identifier for the animation to pause.

Source

unsafe fn resumeAnimationForKey(&self, key: &NSString)
where Self: Sized + Message,

👎Deprecated: Use -[SCNAnimationPlayer setPaused:] instead

Resume the animation with the given identifier.

Parameter key: The identifier for the animation to resume.

Source

unsafe fn setSpeed_forAnimationKey(&self, speed: CGFloat, key: &NSString)
where Self: Sized + Message,

👎Deprecated: Use -[SCNAnimationPlayer setSpeed:] instead
Available on crate feature objc2-core-foundation only.

Update the animation speed of the animation with the given identifier.

Parameter speed: The new speed of the animation.

Parameter key: The identifier for the animation to update.

Source

unsafe fn isAnimationForKeyPaused(&self, key: &NSString) -> bool
where Self: Sized + Message,

👎Deprecated: Use -[SCNAnimationPlayer paused] instead

Returns whether the animation for the specified identifier is paused.

Parameter key: The identifier for the animation to query.

Trait Implementations§

Source§

impl ProtocolType for dyn SCNAnimatable

Source§

const NAME: &'static str = "SCNAnimatable"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn SCNAnimatable
where T: ?Sized + Message + SCNAnimatable,

Implementations on Foreign Types§

Source§

impl<T> SCNAnimatable for ProtocolObject<T>
where T: ?Sized + SCNAnimatable,

Implementors§

Source§

impl SCNAnimatable for SCNAccelerationConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNAnimationPlayer

Source§

impl SCNAnimatable for SCNAvoidOccluderConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNBillboardConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNBox

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNCamera

Available on crate feature SCNCamera only.
Source§

impl SCNAnimatable for SCNCapsule

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNCone

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNCylinder

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNDistanceConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNFloor

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNGeometry

Available on crate feature SCNGeometry only.
Source§

impl SCNAnimatable for SCNIKConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNLight

Available on crate feature SCNLight only.
Source§

impl SCNAnimatable for SCNLookAtConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNMaterial

Available on crate feature SCNMaterial only.
Source§

impl SCNAnimatable for SCNMaterialProperty

Available on crate feature SCNMaterialProperty only.
Source§

impl SCNAnimatable for SCNMorpher

Available on crate feature SCNMorpher only.
Source§

impl SCNAnimatable for SCNNode

Available on crate feature SCNNode only.
Source§

impl SCNAnimatable for SCNParticleSystem

Available on crate feature SCNParticleSystem only.
Source§

impl SCNAnimatable for SCNPlane

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNPyramid

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNReferenceNode

Available on crate feature SCNReferenceNode only.
Source§

impl SCNAnimatable for SCNReplicatorConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNShape

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNSliderConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNSphere

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNTechnique

Available on crate feature SCNTechnique only.
Source§

impl SCNAnimatable for SCNText

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNTorus

Available on crate feature SCNParametricGeometry only.
Source§

impl SCNAnimatable for SCNTransformConstraint

Available on crate feature SCNConstraint only.
Source§

impl SCNAnimatable for SCNTube

Available on crate feature SCNParametricGeometry only.