Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Basic

Common settings for all constraint types.

Common settings for all constraint typesThese settings control the physical behavior of constraints:

  • Stiffness: How rigid the constraint is (1.0 = perfectly rigid)
  • Damping: How much energy is absorbed (prevents oscillation)
  • Breaking: Force/torque thresholds for destructible constraints

    usage:

    // Rigid constraint (default)
    auto settings = ConstraintSettings::Rigid();
    // Soft spring-like constraint
    auto settings = ConstraintSettings::Soft(0.5f, 0.1f);
    // Breakable constraint (snaps at 100N force)
    auto settings = ConstraintSettings::Breakable(100.0f, 50.0f);