copyWith method
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,
);
}