copyWith method

RigidBody copyWith({
  1. Shape? shape,
  2. Vec2? velocity,
  3. double? mass,
  4. double? elasticity,
  5. bool? isStatic,
})

Implementation

RigidBody copyWith({
  Shape? shape,
  Vec2? velocity,
  double? mass,
  double? elasticity,
  bool? isStatic,
}) {
  return RigidBody(
    shape: shape ?? this.shape,
    velocity: velocity ?? this.velocity,
    mass: mass ?? this.mass,
    elasticity: elasticity ?? this.elasticity,
    isStatic: isStatic ?? this.isStatic,
  );
}