Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

4M Downloads

[Suggestion] Velocity dot product variable

DrprofLuigi opened this issue ยท 3 comments

commented

It would be nice to have a variable that returns the normalized dot product between the vehicle's heading and velocity.

Basically, if the vehicle is moving perfectly forward, velocity_z (or some other name) would return 1. If moving exactly to the left, right, up, or down it would return 0, and perfectly backward would return -1.

Bonus points if we get one per axis (velocity_x, velocity_y, velocity_z). Also, I may PR this at some point so no stress.

commented

One could easily do that, yes. Just add it to the vehicle-F level variable listing. There's already a dot product function for the 3D point class, though since two of the three values of the vector will be 0 (since it will be axial), it'd be more efficent to just copy the maths and paste em with the hard-coded values. I fully support you doing this!

commented

Trying to close out tickets before I do my major version update jump to ensure I have as little bugs and issues as possible to port and fix. As such, I'm flagging all outsourced tickets with a 30-day time limit. All not done will be auto-closed.

commented

Auto-closed.