SA-MP Forums Archive
problem with quats - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: problem with quats (/showthread.php?tid=664191)



problem with quats - kocurek - 21.02.2019

Hi, i have a probem with include rotations.inc by Nero_3D. if in vehicle aren't any player GetVehicleRotationQuat returns incorrect values. Who anyone knows a solution? Thanks for all answers.
https://github.com/Shiska/rotations/...r/rotation.inc (main code)
https://github.com/Shiska/rotations/...ation_misc.inc (GetVehicleObjectPositionOffset, GetVehicleObjectPositionWorld functions)


Re: problem with quats - kocurek - 21.02.2019

bumpp


Re: problem with quats - Pottus - 21.02.2019

No there is no solution I've been through this and that function is definitely not reliable. The only remote possibility would be to use ColAndreas to figure out the rx/ry rotation of the surface then just get the z rotation of the vehicle. Only works if the vehicle is on the ground.


Re: problem with quats - NaS - 22.02.2019

YSF fixed this some time ago. The correct quaternion is stored in the server memory (GetVehicleZAngle converts it correctly), but the quaternion function doesn't return it if noone is in the vehicle.

It's also possible to "catch" the correct quaternion from the player sync data (basically listen for that packet and store it everytime it updates) if you use the SAMP.RakNet plugin.


Re: problem with quats - Pottus - 22.02.2019

Quote:
Originally Posted by NaS
Посмотреть сообщение
YSF fixed this some time ago. The correct quaternion is stored in the server memory (GetVehicleZAngle converts it correctly), but the quaternion function doesn't return it if noone is in the vehicle.

It's also possible to "catch" the correct quaternion from the player sync data (basically listen for that packet and store it everytime it updates) if you use the SAMP.RakNet plugin.
Oh really.... I will just shut the fuck up then! Should have made sure.


Re: problem with quats - kocurek - 23.02.2019

ok, thank guys


Re: problem with quats - NaS - 23.02.2019

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Oh really.... I will just shut the fuck up then! Should have made sure.
Well you're still right, it's inaccessible without additional plugins.

Either way, the best place to (de)attach objects is still a flat surface and a vehicle with a player inside. Even with the correct quaternions it's not 100% accurate at all times.