motionSeedsFor function

MotionSeeds motionSeedsFor(
  1. String name, {
  2. HiblobOptions options = const HiblobOptions(),
})

Reads the motion seeds for name.

Implementation

MotionSeeds motionSeedsFor(String name,
    {HiblobOptions options = const HiblobOptions()}) {
  final seed = options.normalize ? name.trim().toLowerCase() : name;
  return MotionSeeds(
    bobPhase: stream(seed, 'motion.bob.phase') * 2 * math.pi,
    bobPeriod: 2.4 + stream(seed, 'motion.bob.period') * 1.2,
    breathePhase: stream(seed, 'motion.breathe.phase') * 2 * math.pi,
    breathePeriod: 3.0 + stream(seed, 'motion.breathe.period') * 1.5,
    blinkPeriod: 2.8 + stream(seed, 'motion.blink.period') * 2.7,
    blinkOffset: stream(seed, 'motion.blink.offset') * 0.35,
    glancePeriod: 1.8 + stream(seed, 'motion.glance.period') * 2.0,
    glanceSeed: stream(seed, 'motion.glance.seed'),
  );
}