Is it still modeled the primitive way like in racer 050 source?
I wrote a bit simplyfied version of the 050 source here, the ClutchCapacity is "max_torque" from car.ini clutch section.
The force calculation function:
The integration function:
The logics of a driveline:
Engine -> Clutch -> Gearbox -> Differential -> Wheel(Left/Right)
The GearboxSpeed is the physical calculation of driveline (wheels->differential->gearbox).
The EngineSpeed is one out of 2, the GearboxSpeed Or RotationalFrame(fake speed to represent engine speed when freely reving).
If the Clutch is Locked, EngineSpeed=GearBoxSpeed, correct.
If the Clutch is Not Locked, well there should be sliping and the forces should be mixed (GearBoxSpeed & Rotational frame) depending on the ClutchInput value ie. clutch sliping etc.
Well whats strange to me is that the driveline is always connected, the forces are always delivered to the differential in this model, while in real life when the clutch is not connected(fully pressed down), the engine and driveline run seprate...
So is this model still being used in racer or not? Visualy it gives satisfying results, atleast in racer 050 it did, but im not sure if thats real?
I wrote a bit simplyfied version of the 050 source here, the ClutchCapacity is "max_torque" from car.ini clutch section.
The force calculation function:
Code:
clutchCurrentTorque = ClutchCapacity * ClutchInput;
cumulativeRatio = GearRatio * DifferentialRatio;
// In neutral gear the pre and post parts are always unlocked,
// and no clutch torque is applied.
if ( Gear = Neutral )
{
UnlockClutch();
clutchCurrentTorque = 0;
}
// Calculate current clutch torque (including torque direction)
if( Clutch = Not_Locked )
{
// Engine is running separately from the rest of the driveline.
// The clutch works to make the velocity of pre-clutch (engine) and
// post-clutch (rest) equal.
if ( EngineSpeed - GearboxSpeed * GearRatio )
ClutchTorque = clutchCurrentTorque;
else
ClutchTorque = -clutchCurrentTorque;
}
// else acceleration will be given by the driveline (engine rotates
// along with the rest of the driveline as a single assembly)
if ( Clutch = Locked )
{
// Check if pre and post are still locked
if ( Abs( EngineTorque - ( ReactionTorque + BrakeTorque ) ) > ClutchTorque )
{
UnlockClutch();
}
}
// else it will get locked again when velocity reversal happens
// of the engine vs. rest of the drivetrain (=gearbox in angular velocity)
if( IsSingleDiff() )
{
if( Clutch = Locked )
{
Torque = EngineTorque * CumulativeRatio;
}
else
{
// Engine spins at a different rate from the rest of the driveline
// In this case the clutch fully works on getting the pre- and post-
// clutch angular velocities equal.
// Note that if the clutch is fully depressed (engine totally decoupled
// from the rest of the driveline), this torque will be 0, and the
// postclutch driveline will just rotate freely.
Torque = ClutchTorque * CumulativeRatio;
}
SetDifferentialTorque( Torque, EffectiveInertia );
}
The integration function:
Code:
// Remember difference between engine and gear rotation
Difference = EngineSpeed - GearboxSpeed * GearRatio;
if ( Clutch = Locked )
{
// Check for the engine and gearbox (ratio'd)
// to rotate just about equally.
if ( Difference > DELTA_VEL_THRESHOLD )
{
// Unlock pre-post to let things catch up again
UnlockClutch();
}
}
// Engine
Engine_Integrate();
Gearbox_Integrate();
if ( Clutch = Not_Locked )
{
// Check if gearbox is catching up with engine
newDifference = EngineSpeed - GearboxSpeed * GearRatio;
if ((Difference > 0 AND newDifference < 0 ) OR (Difference < 0 AND newDifference > 0 ))
{
LockClutch();
// Force engine and gearbox velocity to be the same
EngineSpeed = GearboxSpeed * GearRatio;
}
}
The logics of a driveline:
Engine -> Clutch -> Gearbox -> Differential -> Wheel(Left/Right)
The GearboxSpeed is the physical calculation of driveline (wheels->differential->gearbox).
The EngineSpeed is one out of 2, the GearboxSpeed Or RotationalFrame(fake speed to represent engine speed when freely reving).
If the Clutch is Locked, EngineSpeed=GearBoxSpeed, correct.
If the Clutch is Not Locked, well there should be sliping and the forces should be mixed (GearBoxSpeed & Rotational frame) depending on the ClutchInput value ie. clutch sliping etc.
Well whats strange to me is that the driveline is always connected, the forces are always delivered to the differential in this model, while in real life when the clutch is not connected(fully pressed down), the engine and driveline run seprate...
So is this model still being used in racer or not? Visualy it gives satisfying results, atleast in racer 050 it did, but im not sure if thats real?