22.02.2014, 00:09
Quote:
I know of a solution to differentiate between the bullet vector and the aim vector however, I need to know what sort of output you want.
Do you want the distance from the bullet landing spot to the aim point or the elevation/rotation angle offset from the aim vector? |

Quote:
I did this the forward way, by adding spread to serversided bullets.
Getting the actual spread from the gta guns would work the same way, just backwards. Comparing the player pos and bullet target already is the right way. Take the vector between them and compare it to the aim vector of the player (the aim vector is NOT the same as the camera vector, there are some functions to calculate it here that are precise enough, search the forum for that. I had problems with extreme height angles close to +/-90°, did some really crazy math stuff to minimize the error). Then calculate the angles between those two vectors and you got the spread. |
