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 22baea8e3504741470ae1ea242b9ca1af69a0c2d
parent 9388051808cf83773d99f4a1ba50a975b1738e7b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 26 Sep 2017 12:06:39 +0200

Fix the initialisation of the pivot transformation

The initial positioning of pivots might be wrong when they targeted an
anchor: the hierarchy of the anchor might be not initialised leading to
wrong pivot constraints.

Diffstat:
Msrc/solstice_entity.c | 17+++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/solstice_entity.c b/src/solstice_entity.c @@ -461,15 +461,6 @@ solstice_setup_entities(struct solstice* solstice) goto error; } - /* Initialialised the world space position of the entity geometry */ - res = sanim_node_visit_tree - (&root->anim, dummy_sun_dir, solstice, update_instance_transform); - if(res != RES_OK) { - fprintf(stderr, - "Could not setup the transformation of the entity geometries.\n"); - goto error; - } - res = darray_nodes_push_back(&solstice->roots, &root); if(res != RES_OK) { fprintf(stderr, "Could not register a root entity.\n"); @@ -480,6 +471,13 @@ solstice_setup_entities(struct solstice* solstice) root = NULL; } + /* Initialise the world space position of the geometries */ + res = solstice_update_entities(solstice, dummy_sun_dir); + if(res != RES_OK) { + fprintf(stderr, "Could not setup the initial position of the entities.\n"); + goto error; + } + exit: str_release(&name); return res; @@ -499,7 +497,6 @@ solstice_update_entities(struct solstice* solstice, const double sun_dir[3]) FOR_EACH(i, 0, n) { struct solstice_node* node = darray_nodes_data_get(&solstice->roots)[i]; - /* Initialialised the world space position of the entity geometry */ res = sanim_node_visit_tree (&node->anim, sun_dir, solstice, update_instance_transform); if(res != RES_OK) {