+static void print_nodes(SceneNode *node, int lvl)
+{
+ Vec3 pos = node->get_node_position();
+ Quat rot = node->get_node_rotation();
+ Vec3 scale = node->get_node_scaling();
+
+ const char *type = node->get_num_objects() > 0 ? "mesh node" : "null node";
+
+ for(int i=0; i<lvl; i++) {
+ fputs(" ", stdout);
+ }
+ printf("%s[%s] p(%g %g %g) rq(%g %+gi %+gj %+gk) s(%g %g %g)\n", type, node->get_name(),
+ pos.x, pos.y, pos.z, rot.w, rot.x, rot.y, rot.z, scale.x, scale.y, scale.z);
+
+ if(node->get_num_objects()) {
+ Mat4 xform = node->get_matrix();
+ xform.print(stdout);
+ }
+
+ int nchld = node->get_num_children();
+ for(int i=0; i<nchld; i++) {
+ print_nodes(node->get_child(i), lvl + 1);
+ }
+}
+