diff options
Diffstat (limited to 'src/transform_hierarchy.h')
-rw-r--r-- | src/transform_hierarchy.h | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/transform_hierarchy.h b/src/transform_hierarchy.h index 0a506de..808baab 100644 --- a/src/transform_hierarchy.h +++ b/src/transform_hierarchy.h @@ -31,48 +31,48 @@ typedef struct Transform_Node TF_Node; /** @brief Allocates and returns an empty transform hierarchy with a root node */ TransformHierarchy* TransformHierarchy_Create(); -/** - * @brief recursively frees all the children and then finally itself - * @note in the future we can use an object pool for the nodes - */ -void transform_hierarchy_free(transform_hierarchy* tfh); - -// --- Main usecase - -/** @brief Updates matrices of any invalidated nodes based on the `is_dirty` flag inside `transform` - */ -void transform_hierarchy_propagate_transforms(transform_hierarchy* tfh); - -// --- Queries - -/** @brief Get a pointer to the root node */ -Transform_Node* TransformHierarchy_RootNode(TransformHierarchy* tfh); - -// --- Mutations -Transform_Node* TransformHierarchy_AddNode(transform_node* parent, ModelHandle model, - Transform tf); -void transform_hierarchy_delete_node(transform_node* node); - -// --- Traversal - -/** - * @brief Perform a depth-first search traversal starting from `start_node`. - * @param start_node The starting node of the traversal. - * @param visit_node The function to call for each node visited. The callback should return false to - stop the traversal early. - * @param is_pre_order Indicates whether to do pre-order or post-order traversal i.e. when to call - the `visit_node` function. - * @param ctx_data An optional pointer to data that is be passed on each call to `visit_node`. Can - be used to carry additional information or context. - * - * @note The main use-cases are: - 1. traversing the whole tree to update cached 4x4 affine transform matrices (post-order) - 2. freeing child nodes after deleting a node in the tree (post-order) - 3. debug pretty printing the whole tree (post-order) - */ -void transform_hierarchy_dfs(transform_node* start_node, - bool (*visit_node)(transform_node* node, void* ctx_data), - bool is_pre_order, void* ctx_data); - -struct Core; -void transform_hierarchy_debug_print(transform_node* start_node, struct Core* core); +// /** +// * @brief recursively frees all the children and then finally itself +// * @note in the future we can use an object pool for the nodes +// */ +// void transform_hierarchy_free(transform_hierarchy* tfh); + +// // --- Main usecase + +// /** @brief Updates matrices of any invalidated nodes based on the `is_dirty` flag inside `transform` +// */ +// void transform_hierarchy_propagate_transforms(transform_hierarchy* tfh); + +// // --- Queries + +// /** @brief Get a pointer to the root node */ +// Transform_Node* TransformHierarchy_RootNode(TransformHierarchy* tfh); + +// // --- Mutations +// Transform_Node* TransformHierarchy_AddNode(transform_node* parent, ModelHandle model, +// Transform tf); +// void transform_hierarchy_delete_node(transform_node* node); + +// // --- Traversal + +// /** +// * @brief Perform a depth-first search traversal starting from `start_node`. +// * @param start_node The starting node of the traversal. +// * @param visit_node The function to call for each node visited. The callback should return false to +// stop the traversal early. +// * @param is_pre_order Indicates whether to do pre-order or post-order traversal i.e. when to call +// the `visit_node` function. +// * @param ctx_data An optional pointer to data that is be passed on each call to `visit_node`. Can +// be used to carry additional information or context. +// * +// * @note The main use-cases are: +// 1. traversing the whole tree to update cached 4x4 affine transform matrices (post-order) +// 2. freeing child nodes after deleting a node in the tree (post-order) +// 3. debug pretty printing the whole tree (post-order) +// */ +// void transform_hierarchy_dfs(transform_node* start_node, +// bool (*visit_node)(transform_node* node, void* ctx_data), +// bool is_pre_order, void* ctx_data); + +// struct Core; +// void transform_hierarchy_debug_print(transform_node* start_node, struct Core* core); |