Skip to content

Commit

Permalink
Allow higher friction values.
Browse files Browse the repository at this point in the history
  • Loading branch information
notgiven688 committed Dec 19, 2024
1 parent 954804f commit da84a98
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Jitter2/Dynamics/RigidBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,27 +159,24 @@ internal void RaiseEndCollide(Arbiter arbiter)
internal JMatrix inverseInertia = JMatrix.Identity;
internal Real inverseMass = (Real)1.0;

/// <summary>
/// Gets or sets the friction coefficient for this object.
/// </summary>
/// <remarks>
/// The friction coefficient determines the resistance to sliding motion.
/// Higher values create more friction, while lower values allow easier sliding.
/// A typical value ranges between 0 (no friction) and 1 (maximum friction).
/// Values typically range from 0 (no friction) upwards.
/// Higher values represent strong friction or adhesion effects.
/// Default is 0.2.
/// </remarks>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown if the value is not between 0 and 1.
/// Thrown if the value is negative.
/// </exception>
public Real Friction
{
get => friction;
set
{
if (value < (Real)0.0 || value > (Real)1.0)
if (value < (Real)0.0)
{
throw new ArgumentOutOfRangeException(nameof(value),
"Friction must be between 0 and 1.");
"Friction must be non-negative.");
}

friction = value;
Expand Down

0 comments on commit da84a98

Please sign in to comment.