Esempio n. 1
0
    void ExertForce()
    {
        currentThrust = thrustpercent * maxThrust * 1000f;
        Vector3 thrustVector = thrustUnitVector.normalized * currentThrust;         // [N]

        physicsEngine.AddForces(thrustVector);
    }
Esempio n. 2
0
    void FixedUpdate()
    {
        Vector3 velocityVector = physicsEngine.velocityVector;
        float   speed          = velocityVector.magnitude;
        float   dragSize       = CalculateDrag(speed);
        Vector3 dragVector     = dragSize * velocityVector.normalized;

        physicsEngine.AddForces(-dragVector);          // dragVector is applying in the opposite direction
    }