commit 44abc91bb19cf781fc996c7a3ea85de971147ff6
parent 7bcecdb74afe39e2a73ebaaf7c6fdcec0215b219
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 19 Sep 2017 10:24:38 +0200
Merge branch 'release_0.2'
Diffstat:
12 files changed, 50 insertions(+), 43 deletions(-)
diff --git a/README.md b/README.md
@@ -21,11 +21,19 @@ well as all the aforementioned prerequisites. Finally generate the project from
the `cmake/CMakeLists.txt` file by appending to the `CMAKE_PREFIX_PATH`
variable the install directories of its dependencies.
+## Release notes
+
+### Version 0.2
+
+- Update the `sanim_node_visit_tree` function: the submitted sun direction may
+ be NULL. In this case, the pivot constraints are not resolved during the tree
+ traversal.
+
## Licenses
Solstice-Anim is developed by [|Meso|Star>](http://www.meso-star.com) for the
[National Center for Scientific Research](http://www.cnrs.fr/index.php) (CNRS).
-It is a free software copyright (C) CNRS 2016 and it is released under the
+It is a free software copyright (C) CNRS 2016-2017 and it is released under the
[OSI](http://opensource.org)-approved GPL v3+ license. You are welcome to
redistribute it under certain conditions; refer to the COPYING file for
details.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) CNRS 2016
+# Copyright (C) CNRS 2016-2017
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ rcmake_append_runtime_dirs(_runtime_dirs RSys)
# Configure and define targets
################################################################################
set(VERSION_MAJOR 0)
-set(VERSION_MINOR 1)
+set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
diff --git a/src/sanim.h b/src/sanim.h
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -170,14 +170,14 @@ sanim_node_solve_pivot
(struct sanim_node* node,
const double in_dir[3]);
-/* Visit the (sub)tree starting at node
- * Solve pivots if any (an ancestor pivot would not be solved/updated)
- * Call visitor on every node of the tree with its updated transform
- * Visit stops if a call to visitor return is not RES_OK */
+/* Visit the (sub)tree starting at `node'. Solve pivots if any (an ancestor
+ * pivot would not be solved/updated) and if `in_dir' is not NULL. Call
+ * `visitor' on every node of the tree with its updated transform Visit stops
+ * if a call to visitor return is not RES_OK */
SANIM_API res_T
sanim_node_visit_tree
(struct sanim_node* node,
- const double in_dir[3],
+ const double in_dir[3], /* May be NULL <=> do not solve pivot */
void* data,
res_T (*visitor)
(const struct sanim_node* n, const double transform[12], void* data));
diff --git a/src/sanim_node.c b/src/sanim_node.c
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -165,7 +165,7 @@ compose_pivot_transform_L(const struct pivot_data* pivot, double accum[12]) {
}
static double*
-get_pivot_transform(const struct pivot_data* pivot, double transform[12])
+get_pivot_transform(const struct pivot_data* pivot, double transform[12])
{
ASSERT(pivot && transform);
switch (pivot->pivot.type) {
@@ -862,10 +862,10 @@ visit_tree
struct sanim_node* const* children;
double transform[12];
res_T res = RES_OK;
- ASSERT(node && node->data && in_dir && visitor);
- ASSERT(d3_is_normalized(in_dir));
+ ASSERT(node && node->data && visitor);
+ ASSERT(!in_dir || d3_is_normalized(in_dir));
- if (node->data->pivot_data) {
+ if (in_dir && node->data->pivot_data) {
res = node_solve_pivot(node, in_dir);
if (res != RES_OK) return res;
}
@@ -1035,19 +1035,19 @@ sanim_node_visit_tree
(struct sanim_node* node,
const double in_dir[3],
void* data,
- res_T(*visitor)(
- const struct sanim_node* n, const double transform[12], void* data))
+ res_T(*visitor)
+ (const struct sanim_node* n, const double transform[12], void* data))
{
double dir[3];
double transform[12];
size_t count, i;
struct sanim_node* const* children;
res_T res = RES_OK;
- if (!node || !node->data || !in_dir || !visitor) return RES_BAD_ARG;
- if (!d3_normalize(dir, in_dir)) return RES_BAD_ARG;
+ if (!node || !node->data || !visitor) return RES_BAD_ARG;
+ if (in_dir && !d3_normalize(dir, in_dir)) return RES_BAD_ARG;
- if (node->data->pivot_data) {
- res = node_solve_pivot(node, in_dir);
+ if (in_dir && node->data->pivot_data) {
+ res = node_solve_pivot(node, dir);
if (res != RES_OK) return res;
}
@@ -1060,7 +1060,7 @@ sanim_node_visit_tree
children = darray_children_data_get(&node->data->children);
for (i = 0; i < count; i++) {
struct sanim_node* child = children[i];
- res = visit_tree(child, dir, data, visitor, transform);
+ res = visit_tree(child, in_dir ? dir : NULL, data, visitor, transform);
if (res != RES_OK) return res;
}
return RES_OK;
diff --git a/src/sanim_node_c.h b/src/sanim_node_c.h
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_node.c b/src/test_sanim_node.c
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_node_pivot.c b/src/test_sanim_node_pivot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_node_transform.c b/src/test_sanim_node_transform.c
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_search.c b/src/test_sanim_search.c
@@ -1,5 +1,5 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_utils.c b/src/test_sanim_utils.c
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_utils.h b/src/test_sanim_utils.h
@@ -1,4 +1,4 @@
-/* Copyright (C) CNRS 2016
+/* Copyright (C) CNRS 2016-2017
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/test_sanim_visit.c b/src/test_sanim_visit.c
@@ -1,18 +1,17 @@
-
-/* Copyright (C) CNRS 2016
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* Copyright (C) CNRS 2016-2017
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sanim.h"
#include "test_sanim_utils.h"