mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Added steering return to Vehicle.
It happens in Vehicle::updateMove so it can apply to all vehicle subclasses. It is applied to both x and y steering.
This commit is contained in:
parent
eae9fc36e5
commit
e3cb30bb1d
|
|
@ -1104,6 +1104,22 @@ void Vehicle::updateMove(const Move* move)
|
|||
mSteering.y = 0;
|
||||
}
|
||||
|
||||
// Steering return
|
||||
if(mDataBlock->steeringReturn > 0.0f &&
|
||||
(!mDataBlock->powerSteering || (move->yaw == 0.0f && move->pitch == 0.0f)))
|
||||
{
|
||||
Point2F returnAmount(mSteering.x * mDataBlock->steeringReturn * TickSec,
|
||||
mSteering.y * mDataBlock->steeringReturn * TickSec);
|
||||
if(mDataBlock->steeringReturnSpeedScale > 0.0f)
|
||||
{
|
||||
Point3F vel;
|
||||
mWorldToObj.mulV(getVelocity(), &vel);
|
||||
returnAmount += Point2F(mSteering.x * vel.y * mDataBlock->steeringReturnSpeedScale * TickSec,
|
||||
mSteering.y * vel.y * mDataBlock->steeringReturnSpeedScale * TickSec);
|
||||
}
|
||||
mSteering -= returnAmount;
|
||||
}
|
||||
|
||||
// Jetting flag
|
||||
if (move->trigger[3]) {
|
||||
if (!mJetting && getEnergyLevel() >= mDataBlock->minJetEnergy)
|
||||
|
|
|
|||
Loading…
Reference in a new issue