star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit bc7670c6e92b9f937f334bf21afc95c21cfd0f07
parent 1d92e14eea11a637fc2661b8021acc5e3d185076
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  2 Jan 2023 16:17:15 +0100

Merge branch 'release_0.8.1'

Diffstat:
MREADME.md | 6+++++-
Mcmake/CMakeLists.txt | 4++--
Msrc/s3d.h | 2+-
Msrc/s3d_backend.h | 2+-
Msrc/s3d_buffer.h | 2+-
Msrc/s3d_c.h | 2+-
Msrc/s3d_device.c | 2+-
Msrc/s3d_device_c.h | 2+-
Msrc/s3d_geometry.c | 2+-
Msrc/s3d_geometry.h | 2+-
Msrc/s3d_instance.c | 2+-
Msrc/s3d_instance.h | 2+-
Msrc/s3d_mesh.c | 2+-
Msrc/s3d_mesh.h | 2+-
Msrc/s3d_primitive.c | 2+-
Msrc/s3d_scene.c | 2+-
Msrc/s3d_scene_c.h | 2+-
Msrc/s3d_scene_view.c | 2+-
Msrc/s3d_scene_view_c.h | 2+-
Msrc/s3d_scene_view_closest_point.c | 2+-
Msrc/s3d_scene_view_trace_ray.c | 2+-
Msrc/s3d_shape.c | 2+-
Msrc/s3d_shape_c.h | 2+-
Msrc/s3d_sphere.c | 2+-
Msrc/s3d_sphere.h | 2+-
Msrc/test_s3d_accel_struct_conf.c | 2+-
Msrc/test_s3d_camera.h | 2+-
Msrc/test_s3d_cbox.h | 10+++++-----
Msrc/test_s3d_closest_point.c | 2+-
Msrc/test_s3d_device.c | 2+-
Msrc/test_s3d_primitive.c | 6+++---
Msrc/test_s3d_sample_sphere.c | 2+-
Msrc/test_s3d_sampler.c | 10+++++-----
Msrc/test_s3d_scene.c | 6+++---
Msrc/test_s3d_scene_view.c | 10+++++-----
Msrc/test_s3d_scene_view_aabb.c | 2+-
Msrc/test_s3d_seams.c | 6+++---
Msrc/test_s3d_shape.c | 6+++---
Msrc/test_s3d_sphere.c | 2+-
Msrc/test_s3d_sphere_box.c | 2+-
Msrc/test_s3d_sphere_instance.c | 2+-
Msrc/test_s3d_trace_ray.c | 2+-
Msrc/test_s3d_trace_ray_instance.c | 6+++---
Msrc/test_s3d_trace_ray_sphere.c | 2+-
Msrc/test_s3d_utils.h | 2+-
45 files changed, 72 insertions(+), 68 deletions(-)

