Godot Version
v4.2.1.stable.official
Question
I have a point in 3D space and a ConvexPolygonShape3D with all it’s points in a PackedVector3Array. The points position and the Shapes positions are all relative to the physics body.
The thing is, the ConvexPolygonShape3D gives all the point positions however, I’m trying to find the closest edge to the point but i have literally no idea how. All I ask for is an algorythm which finds the closest edge to the point (by giving the two points which form the edge) and performance wise I don’t really care that much cus it won’t run every frame and my shapes are quite simple.
NOTE :
I thought about first finding the closest point on the shape to the point in space and then trying to find all the edges connected to that point on the shape so I wont have to check EVERY edge on the WHOLE SHAPE, but even that seems challenging, cus how do I know if another point is connected to this one or not?
I feel like there must be some kind of inequality which tells whether two points are connected or not.
All help appriciated!