PBRT path tracing: negation of ray direction before next event estimation I am very new to computer graphics, so I am sorry if this results in a stupid question. 

For educational purposes I am looking through the pbrt code and I have noticed that before computing the direction for the next path for the subsequent bounce, they flip the direction of the incoming ray. Specifically:

    Vector3f wo = -ray.d, wi;
    Float pdf;
    BxDFType flags;
    Spectrum f = isect.bsdf-&gt;Sample_f(wo, &amp;wi, sampler.Get2D(), &amp;pdf,
                                      BSDF_ALL, &amp;flags);


Now my rationale to justify that (also hinted by the name of the variable), is that we are tracing the rays from the camera, but really the phenomenon we are simulating is light coming from light into the camera, so even if the algorithm does:

a) Eye --> Object --> Light 

What we are simulating is more like 

b) Eye &lt;-- Object &lt;-- Light 

So my assumption here is that the direction is flipped because of this reason. But if this is the case, should the resulting wi be flipped again before giving it to the next ray as direction? In the next bounce we'll find ourselves in the same process as in the option a) , but if we don't flip wi, don't we have

PrevObject &lt;-- Object --> Light  instead of 

PrevObject --> Object --> Light 

? 

Is Sample_f returning an already flipped wi (i.e. ready for the next step)? Is my reasoning all wrong? 

Note that I don't have the book yet, I am just trying to guess from code what's happening.
The incoming direction $\omega_o$ (coming from eye) is flipped in pbrt:

"Another convention we will follow is that the incident light direction $\omega_i$ and the outgoing viewing direction $\omega_o$ will both be normalized and outward facing after being transformed into the local coordinate system at the surface. By convention, the surface normal always points to the "outside" of the object...".