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 5a752e8ee7189657c47d033a47bf57daf321d1b9
parent f5e394853d8972f96e2f5f4e9fb47a6b7825d845
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 14 Oct 2016 12:28:49 +0200

Minor updates of the seams test

Remove a useless link flag on the CL compiler

Diffstat:
Mcmake/CMakeLists.txt | 5-----
Msrc/test_s3d_seams.c | 105+++++++++++++++++++++++++++++++++++++++++--------------------------------------
2 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -111,10 +111,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) COMPILE_FLAGS "-Wno-variadic-macros -Wno-long-long") endif() -if(MSVC) - set_target_properties(s3d PROPERTIES LINK_FLAGS /DEBUG) -endif() - rcmake_setup_devel(s3d Star3D ${VERSION} star/s3d_version.h) ################################################################################ @@ -151,7 +147,6 @@ if(NOT NO_TEST) new_test(test_s3d_trace_ray_instance) new_test(test_s3d_seams) - build_test(test_s3d_trace_ray) register_test(test_s3d_trace_ray_legacy test_s3d_trace_ray) register_test(test_s3d_trace_ray_filter test_s3d_trace_ray filter) diff --git a/src/test_s3d_seams.c b/src/test_s3d_seams.c @@ -1,34 +1,34 @@ /* Copyright (C) |Meso|Star> 2015-2016 (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 -* and efficiently. -* -* This software is governed by the CeCILL license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/or redistribute the software under the terms of the CeCILL -* license as circulated by CEA, CNRS and INRIA at the following URL -* "http://www.cecill.info". -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited -* liability. -* -* In this respect, the user's attention is drawn to the risks associated -* with loading, using, modifying and/or developing or reproducing the -* software by the user in light of its specific status of free software, -* that may mean that it is complicated to manipulate, and that also -* therefore means that it is reserved for developers and experienced -* professionals having in-depth computer knowledge. Users are therefore -* encouraged to load and test the software's suitability as regards their -* requirements in conditions enabling the security of their systems and/or -* data to be ensured and, more generally, to use and operate it in the -* same conditions as regards security. -* -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL license and that you accept its terms. */ + * + * This software is a computer program whose purpose is to describe a + * virtual 3D environment that can be ray-traced and sampled both robustly + * and efficiently. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. */ #include "s3d.h" #include "test_s3d_utils.h" @@ -43,8 +43,8 @@ struct desc { }; /******************************************************************************* -* Callbacks -******************************************************************************/ + * Callbacks + ******************************************************************************/ static INLINE void get_ids(const unsigned itri, unsigned ids[3], void* data) { @@ -109,7 +109,8 @@ static const unsigned SQUARE_NTRIS__ = sizeof(SQUARE_TRG_IDS__) / sizeof(unsigne static const struct desc SQUARE_DESC__ = { SQUARE_EDGES__, SQUARE_TRG_IDS__ }; static int -check_ray(int use_double) { +check_ray(int use_double) +{ struct mem_allocator allocator; struct s3d_device* dev; struct s3d_hit hit; @@ -119,22 +120,25 @@ check_ray(int use_double) { struct s3d_shape* square; struct s3d_shape* inst; struct s3d_vertex_data attribs; - float _transform[12]; + float transformf[12]; double transform[12]; float range[2] = { 0.f, FLT_MAX }; - float org[3] = { 3.3492994308471680f, -9.7470426559448242f, 2.6555661803570274f }; - float dir[3] = { -0.26465030351986046f, 0.77017831656345948f, 0.58033229924097962f }; + float org[3] = { + 3.3492994308471680f, -9.7470426559448242f, 2.6555661803570274f + }; + float dir[3] = { + -0.26465030351986046f, 0.77017831656345948f, 0.58033229924097962f + }; float pos[3]; - if (use_double) { + if(use_double) { d33_rotation_pitch(transform, PI); - f33_set_d33(_transform, transform); - } - else { - f33_rotation_pitch(_transform, (float)PI); + f33_set_d33(transformf, transform); + } else { + f33_rotation_pitch(transformf, (float)PI); } - f3_splat(_transform + 9, 0); - _transform[11] = 10; + f3_splat(transformf + 9, 0); + transformf[11] = 10; mem_init_proxy_allocator(&allocator, &mem_default_allocator); @@ -151,7 +155,7 @@ check_ray(int use_double) { SQUARE_NVERTS__, &attribs, 1, (void*) &SQUARE_DESC__), RES_OK); CHECK(s3d_scene_attach_shape(scn, square), RES_OK); s3d_scene_instantiate(scn, &inst); - CHECK(s3d_instance_set_transform(inst, _transform), RES_OK); + CHECK(s3d_instance_set_transform(inst, transformf), RES_OK); CHECK(s3d_scene_attach_shape(scn2, inst), RES_OK); CHECK(s3d_scene_view_create(scn2, S3D_TRACE, &scnview), RES_OK); @@ -160,8 +164,7 @@ check_ray(int use_double) { if (!S3D_HIT_NONE(&hit)) { f3_add(pos, org, f3_mulf(pos, dir, hit.distance)); printf("Hit at [%g %g %g]\n",SPLIT3(pos)); - } - else { + } else { printf("No hit\n"); } CHECK(s3d_scene_view_ref_put(scnview), RES_OK); @@ -178,10 +181,12 @@ check_ray(int use_double) { return S3D_HIT_NONE(&hit) ? RES_UNKNOWN_ERR : RES_OK; } -int main() { - check_ray(1); - check_ray(0); - +int +main(int argc, char** argv) +{ + (void)argc, (void)argv; + CHECK(check_ray(1), RES_OK); + CHECK(check_ray(0), RES_OK); return 0; }