I am trying to use UDynamicMeshComponent to create a procedural landscape, and the collisions are not working at all. I would like to use the Compute Mesh Convex Decomposition blueprint function in C++ so that I can use the convex decomposition as simple colliders for the landscape.
There are a number of other GeometryScript functions that I would like to use as well, such as Recalculate Normals. Is there a way to do this? It seems like C++ isn’t supported much in this context.
Hey, I guess you may already have solved your issue already, but you can find them by searching the engine code using your IDE - which is a super handy and generally applicable (I think?) way to find c++ equivalents in UE. So for instance, since there is a BP function called “Append Box” I searched for “AppendBox” which led me to MeshPrimitiveFunctions.cpp.
This particular function you can then call like this:
Placing this in a ADynamicMeshActor subclass will create a simple rectangle when you drag it into the editor window. There are lots of functions available in c++, just type UGeometryScriptLibrary_ and you should see a huge list in your IDE
include “Components/DynamicMeshComponent.h” include “DynamicMesh/DynamicMesh3.h” include “GeometryScript/MeshBooleanFunctions.h” include “GeometryScript/MeshPrimitiveFunctions.h” include “GeometryScript/MeshSpatialFunctions.h” include “GeometryScript/MeshAssetFunctions.h” include “GeometryScript/MeshNormalsFunctions.h” include “GeometryScript/MeshTransformFunctions.h”
Could you please share the full cpp code with headers. Am new to coding and trying to do something similar , i.e. ApplyDisplaceFromTextureMap with no success yet!