Posts: 5
Threads: 3
Joined: Jul 2022
Hi,
I have an object which is moving towards the spline.
How would I find the intersection point of my object's forward vector and the spline (projected on the xz plane)?
So basically, I want to find out where my moving object is going to hit the spline when it moves forward.
Thank you
Posts: 2,124
Threads: 93
Joined: Jun 2017
09-28-2022, 03:17 PM
(This post was last modified: 09-28-2022, 03:18 PM by _Aka_.)
Hi
You can find an API method
here that gives you the nearest point of a ray from a spline. Once you get that point, check if that point is part of the ray or not to know if the ray indeed intersects the spline.
Did this help?
Have a nice day
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 5
Threads: 3
Joined: Jul 2022
Hi,
I did not find any method with a Ray as an input.
Thanks.
Posts: 2,124
Threads: 93
Joined: Jun 2017
(10-17-2022, 07:06 PM)soccertrash Wrote: Hi,
I did not find any method with a Ray as an input.
Thanks.
It's in the post I post the link for. That post contains code you need to add to two files, and the method is GetNearestPointTF(Ray ray, .....)
Is it clear now?
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Posts: 5
Threads: 3
Joined: Jul 2022
10-21-2022, 01:18 PM
(This post was last modified: 10-21-2022, 01:29 PM by soccertrash.)
Ah, I missed the link. Thank you.
I integrated the code you posted on the other thread. The member mStepSize is not on CurvySplineSegment any more. How can I fix this?
Thank you!
Posts: 2,124
Threads: 93
Joined: Jun 2017
(10-21-2022, 01:18 PM)soccertrash Wrote: Ah, I missed the link. Thank you.
I integrated the code you posted on the other thread. The member mStepSize is not on CurvySplineSegment any more. How can I fix this?
Thank you!
Hi
mStepSize was a private member that was removed since. I updated the code in the referenced post to make it work without the mStepSize member: I replaced it's value with:1f / CacheSize
Please let me know if you find any issue.
Have a nice day
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.