camera->getTarget() and ray.start are both vector3df which when subtracted from each other result in another vector3df. That result exists temporarily on the stack for this calculation. And while it exists all the usual member functions of vector3d can be called for it.
Ah, ok. That's kind of what I was guessing, but why do that in a mainloop? Aren't those stack operations (allocation and release) costly if repeated that much?
No, stack is super cheap - only heap allocations are expensive. All that's needed for the stack to grow or shrink is that the stack-pointer is moved up/down by the size of the object. Heap allocations (new/delete or malloc/free) on the other hand are very expensive as they have to find free memory and have to mark it as used (I don't know specifics on a modern OS, there is probably even additional checks and paging and stuff going on).