diff --git a/README.md b/README.md @@ -120,6 +120,10 @@ with `<STAR3D_INSTALL_DIR>` the install directory of Star-3D and ## Release notes +### Version 0.8.1 + +Fix compilation warnings with GCC 11 + ### Version 0.8 Update the API of the filtering function: add the range of the ray as input @@ -231,7 +235,7 @@ argument. For closest point queries, this range is from 0 to query radius. ## License -Copyright (C) 2015-2021 |Méso|Star> (<contact@meso-star.com>). Star-3D is +Copyright (C) 2015-2021, 2023 |Méso|Star> (<contact@meso-star.com>). Star-3D is released under the CeCILLv2.1 license. You are welcome to redistribute it under certain conditions; refer to the COPYING files for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) # # This software is a computer program whose purpose is to generate files used # to build the Star-3D library. @@ -58,7 +58,7 @@ endif() ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 8) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(S3D_FILES_SRC diff --git a/src/s3d.h b/src/s3d.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_backend.h b/src/s3d_backend.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_buffer.h b/src/s3d_buffer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_c.h b/src/s3d_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_device.c b/src/s3d_device.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_device_c.h b/src/s3d_device_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_geometry.c b/src/s3d_geometry.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_geometry.h b/src/s3d_geometry.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_instance.c b/src/s3d_instance.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_instance.h b/src/s3d_instance.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_mesh.c b/src/s3d_mesh.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_mesh.h b/src/s3d_mesh.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_primitive.c b/src/s3d_primitive.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_scene.c b/src/s3d_scene.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_scene_c.h b/src/s3d_scene_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_scene_view.c b/src/s3d_scene_view.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_scene_view_c.h b/src/s3d_scene_view_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_scene_view_closest_point.c b/src/s3d_scene_view_closest_point.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_scene_view_trace_ray.c b/src/s3d_scene_view_trace_ray.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_shape.c b/src/s3d_shape.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_shape_c.h b/src/s3d_shape_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_sphere.c b/src/s3d_sphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/s3d_sphere.h b/src/s3d_sphere.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_accel_struct_conf.c b/src/test_s3d_accel_struct_conf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_camera.h b/src/test_s3d_camera.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_cbox.h b/src/test_s3d_cbox.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -54,7 +54,7 @@ static const float cbox_walls[] = { 0.f, 559.f, 548.f, 552.f, 559.f, 548.f }; -const unsigned cbox_walls_nverts = sizeof(cbox_walls) / sizeof(float[3]); +const unsigned cbox_walls_nverts = sizeof(cbox_walls) / (sizeof(float)*3); const unsigned cbox_walls_ids[] = { 0, 1, 2, 2, 3, 0, /* Bottom */ @@ -63,7 +63,7 @@ const unsigned cbox_walls_ids[] = { 0, 3, 7, 7, 4, 0, /* Right */ 2, 3, 7, 7, 6, 2 /* Back */ }; -const unsigned cbox_walls_ntris = sizeof(cbox_walls_ids) / sizeof(unsigned[3]); +const unsigned cbox_walls_ntris = sizeof(cbox_walls_ids) / (sizeof(unsigned)*3); static const struct cbox_desc cbox_walls_desc = { cbox_walls, cbox_walls_ids }; @@ -100,8 +100,8 @@ static const unsigned cbox_block_ids[] = { 0, 1, 5, 5, 4, 0 }; -const unsigned cbox_block_nverts = sizeof(cbox_short_block) / sizeof(float[3]); -const unsigned cbox_block_ntris = sizeof(cbox_block_ids) / sizeof(unsigned[3]); +const unsigned cbox_block_nverts = sizeof(cbox_short_block) / (sizeof(float)*3); +const unsigned cbox_block_ntris = sizeof(cbox_block_ids) / (sizeof(unsigned)*3); /******************************************************************************* * Callbacks diff --git a/src/test_s3d_closest_point.c b/src/test_s3d_closest_point.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_device.c b/src/test_s3d_device.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_primitive.c b/src/test_s3d_primitive.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -44,10 +44,10 @@ static const float plane_verts[] = { 1.f, 1.f, 0.f, 0.f, 1.f, 0.f }; -static const unsigned plane_nverts = sizeof(plane_verts) / sizeof(float[3]); +static const unsigned plane_nverts = sizeof(plane_verts) / (sizeof(float)*3); static const unsigned plane_ids[] = { 0, 1, 2, 2, 3, 0 }; -static const unsigned plane_ntris = sizeof(plane_ids) / sizeof(unsigned[3]); +static const unsigned plane_ntris = sizeof(plane_ids) / (sizeof(unsigned)*3); static void plane_get_ids(const unsigned itri, unsigned ids[3], void* data) diff --git a/src/test_s3d_sample_sphere.c b/src/test_s3d_sample_sphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_sampler.c b/src/test_s3d_sampler.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -103,8 +103,8 @@ main(int argc, char** argv) attribs.type = S3D_FLOAT3; attribs.get = cbox_get_position; - ntris = sizeof(cbox_walls_ids)/sizeof(unsigned[3]); - nverts = sizeof(cbox_walls)/sizeof(float[3]); + ntris = cbox_walls_ntris; + nverts = cbox_walls_nverts; desc.vertices = cbox_walls; desc.indices = cbox_walls_ids; CHK(s3d_mesh_setup_indexed_vertices @@ -148,8 +148,8 @@ main(int argc, char** argv) CHK(s3d_scene_view_ref_put(scnview) == RES_OK); CHK(s3d_shape_enable(walls, 1) == RES_OK); - ntris = sizeof(cbox_block_ids)/sizeof(unsigned[3]); - nverts = sizeof(cbox_short_block)/sizeof(float[3]); + ntris = cbox_block_ntris; + nverts = cbox_block_nverts; desc.vertices = cbox_short_block; desc.indices = cbox_block_ids; CHK(s3d_mesh_setup_indexed_vertices diff --git a/src/test_s3d_scene.c b/src/test_s3d_scene.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -46,7 +46,7 @@ static const float cube_verts[] = { 5.f, 6.f, 6.f, 6.f, 6.f, 6.f }; -static const unsigned cube_nverts = sizeof(cube_verts) / sizeof(float[3]); +static const unsigned cube_nverts = sizeof(cube_verts) / (sizeof(float)*3); /* Front faces are CW. The normals point into the cube */ static const unsigned cube_ids[] = { @@ -57,7 +57,7 @@ static const unsigned cube_ids[] = { 2, 6, 3, 3, 6, 7, /* Top */ 0, 1, 4, 4, 1, 5 /* Bottom */ }; -static const unsigned cube_ntris = sizeof(cube_ids) / sizeof(unsigned[3]); +static const unsigned cube_ntris = sizeof(cube_ids) / (sizeof(unsigned)*3); static void cube_get_ids(const unsigned itri, unsigned ids[3], void* data) diff --git a/src/test_s3d_scene_view.c b/src/test_s3d_scene_view.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -70,7 +70,7 @@ static const float cube_verts[] = { 0.f, 1.f, 1.f, 1.f, 1.f, 1.f }; -static const unsigned cube_nverts = sizeof(cube_verts) / sizeof(float[3]); +static const unsigned cube_nverts = sizeof(cube_verts) / (sizeof(float)*3); /* Front faces are CW. The normals point into the cube */ static const unsigned cube_ids[] = { @@ -81,7 +81,7 @@ static const unsigned cube_ids[] = { 2, 6, 3, 3, 6, 7, /* Top */ 0, 1, 4, 4, 1, 5 /* Bottom */ }; -static const unsigned cube_ntris = sizeof(cube_ids) / sizeof(unsigned[3]); +static const unsigned cube_ntris = sizeof(cube_ids) / (sizeof(unsigned)*3); /******************************************************************************* * Plane data @@ -92,10 +92,10 @@ static const float plane_verts[] = { 1.f, 1.f, 0.5f, 0.f, 1.f, 0.5f }; -static const unsigned plane_nverts = sizeof(plane_verts) / sizeof(float[3]); +static const unsigned plane_nverts = sizeof(plane_verts) / (sizeof(float)*3); static const unsigned plane_ids[] = { 0, 1, 2, 2, 3, 0 }; -static const unsigned plane_ntris = sizeof(plane_ids) / sizeof(unsigned[3]); +static const unsigned plane_ntris = sizeof(plane_ids) / (sizeof(unsigned)*3); /******************************************************************************* * helper function diff --git a/src/test_s3d_scene_view_aabb.c b/src/test_s3d_scene_view_aabb.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_seams.c b/src/test_s3d_seams.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -103,9 +103,9 @@ static const float SQUARE_EDGES__ [] = { 0.1f, 0.1f, 0.f, -0.1f, 0.1f, 0.f }; -static const unsigned SQUARE_NVERTS__ = sizeof(SQUARE_EDGES__) / sizeof(float[3]); +static const unsigned SQUARE_NVERTS__ = sizeof(SQUARE_EDGES__) / (sizeof(float)*3); static const unsigned SQUARE_TRG_IDS__ [] = { 0, 2, 1, 2, 0, 3 }; -static const unsigned SQUARE_NTRIS__ = sizeof(SQUARE_TRG_IDS__) / sizeof(unsigned[3]); +static const unsigned SQUARE_NTRIS__ = sizeof(SQUARE_TRG_IDS__) / (sizeof(unsigned)*3); static const struct desc SQUARE_DESC__ = { SQUARE_EDGES__, SQUARE_TRG_IDS__ }; static int diff --git a/src/test_s3d_shape.c b/src/test_s3d_shape.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -65,8 +65,8 @@ main(int argc, char** argv) unsigned ids[3]; float pos[3]; float trans[12]; - const unsigned cbox_ntris = sizeof(cbox_walls_ids) / sizeof(unsigned[3]); - const unsigned cbox_nverts = sizeof(cbox_walls) / sizeof(float[3]); + const unsigned cbox_ntris = cbox_walls_ntris; + const unsigned cbox_nverts = cbox_walls_nverts; unsigned id; void* data = (void*)&cbox_walls_desc; char c; diff --git a/src/test_s3d_sphere.c b/src/test_s3d_sphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_sphere_box.c b/src/test_s3d_sphere_box.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_sphere_instance.c b/src/test_s3d_sphere_instance.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_trace_ray.c b/src/test_s3d_trace_ray.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_trace_ray_instance.c b/src/test_s3d_trace_ray_instance.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly @@ -46,9 +46,9 @@ static const float quad_verts[] = { 1.f, 1.f, 0.f, 1.f, -1.f, 0.f }; -static const unsigned quad_nverts = sizeof(quad_verts)/sizeof(float[3]); +static const unsigned quad_nverts = sizeof(quad_verts)/(sizeof(float)*3); static const unsigned quad_ids[] = { 0, 1, 3, 3, 1, 2 }; -static const unsigned quad_ntris = sizeof(quad_ids)/sizeof(unsigned[3]); +static const unsigned quad_ntris = sizeof(quad_ids)/(sizeof(unsigned)*3); struct ray { float org[3]; diff --git a/src/test_s3d_trace_ray_sphere.c b/src/test_s3d_trace_ray_sphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly diff --git a/src/test_s3d_utils.h b/src/test_s3d_utils.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2021 |Meso|Star> (contact@meso-star.com) +/* Copyright (C) 2015-2021, 2023 |Méso|Star> (contact@meso-star.com) * * This software is a computer program whose purpose is to describe a * virtual 3D environment that can be ray-traced and sampled both robustly