RRHoveringRenderable

Objective-C

@interface RRHoveringRenderable : RRRenderable

Swift

class RRHoveringRenderable : RRRenderable

Convenience renderable that provides functionality for hovering animation of objects. This renderable just modifies its own transformation by setting just the Y direction of the translation. Do not modify the transformation of this renderable yourself, since it will automatically get overridden by the renderable. Adding children to this renderable easily enables them to perform a hover animation. This animation can for instance be used to illustrate the section of a 3d object in the scene.

  • Default initializer. This initializer will create an instance that instantly starts to hover and removes itself from the renderable tree when dropped successfully

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • This initializer will create an instance that instantly starts to hover and removes itself from the renderable tree when dropped successfully

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAutomaticLiftingEnabled:
                                (BOOL)automaticLiftingEnabled
                        autoRemoveOnDroppingFinishedEnabled:
                            (BOOL)autoRemoveOnDroppingFinishedEnabled;

    Swift

    init(automaticLiftingEnabled: Bool, autoRemoveOnDroppingFinishedEnabled: Bool)

    Parameters

    automaticLiftingEnabled

    When set to YES, the renderable will immediately start hovering

    autoRemoveOnDroppingFinishedEnabled

    When set to YES, the renderable removes itself from the renderable tree when dropped succesfully

  • Calling this method will lift the child objects up and let them hover automatically

    Declaration

    Objective-C

    - (void)startHovering;

    Swift

    func startHovering()
  • Calling this method will stop the child renderables from hovering by dropping them

    Declaration

    Objective-C

    - (void)endHovering;

    Swift

    func endHovering()
  • This height defines the average Y offset of the child renderables during hovering

    Declaration

    Objective-C

    @property (nonatomic) CGFloat averageHoveringHeight;

    Swift

    var averageHoveringHeight: CGFloat { get set }
  • This value defines the amplitude of the sinus function used for animating the hovering height around the defined averageHoveringHeight

    Declaration

    Objective-C

    @property (nonatomic) CGFloat hoveringSinusAmplitude;

    Swift

    var hoveringSinusAmplitude: CGFloat { get set }
  • This value defines the cycle duration of the sinus function used for animating the hovering height around the defined averageHoveringHeight in seconds

    Declaration

    Objective-C

    @property (nonatomic) CGFloat hoveringSinusCycleDuration;

    Swift

    var hoveringSinusCycleDuration: CGFloat { get set }
  • This value defines the duration it takes to lift the object from the ground to averageHoveringHeight where the sinus based hovering animation starts

    Declaration

    Objective-C

    @property (nonatomic) CGFloat liftingDuration;

    Swift

    var liftingDuration: CGFloat { get set }
  • This value defines the acceleration that is applied to the child objects when dropping them after calling the endHovering method. Default is 9.81

    Declaration

    Objective-C

    @property (nonatomic) CGFloat gravityAcceleration;

    Swift

    var gravityAcceleration: CGFloat { get set }
  • This property tells if the object is currently lifted off the ground. Keep in mind that after calling the endHovering method, the child renderables will need some time until they dropped to the ground.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isHovering;

    Swift

    var isHovering: Bool { get }