Hi, is there a way to find distance this way
Forward distance from two vectors? So left and right wont take in count
Left & Right distance from two vectors? So Forward wont take in count
Currently i only know to calculate corners and compare that, and that works fine but seems like a trash way to go about it and waste of performance
pezzott1
(pezzott1)
May 10, 2022, 2:02pm
2
What if they are opposite?
Could you elaborate, perhaps find an image that illustrate what you want?
1 Like
pezzott1
(pezzott1)
May 10, 2022, 2:05pm
4
As If the forward vector of both actors are facing opposite direction. (I imagine that is what you want)
Oh, sorry it should only take in count of forward vector from A not B
So Imagien a line plane for forward A, The distance i want to find would be the “Closes point at line plane where input is B”
If that makes sense, but without (hopefully) using that method
Slavq
(Slavq)
May 10, 2022, 2:22pm
6
Maybe this will be helpful:
Let me explain this with the picture:
[Untitled-1.jpg]
How to get distance between these vectors, but only along specified axis? So it would return a distance just like if they were ON this axis.
I’m working on 3D Vectors, but this is a 2D example, just for simplicity.
Hello,
I’m trying to get the distance along an axis, but can’t figure it out.
For example, if my player (blue star) is approaching a finish line (the red dot being it’s pivot point), how can I get the distance from that line, along it’s proper axis?
The player can be in the center of the road, off to the side, or a million miles in the sky. All that matters is far away he is from that point, along it’s facing axis.
Any ideas?
Thanks!
[image]
Edit: Changed the picture/desc to make it more …
2 Likes
pezzott1
(pezzott1)
May 10, 2022, 2:52pm
7
Yes. I remember you from the round corners topic.
Hope this illustrate what (I think) you asked for:
Result:
In case you want to investigate further, what I did was basically construct a triangle:
Get the angle between forward vector to direction to B.
Get dista form A to B (this would be the hypothenuse)
Then found the adjacent side length: Adjacent = hypothenuse * cos( Angle )
Finally from A i projected a point with ForwardVector * Adjacent.
3 Likes
FlinnNew
(Flinn)
May 11, 2022, 12:25pm
8
Worked like a charm, thank you!