star-vx

Structuring voxels for ray-tracing
git clone git://git.meso-star.fr/star-vx.git
Log | Files | Refs | README | LICENSE

commit 060895c3430ad05f3cb7900706f98119bb73a202
parent 9660a3e500ca909e1f6e69ec7b85b35010cd4c3a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 28 Feb 2018 15:28:42 +0100

Rename htvox_scene_for_each_voxel in htvox_scene_for_each_leaf

Diffstat:
Msrc/htvox.h | 4++--
Msrc/htvox_scene.c | 4++--
Msrc/test_htvox_scene.c | 8++++----
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/htvox.h b/src/htvox.h @@ -152,11 +152,11 @@ htvox_scene_get_aabb double upper[3]); HTVOX_API res_T -htvox_scene_for_each_voxel +htvox_scene_for_each_leaf (struct htvox_scene* scn, void (*functor) (const void* val, /* Value of the voxel */ - const size_t ivoxel, /* Identifier of the voxel */ + const size_t ivoxel, /* Identifier of the leaf */ const double low[3], /* World space lower bound of the voxel */ const double upp[3], /* World space upper bound of the voxel */ void* ctx), /* Client data */ diff --git a/src/htvox_scene.c b/src/htvox_scene.c @@ -599,11 +599,11 @@ htvox_scene_get_voxels_count(const struct htvox_scene* scn, size_t* nvoxels) } res_T -htvox_scene_for_each_voxel +htvox_scene_for_each_leaf (struct htvox_scene* scn, void (*func) (const void* val, - const size_t ivoxel, + const size_t ileaf, const double low[3], const double upp[3], void* ctx), diff --git a/src/test_htvox_scene.c b/src/test_htvox_scene.c @@ -217,12 +217,12 @@ dump_data(FILE* stream, struct htvox_scene* scn) CHK(htvox_scene_get_voxels_count(scn, &nvxls) == RES_OK); fprintf(stream, "POINTS %lu float\n", (unsigned long)(nvxls * 8)); - CHK(htvox_scene_for_each_voxel(scn, write_points, stream) == RES_OK); + CHK(htvox_scene_for_each_leaf(scn, write_points, stream) == RES_OK); fprintf(stream, "CELLS %lu %lu\n", (unsigned long)nvxls, (unsigned long)(nvxls*(8/*#verts per voxel*/ + 1/*1st field of a cell*/))); - CHK(htvox_scene_for_each_voxel(scn, write_cells, stream) == RES_OK); + CHK(htvox_scene_for_each_leaf(scn, write_cells, stream) == RES_OK); fprintf(stream, "CELL_TYPES %lu\n", (unsigned long)nvxls); FOR_EACH(ivxl, 0, nvxls) fprintf(stream, "11\n"); @@ -230,7 +230,7 @@ dump_data(FILE* stream, struct htvox_scene* scn) fprintf(stream, "CELL_DATA %lu\n", (unsigned long)nvxls); fprintf(stream, "SCALARS K float 1\n"); fprintf(stream, "LOOKUP_TABLE default\n"); - CHK(htvox_scene_for_each_voxel(scn, write_scalars, stream) == RES_OK); + CHK(htvox_scene_for_each_leaf(scn, write_scalars, stream) == RES_OK); } int @@ -314,7 +314,7 @@ main(int argc, char** argv) CHK(NEW_SCN(dev, low, upp, nvxls, &desc, &scn) == RES_OK); - CHK(htvox_scene_for_each_voxel(scn, check_voxel, &ctx) == RES_OK); + CHK(htvox_scene_for_each_leaf(scn, check_voxel, &ctx) == RES_OK); CHK(htvox_scene_get_voxels_count(NULL, &nvoxels) == RES_BAD_ARG); CHK(htvox_scene_get_voxels_count(scn, NULL) == RES_BAD_ARG);