This commit is contained in:
a
2018-03-05 23:05:22 +01:00
parent 6d326a79c8
commit 2348c6ba0a
11 changed files with 28 additions and 36 deletions

View File

@@ -4939,9 +4939,7 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
{
con->enableMotor(3+limitAxis,true);
con->setTargetVelocity(3+limitAxis, qdotTarget);
//this is max motor force impulse
btScalar torqueImpulse = torque*m_data->m_dynamicsWorld->getSolverInfo().m_timeStep;
con->setMaxMotorForce(3+limitAxis,torqueImpulse);
con->setMaxMotorForce(3+limitAxis, torque);
}
break;
}
@@ -4954,9 +4952,7 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
//next one is the maximum velocity to reach target position.
//the maximum velocity is limited by maxMotorForce
con->setTargetVelocity(3+limitAxis, 100);
//this is max motor force impulse
btScalar torqueImpulse = torque*m_data->m_dynamicsWorld->getSolverInfo().m_timeStep;
con->setMaxMotorForce(3+limitAxis,torqueImpulse);
con->setMaxMotorForce(3+limitAxis, torque);
con->enableMotor(3+limitAxis,true);
}
break;
@@ -4992,9 +4988,7 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
{
con->enableMotor(limitAxis,true);
con->setTargetVelocity(limitAxis, -qdotTarget);
//this is max motor force impulse
btScalar torqueImpulse = torque*m_data->m_dynamicsWorld->getSolverInfo().m_timeStep;
con->setMaxMotorForce(limitAxis,torqueImpulse);
con->setMaxMotorForce(limitAxis, torque);
break;
}
case CONTROL_MODE_POSITION_VELOCITY_PD:
@@ -5004,9 +4998,7 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
//next one is the maximum velocity to reach target position.
//the maximum velocity is limited by maxMotorForce
con->setTargetVelocity(limitAxis, 100);
//this is max motor force impulse
btScalar torqueImpulse = torque*m_data->m_dynamicsWorld->getSolverInfo().m_timeStep;
con->setMaxMotorForce(limitAxis,torqueImpulse);
con->setMaxMotorForce(limitAxis, torque);
con->enableMotor(limitAxis,true);
break;
}