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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get Closest Point on Spline neppyneptune1 1 5 10-15-2022, 11:17 AM
Last Post: _Aka_
  Intersection of two curvy splines Einherj 5 15 10-04-2022, 10:14 PM
Last Post: _Aka_
  How can I find the point on the spline after applying with offset angle+radius? Chanon 1 3 10-01-2022, 11:50 AM
Last Post: _Aka_
  How to stop spline refreshing when a control point is deleted or removed? Beaver_Boy 4 8 07-23-2022, 11:24 AM
Last Post: _Aka_

Forum Jump: