i am making a unit, represented as unittransform, that considers any nearby mesh, concave or convex (probably separated into different pieces and different tags)
And then goes through all of its triangles and find the **a vector on the mesh** that is
a. within a certain radius of the the unittransform
b. has normals that when compared to Vector3.down (both normalized for fairness) is not angled more
than 120 degree
c, the closest one, sometimes perhaps right below the unittransform.
I considered octree, kdtree and barycentric coordinates, but i'm not sure how to implement them...
I hope for guidance.
↧