[WIP] Add physics calculations for vehicles. Not actually used anywhere yet.

Oki, I'll look into it before I submit a proper pull request.

On Tue, Dec 30, 2014 at 1:55 AM, Kevin Granade <notifications@github.com>
wrote:

> In src/veh_physics.cpp
> <https://github.com/CleverRaven/Cataclysm-DDA/pull/10666#discussion-diff-22335501>
> :
>
> > +        if (  !((v_dir > 0.0) ^ (velocity_end < 0.0)) ) { /* XAND */
> > +            /* Don't go directly from forward to reverse */
> > +            kinetic_end = 0.0;
> > +            velocity_end = 0.0;
> > +        }
> > +        /* Update some other values as well now that we know speed etc */
> > +        velocity_average = (velocity_start + velocity_end) / 2;
> > +        engine_watt_average = newton_average * velocity_average;
> > +        distance_traveled = fabs(velocity_average * t); /* No negatives */
> > +        /* More closely match t to actual time taken, for use in next iteration */
> > +        t = t * TILE_SIZE_M / distance_traveled;
> > +        if( fabs(velocity_end) < 0.1 )
> > +            velocity_end = 0.0;
> > +        if( distance_traveled < 0.001 || t >= TURN_TIME_S || t <= 0.001 || velocity_end == 0.0 ) {
> > +            time_taken = TURN_TIME_S;
> > +            break; /* For gameplay purposes you can always travel 1 tile in a turn */
>
> IMO the situation is the opposite, if there's a super coarse override you
> need to make the system work, it indicates a problem with the system, and
> if you're making compromises based on 'this wouldn't be fun if it were
> realistic', why bother to simulate it in such detail in the first place?
> IMO getting stuck because your traction/horsepower is too low is
> definitely something that should happen sometimes.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/CleverRaven/Cataclysm-DDA/pull/10666/files#r22335501>.
>



-- 

 - Vidar