Hello,
Can someone tell me how to get world location of specific Static Mesh points in C++ like in the picture( squares) ?
Hello Krzysio,
The best way to do this would be to either put sockets on the static mesh at those locations and then reference their location or, in the case of a basic shape like this, you can calculate to get it.
Using local transform (or world, but be sure to offset it all by the static mesh’s world transform if you do this), you can get one of the bottom corners by plugging in half the X, half the Y, and half the Z size of the static mesh itself. This assuming that the root of this static mesh is directly in the middle.
Do you need the SM vertices, or can you just manually define an array of vectors for each point? Please, be more detailed about the effect you’re trying to achieve.
For actual mesh data you can google “c++ static mesh vertices ue4” and find this. Remember to check ‘Allow CPUAccess’. In my experience it wasn’t worth the effort for my vertex snapping code.
I would just define the points as local positions using a vector array, then transform their location to WS when needed.