Momentum Scripting v1
Loading...
Searching...
No Matches
MOMENTUM_NAMESPACE::FrictionController Class Reference

#include <FrictionController.h>

Public Member Functions

bool getEnableNonLinearDirectSolveUpdate () const
 
double getFrictionCoefficient () const
 
std::pair< double, double > getMinimumStaticFrictionForceRange () const
 
bool isActive () const
 
void setEnableNonLinearDirectSolveUpdate (bool enable)
 
void setFrictionCoefficient (double frictionCoefficient)
 
void setMinimumStaticFrictionForceRange (double min, double max)
 
void setMinimumStaticFrictionForceRange (std::pair< double, double > range)
 

Detailed Description

Translational or rotational friction controller for Hinge, Prismatic and CylindricalJoint.

Member Function Documentation

◆ getEnableNonLinearDirectSolveUpdate()

bool MOMENTUM_NAMESPACE::FrictionController::getEnableNonLinearDirectSolveUpdate ( ) const
Returns
true if non-linear direct solve update is enabled - otherwise false

◆ getFrictionCoefficient()

double MOMENTUM_NAMESPACE::FrictionController::getFrictionCoefficient ( ) const
Returns
the friction coefficient. For rotational friction controllers the axis radius is part of the friction coefficient.

◆ getMinimumStaticFrictionForceRange()

std::pair< double, double > MOMENTUM_NAMESPACE::FrictionController::getMinimumStaticFrictionForceRange ( ) const

Get the minimum force range that this friction controller can apply.

See setMinimumStaticFrictionForceRange

Returns
a double pair with min and max range. First element is min range and last element is max range, N for linear friction controllers and Nm for rotational friction controllers.

◆ isActive()

bool MOMENTUM_NAMESPACE::FrictionController::isActive ( ) const
Returns
true when this controller is enabled and has a friction coefficient larger than zero - otherwise false

◆ setEnableNonLinearDirectSolveUpdate()

void MOMENTUM_NAMESPACE::FrictionController::setEnableNonLinearDirectSolveUpdate ( bool  enable)

Enable/disable non-linear update of the friction conditions given current normal force from the direct solver.

When enabled - this feature is similar to scale box friction models with solve type DIRECT.

Default: Disabled

Note
This feature only supports constraint solve types DIRECT and DIRECT_AND_ITERATIVE - meaning, if the constraint has solve type ITERATIVE, this feature is ignored.
Parameters
enable- true to enable, false to disable (Disabled by default.)

◆ setFrictionCoefficient()

void MOMENTUM_NAMESPACE::FrictionController::setFrictionCoefficient ( double  frictionCoefficient)

Assign friction coefficient.

Default: 0.4167.

Note
If this controller is rotational (HingeJoint or CylindricalJoint) the radius of the axle should be included in the friction coefficient for the comparisons with the normal force to be dimensionally correct. I.e., friction_torque <= friction_coefficient * axle_radius * normal_force
Parameters
frictionCoefficient- friction coefficient

◆ setMinimumStaticFrictionForceRange() [1/2]

void MOMENTUM_NAMESPACE::FrictionController::setMinimumStaticFrictionForceRange ( double  min,
double  max 
)

Set the minimum force range that this friction controller can apply.

Can be used to simulate static friction. Default: (0, 0)

Parameters
min- the new minimum range, N for linear friction controllers and Nm for rotational friction controllers
max- the new maximum range, N for linear friction controllers and Nm for rotational friction controllers

◆ setMinimumStaticFrictionForceRange() [2/2]

void MOMENTUM_NAMESPACE::FrictionController::setMinimumStaticFrictionForceRange ( std::pair< double, double >  range)

Set the minimum force range that this friction controller can apply.

Can be used to simulate static friction. Default: (0, 0)

Parameters
range- a double pair with min and max range, N for linear friction controllers and Nm for rotational friction controllers