What would be the best way to get a random point within a convex mesh?
Does UE4 provide functionality for this or should I make it myself?
From Rama’s VictoryEdEngine code:
AStaticMeshActor* TheSMA = your static mesh actor;
FPositionVertexBuffer* VertexBuffer =
&TheSMA->StaticMeshComponent->StaticMesh->RenderData->LODResources[0].PositionVertexBuffer;
int VertNum = VertexBuffer->GetNumVertices();
so,
int RandPoint = FMath::RandRange(0, VertNum-1);
FVector RandMeshPos = VertexBuffer->VertexPosition(RandPoint);
this seems to get a random point on a mesh, eh?
the results from this can be used easily enough to get a point within a mesh
Anyway to do this with blueprints?