RRBodyModel3DStateFromMeasurements

Objective-C

@interface RRBodyModel3DStateFromMeasurements : NSObject

Swift

class RRBodyModel3DStateFromMeasurements : NSObject

This class provides functionality to modify a given RRBodyModel3DStateinstance based on a set of body measurements. The measurments that are considered must be defined using an RRBodyModel3DStateFromMeasurementsConfig instance.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Initializer given the RRBodyModel3DState isntance you want to modify based on body measurements. This initializer tries to find a default config within the RRBodyModel3D instance that is reference in the provided bodyModelState. Make sure you got provided with body model files that include this default config when using this initializer! This initializer returns nil in case of an error.

    Declaration

    Objective-C

    - (instancetype _Nullable)initWithBodyModelState:
        (nonnull RRBodyModel3DState *)bodyModelState;

    Swift

    init?(bodyModelState: RRBodyModel3DState)

    Parameters

    bodyModelState

    The RRBodyModel3DState whose shape you want to modify based on body measurements.

  • Initializer given the RRBodyModel3DState isntance you want to modify based on body measurements as well as a config that defines the measurements to modifiy. This initializer returns nil in case of an error.

    Declaration

    Objective-C

    - (instancetype _Nullable)
        initWithConfig:(nonnull RRBodyModel3DStateFromMeasurementsConfig *)config
        bodyModelState:(nonnull RRBodyModel3DState *)bodyModelState;

    Swift

    init?(config: RRBodyModel3DStateFromMeasurementsConfig, bodyModelState: RRBodyModel3DState)

    Parameters

    config

    The config instance that defines the measurements you want to adjust.

    bodyModelState

    The RRBodyModel3DState whose shape you want to modify based on body measurements.

  • This property returns the lnames of measurements that you can adjust. These measurement names are defined within the RRBodyModel3DStateFromMeasurementsConfig instance used during initialization.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<NSString *> *_Nonnull measurementNames;

    Swift

    var measurementNames: [String] { get }
  • This property returns the current measurement values of the RRBodyModel3DState instance that was provided during initialization.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<NSNumber *> *_Nonnull currentMeasurementValues;

    Swift

    var currentMeasurementValues: [NSNumber] { get }
  • This property returns the current target values for all measurements.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<NSNumber *> *_Nonnull measurementTargets;

    Swift

    var measurementTargets: [NSNumber] { get }
  • Use this method to change a measurements’s target value.

    Declaration

    Objective-C

    - (BOOL)setMeasurementTarget:(CGFloat)measurementTarget
                measurementIndex:(NSUInteger)measurementIndex
                didFailWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func setMeasurementTarget(_ measurementTarget: CGFloat, measurementIndex: UInt) throws

    Parameters

    measurementTarget

    The target measurement value

    measurementIndex

    The index of the measurement. This index correlates to the measurements array as they are defined in the config and are returned by the measurementNames property.

    error

    An optional pointer to an NSError pointer. When this method fails, it will set an NSError instance to this pointer if provided.

    Return Value

    YES if successful, NO otherwise.

  • This property provides the RRBodyModel3DState taht was provided in the initializer whose content is also modified when calling the applyMeasurementTargets method.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RRBodyModel3DState *_Nonnull bodyModelState;

    Swift

    var bodyModelState: RRBodyModel3DState { get }
  • Calling this method optimizes the RRBodyModel3DState shape to match the provided target measurement values as accurate as possible. The optimized shape will be applied to the RRBodyModel3DState instance that you provided to the initializer of this class.

    Declaration

    Objective-C

    - (void)applyMeasurementTargets;

    Swift

    func applyMeasurementTargets()