A dot product between two angles gives me a value ranging from [-1,1], but I’m trying to use it in a target weighting system where every value (distance, facing, etc) is evaluated in a range of [0,1], with 1 being the highest possible weight. As such, is there any simple way to remap a dot product, such that a value of -1 is evaluated as 0 or 0.1 (the lowest possible weight), a value of 0 is evaluated as 0.5, and a value of 1 tops out at 1?
You can’t change what values are returned by the dot product, it’s an algebraic definition, but you can easily map that value on another range after getting it. Something like this should work to map the [-1,1] range to the [0,1] range:
float dotProductResult = /*some dot product*/;
dotProductResult = (dotProductResult + 1)/2;