solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit 807bff9644aa0f52d841710bffc1a15c69df57ac
parent a38815e484760bbc223d7ab6d120ad632a97bd2f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri,  6 Jan 2017 16:31:43 +0100

Fix how the default FOV is defined

Default FOV is defined in radians in the CMakeLists rather than in
degrees.

Diffstat:
Mcmake/CMakeLists.txt | 2+-
Msrc/solstice_args.h.in | 2+-
Msrc/solstice_entity.c | 10+++++-----
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -65,7 +65,7 @@ set(SOLSTICE_ARGS_DEFAULT_NREALISATIONS "10000") set(SOLSTICE_ARGS_DEFAULT_CAMERA_POS "0,0,0") set(SOLSTICE_ARGS_DEFAULT_CAMERA_TGT "0,0,-1") set(SOLSTICE_ARGS_DEFAULT_CAMERA_UP "0,1,0") -set(SOLSTICE_ARGS_DEFAULT_CAMERA_FOV "70") +set(SOLSTICE_ARGS_DEFAULT_CAMERA_FOV "1.22173047639603070383") # In radians set(SOLSTICE_ARGS_DEFAULT_IMG_WIDTH "800") set(SOLSTICE_ARGS_DEFAULT_IMG_HEIGHT "600") diff --git a/src/solstice_args.h.in b/src/solstice_args.h.in @@ -64,7 +64,7 @@ static const struct solstice_args SOLSTICE_ARGS_NULL = SOLSTICE_ARGS_NULL__; { @SOLSTICE_ARGS_DEFAULT_CAMERA_POS@ }, \ { @SOLSTICE_ARGS_DEFAULT_CAMERA_TGT@ }, \ { @SOLSTICE_ARGS_DEFAULT_CAMERA_UP@ }, \ - MDEG2RAD(@SOLSTICE_ARGS_DEFAULT_CAMERA_FOV@) \ + @SOLSTICE_ARGS_DEFAULT_CAMERA_FOV@ \ }, \ \ { /* Image */ \ diff --git a/src/solstice_entity.c b/src/solstice_entity.c @@ -123,8 +123,6 @@ setup_entity_pivot parser_pivot = solparser_get_pivot(solstice->parser, entity->data.pivot); res = score_node_pivot_create(solstice->score, &pivot_node); if(res != RES_OK) goto error; - score_node_set_translation(pivot_node, parser_pivot->translation); - score_node_set_rotations(pivot_node, parser_pivot->rotation); /* TODO: 2-axis pivots */ anim_pivot.type = PIVOT_SINGLE_AXIS; @@ -157,6 +155,8 @@ setup_entity_pivot res = score_node_pivot_setup(pivot_node, &anim_pivot, &anim_tracking); if(res != RES_OK) goto error; + score_node_set_translation(pivot_node, parser_pivot->translation); + score_node_set_rotations(pivot_node, parser_pivot->rotation); res = darray_nodes_push_back(&solstice->pivots, &pivot_node); if(res != RES_OK) goto error; @@ -317,13 +317,13 @@ solstice_update_entities(struct solstice* solstice, const double sun_dir[3]) res_T res = RES_OK; ASSERT(solstice && sun_dir); - n = darray_nodes_size_get(&solstice->pivots); + n = darray_nodes_size_get(&solstice->roots); FOR_EACH(i, 0, n) { - struct score_node* pivot = darray_nodes_data_get(&solstice->pivots)[i]; + struct score_node* node = darray_nodes_data_get(&solstice->roots)[i]; /* Initialialised the world space position of the entity geometry */ res = sanim_node_visit_tree - (&pivot->anim, sun_dir, NULL, update_instance_transform); + (&node->anim, sun_dir, NULL, update_instance_transform); if(res != RES_OK) { fprintf(stderr, "Could not update the transformation of the entity geometries.\n");