For some weapons, especially the grenade launcher, a trajectory preview line would be very helpful for precise shooting.
The idea is that whenever the position or angle of their weapon changes, then trajectory preview line would be recalculated and displayed with stripped/dotted red line.
From technical perspective it would be an extra bullet with its movement simulated over multiple physics iterations. Since running multiple physics iterations is time consuming and would cause too much delay on the main thread, this would be run on a separate thread, and the line would be displayed only when that separate thread finished with the simulation:
- when the simulated bullet would hit a wall,
- when the simulated bullet would hit a player,
- when the simulated bullet would go out of map bounds.
For some weapons, especially the grenade launcher, a trajectory preview line would be very helpful for precise shooting.
The idea is that whenever the position or angle of their weapon changes, then trajectory preview line would be recalculated and displayed with stripped/dotted red line.
From technical perspective it would be an extra bullet with its movement simulated over multiple physics iterations. Since running multiple physics iterations is time consuming and would cause too much delay on the main thread, this would be run on a separate thread, and the line would be displayed only when that separate thread finished with the simulation: