Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check if a point is inside of a polygon?
In edit mode, I wanna be able to manually draw a polygon and attach it to the prefab similar to red one in this picture and in play mode, I want to check if a 2D point (x and z) is inside of this polygon.

Does Curvy provide a way to check if a point is inside or not?

Attached Files Thumbnail(s)
Sorry, but there is no API method to check if a point is inside a spline. The API gives access to the spline's parameters, so any detection algorithm can be implemented on splines from Curvy Splines. Also, in case you need this, CurvySpline.Bounds provides the bounding box of the spline, and CurvyUtility.SplineToMesh allows you to produce a mesh from a spline.
I hope this helped.
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.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Spline.Length not updated unless I add a point to spline (or modify it) first. _RicO 3 6 08-26-2023, 08:41 AM
Last Post: _Aka_
  When is it required to check if the spline / generator as initialized? Lupos 1 1 05-15-2023, 12:04 PM
Last Post: _Aka_
  How do I get the closest Spline Control Point Lupos 2 13 05-12-2023, 01:59 AM
Last Post: Lupos
  How to get direction of last control point? _RicO 4 17 04-13-2023, 11:27 AM
Last Post: _Aka_

Forum Jump: