Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find intersection point
#1
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
Reply
#2
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
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
Hi,
I did not find any method with a Ray as an input.
Thanks.
Reply
#4
(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?
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#5
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!
Reply
#6
(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
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Control Point Interpolation Overrides. rickgplus 1 270 12-11-2025, 08:52 AM
Last Post: _Aka_
  12_Train junction point richardzzzarnold 5 3,029 04-16-2025, 02:19 PM
Last Post: _Aka_
  OnAfterControlPointAdded - Control Point is null jh092 5 2,729 02-04-2025, 09:31 PM
Last Post: _Aka_
  How to generate gameobject on the control point Yang Yi 1 1,413 12-10-2024, 10:14 PM
Last Post: _Aka_

Forum Jump: