I expect I’ll feel embarrassed by the answer to this question, but I gotta ask anyway…
Say we’ve got 2 Vector3s: (0.6, 0.0, 0.8) and (0.3, 0.0, 0.9)
I’m pretty sure their dot product should be: (0.6 x 0.3) + (0.0 x 0.0) + (0.8 x 0.9) = 0.9
Asking Unity this question:
> vects.dirAgentToGoal
"(0.6, 0.0, 0.8)"
magnitude: 0.9999999
normalized: "(0.6, 0.0, 0.8)"
sqrMagnitude: 0.9999999
x: 0.5608401
y: -0.005341334
z: 0.8279068
Static members:
> vects.dirAgentToTarget
"(0.3, 0.0, 0.9)"
magnitude: 1
normalized: "(0.3, 0.0, 0.9)"
sqrMagnitude: 0.9999999
x: 0.3438614
y: 0
z: 0.9390204
Static members:
ok, so far so good.
Unity, please do tell, what is their dot product?
> Vector3.Dot(vects.dirAgentToTarget, vects.dirAgentToGoal)
0.9702727
Ack! But…Unity, 0.9702727 != 0.9
How can this be?
Any help is appreciated!