コード例 #1
0
void Box2DPrismaticJoint::setMotorSpeed(float motorSpeed)
{
    if (mPrismaticJointDef.motorSpeed == motorSpeed)
        return;

    mPrismaticJointDef.motorSpeed = motorSpeed;
    if (mPrismaticJoint)
        mPrismaticJoint->SetMotorSpeed(motorSpeed);
    emit motorSpeedChanged();
}
コード例 #2
0
void Box2DWheelJoint::setMotorSpeed(float _motorSpeed)
{
    float motorSpeedRad = _motorSpeed  * b2_pi / -180;
    if (qFuzzyCompare(motorSpeed(), motorSpeedRad))
        return;

    mWheelJointDef.motorSpeed = motorSpeedRad;
    if (mWheelJoint)
        mWheelJoint->SetMotorSpeed(motorSpeedRad);
    emit motorSpeedChanged();
}