all of the changes
This commit is contained in:
@@ -10,11 +10,15 @@ class MotorcycleTest {
|
||||
public:
|
||||
Vehicle vehicle{};
|
||||
float load{}, clutch{1.0f};
|
||||
float starter_torque{18.f}; // N m at the crankshaft while held
|
||||
bool starter_engaged{};
|
||||
void set_starter(bool engaged) { starter_engaged=engaged; }
|
||||
|
||||
protected:
|
||||
void step_motorcycle(Crankshaft& crank, float dt, float maximum_load_torque) {
|
||||
crank.load_torque = std::clamp(load, 0.0f, 1.0f) * maximum_load_torque;
|
||||
vehicle.clutch_input = std::clamp(clutch, 0.0f, 1.0f);
|
||||
if(starter_engaged) crank.add_torque(std::max(starter_torque,0.f));
|
||||
crank.step(dt);
|
||||
crank.drivetrain_torque = vehicle.update(crank.omega, crank.inertia, dt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user