E2: Has anyone found a solution for Pod:driver():eye()?

When your Pod (seat, vehicle, anything you can sit in) is not perfectly leveled with the ground, both Pod:driver():eye() and Pod:driver():eyeAngles() won’t point to the same place the driver is actually aiming at, there is a significant misplace aparently related to wrong use of sine/cosine in the engine’s formula.

I’ve been trying to find out how to solve this matematically but so far I couldn’t figure out the mistery behind this. Has anyone ever found a solution that don’t envolve ballsocketing the pod to the world?

you could possibly use (Pod:driver():aimpos()-Pod:driver:shootPos()):toAngle()

[editline]28th June 2013[/editline]

you also need to take into account that if you are changing the angle of the pod your eye angle will also change, in case you didn’t realize that.

aimPos() is not an option because it updates with delay, if you are moving fast the direction (Driver:shootPos() -Driver:aimPos()):normalized() will be often wrong, specially if you are inside a cockpit or some restrict space, the direction vector obtained from this math can literally point to completely opposing directions.

Not to mention that if your shootPos is inside a prop, shootPos and aimPos will be the same value and there will be no direction defined.

Edit: I just tested and found out that aimPos() is also calculated wrong.