StarModel.create constructor

StarModel.create(
  1. double width,
  2. double height,
  3. Random random,
  4. Color color,
)

Implementation

factory StarModel.create(
  double width,
  double height,
  Random random,
  Color color,
) {
  return StarModel(
    x: random.nextDouble() * width * 2 - width,
    y: random.nextDouble() * height * 2 - height,
    z: random.nextDouble() * width,
    pz: random.nextDouble() * width,
    color: color,
    rotation: 0,
  );
}