Exemplo n.º 1
0
void setBoostState(int f_state) {
    if (boost_state == f_state) {return;}
    boost_state = f_state;
    Boost_LED = f_state;
    Relay_Boost1 = f_state;
    Relay_Boost10 = !f_state;

    wait_ms(relay_delay);

    Relay_Boost1 = 0;
    Relay_Boost10 = 0;

    updateBoostState(boost_state);  
    wait_ms(relay_delay);
}
Exemplo n.º 2
0
void Mammut::update()
{
    updateBoostState();

    if (!isStillOnObject()) {
        m_isOnObject = false;
        return;
    }

    m_physics.clearForcesAndApplyGravity();

    if (!m_boostIsActive)
        slowDownDrifting();

    float forwardIntensity = glm::smoothstep(s_startIncreasingSpeed, s_stopIncreasingSpeed, m_zDistance - m_physics.position().z) * 15.0 + 15.0; // [15, 30] 
    const glm::vec3 forwardForce = glm::vec3(0.0f, 0.0f, -forwardIntensity);
    m_physics.applyForce(forwardForce);
}