Hi, as I continue to polish my radar for its eventual release, I would like to fix a small bug. As I found out from asking this (Position Offset in Vehicles) question, I'm able to determine the transport GUID using the UnitTransport offset. I then add the position and angle of that transport to the unit riding it:
Code:
unit.X += transport.X;
unit.Y += transport.Y;
unit.Z += transport.Z;
unit.Angle += transport.Angle;
The problem I'm running into is most prevalent on boats (haven't tested zeppelins) where both the 2D radar and 3D overlay seem to be suffering from some anomaly. The 2D radar seems to be having some issues with angles, even though the angle of the boat is zero and other vehicles like siege engines work fine. The 3D overlay has some other issue which I also can't figure out, all I know is the camera position and direction are correct, so perhaps also angles? To help illustrate my problem I have created several screenshots:
Stormwind boat to Borean Tundra
On land, about to step on boat: https://i.imgur.com/tOUCorL.jpg
On boat, Angle seems to be shifted about 180 degrees: https://i.imgur.com/GL59ZOD.jpg
On boat, another angle to show guards: https://i.imgur.com/iV1sdxF.jpg
Borean Tundra boat to Stormwind
On land, about to step on boat: https://i.imgur.com/GK0v06a.jpg
On boat, problem less evident but still there: https://i.imgur.com/pTMiV5l.jpg
My World to Screen function uses a custom view matrix that I build using the Camera Position / Direction / Fov. It works perfectly everywhere except on certain transport vehicles. Again the camera position and direction have been tested to be always correct.
I know I haven't made myself entirely clear but hopefully someone will be able to help me find a solution.
EDIT: Discussion continued Here!