kDefaultSheetSpring top-level constant

SpringDescription const kDefaultSheetSpring

The default SpringDescription used by SheetPhysics subclasses.

This spring has the same configuration as the resulting spring from the SpringDescription.withDampingRatio constructor with a ratio of 1.1, a mass of 0.5, and a stiffness of 100.0.

Implementation

const kDefaultSheetSpring = SpringDescription(
  mass: 0.5,
  stiffness: 100.0,
  // Use a pre-calculated value to define the spring as a const variable.
  // See the implementation of withDampingRatio() for the formula.
  damping: 15.5563491861, // 1.1 * 2.0 * sqrt(0.5 * 100.0)
);