Added acMeshRandomize to astaroth.h to keep core and utils separate
This commit is contained in:
@@ -221,6 +221,23 @@ acMeshCreate(const AcMeshInfo info, AcMesh* mesh)
|
||||
return AC_SUCCESS;
|
||||
}
|
||||
|
||||
static AcReal
|
||||
randf(void)
|
||||
{
|
||||
return (AcReal)rand() / (AcReal)RAND_MAX;
|
||||
}
|
||||
|
||||
AcResult
|
||||
acMeshRandomize(AcMesh* mesh)
|
||||
{
|
||||
const int n = acVertexBufferSize(mesh->info);
|
||||
for (int w = 0; w < NUM_VTXBUF_HANDLES; ++w)
|
||||
for (int i = 0; i < n; ++i)
|
||||
mesh->vertex_buffer[w][i] = randf();
|
||||
|
||||
return AC_SUCCESS;
|
||||
}
|
||||
|
||||
AcResult
|
||||
acMeshDestroy(AcMesh* mesh)
|
||||
{
|
||||
|
Reference in New Issue
Block a user