I included a copy of the code without comments so those of you who want to view the code without clutter can do so.
This aimbot is for educational purposes only. I purposely left out class implementations for Vector3 and Quaternion. You can write those yourself. There's also implementation for Quaternion::LookRotation online. I included the dump for reference.
Please watch this time, it will make a part of the code make more sense: https://www.youtube.com/watch?v=c60Vh1P3lto