Differential D1739 Diff 5899 extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
Changeset View
Changeset View
Standalone View
Standalone View
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
| Show First 20 Lines • Show All 533 Lines • ▼ Show 20 Lines | if (limit || powered) | ||||
| { | { | ||||
| if(m_flags & BT_SLIDER_FLAGS_CFM_DIRLIN) | if(m_flags & BT_SLIDER_FLAGS_CFM_DIRLIN) | ||||
| { | { | ||||
| info->cfm[srow] = m_cfmDirLin; | info->cfm[srow] = m_cfmDirLin; | ||||
| } | } | ||||
| btScalar tag_vel = getTargetLinMotorVelocity(); | btScalar tag_vel = getTargetLinMotorVelocity(); | ||||
| btScalar mot_fact = getMotorFactor(m_linPos, m_lowerLinLimit, m_upperLinLimit, tag_vel, info->fps * currERP); | btScalar mot_fact = getMotorFactor(m_linPos, m_lowerLinLimit, m_upperLinLimit, tag_vel, info->fps * currERP); | ||||
| info->m_constraintError[srow] -= signFact * mot_fact * getTargetLinMotorVelocity(); | info->m_constraintError[srow] -= signFact * mot_fact * getTargetLinMotorVelocity(); | ||||
| info->m_lowerLimit[srow] += -getMaxLinMotorForce() * info->fps; | info->m_lowerLimit[srow] += -getMaxLinMotorForce() / info->fps; | ||||
| info->m_upperLimit[srow] += getMaxLinMotorForce() * info->fps; | info->m_upperLimit[srow] += getMaxLinMotorForce() / info->fps; | ||||
| } | } | ||||
| if(limit) | if(limit) | ||||
| { | { | ||||
| k = info->fps * currERP; | k = info->fps * currERP; | ||||
| info->m_constraintError[srow] += k * limit_err; | info->m_constraintError[srow] += k * limit_err; | ||||
| if(m_flags & BT_SLIDER_FLAGS_CFM_LIMLIN) | if(m_flags & BT_SLIDER_FLAGS_CFM_LIMLIN) | ||||
| { | { | ||||
| info->cfm[srow] = m_cfmLimLin; | info->cfm[srow] = m_cfmLimLin; | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | if(limit || powered) | ||||
| if(powered) | if(powered) | ||||
| { | { | ||||
| if(m_flags & BT_SLIDER_FLAGS_CFM_DIRANG) | if(m_flags & BT_SLIDER_FLAGS_CFM_DIRANG) | ||||
| { | { | ||||
| info->cfm[srow] = m_cfmDirAng; | info->cfm[srow] = m_cfmDirAng; | ||||
| } | } | ||||
| btScalar mot_fact = getMotorFactor(m_angPos, m_lowerAngLimit, m_upperAngLimit, getTargetAngMotorVelocity(), info->fps * currERP); | btScalar mot_fact = getMotorFactor(m_angPos, m_lowerAngLimit, m_upperAngLimit, getTargetAngMotorVelocity(), info->fps * currERP); | ||||
| info->m_constraintError[srow] = mot_fact * getTargetAngMotorVelocity(); | info->m_constraintError[srow] = mot_fact * getTargetAngMotorVelocity(); | ||||
| info->m_lowerLimit[srow] = -getMaxAngMotorForce() * info->fps; | info->m_lowerLimit[srow] = -getMaxAngMotorForce() / info->fps; | ||||
| info->m_upperLimit[srow] = getMaxAngMotorForce() * info->fps; | info->m_upperLimit[srow] = getMaxAngMotorForce() / info->fps; | ||||
| } | } | ||||
| if(limit) | if(limit) | ||||
| { | { | ||||
| k = info->fps * currERP; | k = info->fps * currERP; | ||||
| info->m_constraintError[srow] += k * limit_err; | info->m_constraintError[srow] += k * limit_err; | ||||
| if(m_flags & BT_SLIDER_FLAGS_CFM_LIMANG) | if(m_flags & BT_SLIDER_FLAGS_CFM_LIMANG) | ||||
| { | { | ||||
| info->cfm[srow] = m_cfmLimAng; | info->cfm[srow] = m_cfmLimAng; | ||||
| ▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines | |||||