RRCarouselRenderable

Objective-C

@interface RRCarouselRenderable : RRRenderable

Swift

class RRCarouselRenderable : RRRenderable

A renderable that enables to select a single 3D item out of an arbitrary amount of 3D items by navigating through them like in a carousel. The carousel is defined as follows in its local coordinate system:

1) The center of the carousel is at position (0, 0, 0)

2) The rotation axis of the carousel is the Y axis

3) The item renderables obtained from the datasource are translated to have their local coordinate (0, 0, 0)) on a circle with radius in the XZ plane.

4) The item renderables are always rotated around the Y axis in a way that the local z axis of the item renderable faces the camera.

5) Between items in the carousel there is a constant angular distance defined by

6) Centered in the front of the carousel, there are items visible that are currently within an angular range

7) At the edges of this range there can be alpha blending applied for the items, which is linearly applied within the around the visible range’s edges centered range .

8) The current front most item in the carousel is always scaled with a factor and all items at least having an angular distance to the front are scaled with a factor . The scale for the items having less angular distance to the front than is linearly interpolated

  • Default Initializer

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • The associated delegate that gets informed about several actions

    Declaration

    Objective-C

    @property (nonatomic, weak) id<RRCarouselRenderableDelegate> _Nullable delegate;

    Swift

    weak var delegate: RRCarouselRenderableDelegate? { get set }
  • The associated dataSource that provides the necessary data to fill the carousel with selectable items

    Declaration

    Objective-C

    @property (nonatomic, weak) id<RRCarouselRenderableDataSource> _Nullable dataSource;

    Swift

    weak var dataSource: RRCarouselRenderableDataSource? { get set }
  • Inserts an additional item into the carousel. Always update the dataSource’s state before calling this method to keep data consistent!

    Declaration

    Objective-C

    - (void)insertItemAtIndex:(NSUInteger)index;

    Swift

    func insertItem(at index: UInt)

    Parameters

    index

    The item index position to insert the item at.

  • Removes an existing item from the carousel. Always update the dataSource’s state before calling this method to keep data consistent!

    Declaration

    Objective-C

    - (void)removeItemAtIndex:(NSUInteger)index;

    Swift

    func removeItem(at index: UInt)

    Parameters

    index

    The item index position to remove.

  • This method should be called if the state of the dataSource changed, but the carousel does not get informed about these changes using insertItem/removeItem calls!

    Declaration

    Objective-C

    - (void)reloadDataFromDataSource;

    Swift

    func reloadDataFromDataSource()
  • Defines the radius of the circle that contains the object’s item renderables (0, 0, 0) position

    Declaration

    Objective-C

    @property (nonatomic) CGFloat carouselRadius;

    Swift

    var carouselRadius: CGFloat { get set }
  • Defines if the circle that is rendered in the XZ plane of the renderable, centered at (0, 0, 0) is visible.

    Declaration

    Objective-C

    @property (nonatomic) BOOL carouselCircleIsHidden;

    Swift

    var carouselCircleIsHidden: Bool { get set }
  • Defines the angular distance between items in the carousel in degrees

    Declaration

    Objective-C

    @property (nonatomic) CGFloat angularItemsDistance;

    Swift

    var angularItemsDistance: CGFloat { get set }
  • Defines the angular range in which item renderables are visible in degrees

    Declaration

    Objective-C

    @property (nonatomic) CGFloat visibleAngularRange;

    Swift

    var visibleAngularRange: CGFloat { get set }
  • Defines the angular range that is used for alpha blending of both ends of the visible angular range in degrees

    Declaration

    Objective-C

    @property (nonatomic) CGFloat alphaBlendingAngularRange;

    Swift

    var alphaBlendingAngularRange: CGFloat { get set }
  • Defines the scale of the currently front most item renderable

    Declaration

    Objective-C

    @property (nonatomic) CGFloat maximumItemScale;

    Swift

    var maximumItemScale: CGFloat { get set }
  • Defines the scale of all item renderables that are further away from the front most position than

    Declaration

    Objective-C

    @property (nonatomic) CGFloat minimumItemScale;

    Swift

    var minimumItemScale: CGFloat { get set }
  • Defines the angular distance from the front most item position in which the item renderable scales are interpolated from to

    Declaration

    Objective-C

    @property (nonatomic) CGFloat minimumItemScaleAngularDistance;

    Swift

    var minimumItemScaleAngularDistance: CGFloat { get set }