Is Float3 "A" to the left or right of Float3 "B"?

I am building a game that has automobile traffic, and I have a series of points that these cars follow, all working fine in DOTS (yay. They’re hover cars so there are a lot of them, so thank goodness for DOTS)

However I would like the cars to tilt/bank as they move around corners. I have an array of float3 (IBufferElementData) and would like to compare the auto’s current point against the next point to see if the next one is left or right of the current on, and my how much

I found code that works with VECTOR3, but translating it doesn’t work as it uses a number of functions in the VECTOR3 object that are not available in the FLOAT3 object… or, and this is a big probability, I am making things more difficult and there is an easier answer.

Anyone got a hint for me?

Vector3 equivalent is float3 (no capital F) - the same as in hlsl, so look in unity mathematics to see if there are equivalents to use.
https://github.com/Unity-Technologies/Unity.Mathematics

  • docs ofc (you probably have it from package manager). Are there any missing equivalents to the functions in there? I suspect it has most if not all.

all the functions (like “dot” or “normalize” for example) are in the Unity.Mathematics.math class.
So just do
import static Unity.Mathematics.math;
and you can write f = normalize(f)