NewtonMaterialSetContactFrictionCoef

From Newton Wiki
Jump to: navigation, search

NewtonMaterialSetContactFrictionCoef

void NewtonMaterialSetContactFrictionCoef (const NewtonMaterial* material, dFloat staticFrictionCoef, dFloat kineticFrictionCoef, int index);

Usage

Override the default value of the kinetic coefficient of friction for this contact.

Parameters

  • const NewtonMaterial materialHandle - pointer to a material pair.
  • dFloat staticFrictionCoef - static friction coefficient. Must be positive.
  • dFloat kineticFrictionCoef - Kinetic friction coefficient. Must be positive.
  • int index - index to the tangent vector. 0 for primary tangent vector or 1 for the secondary tangent vector.

Return

  • Nothing.

Remarks

  • This function can only be called from a material callback event handler.
  • The coefficient of friction usually should be less than or equal to 1.0; however, because some synthetic materials can have a friction coefficient that is greater than 1.0, Newton allows for the value to be as high as 2.0.
  • the value for kinetic friction will be clamped between 0.01f (minimum friction value) and that of the current static friction. If the application wants to set a kinetic friction higher than the current static friction it must increase the static friction first.

See also

NewtonMaterialSetCollisionCallback NewtonMaterialSetDefaultFriction