Topaz 5.0
Topaz Game Engine
Loading...
Searching...
No Matches
hier.hpp
1#ifndef TOPAZ_CORE_HIER_HPP
2#define TOPAZ_CORE_HIER_HPP
3#include "tz/core/error.hpp"
4#include "tz/core/trs.hpp"
5#include "tz/core/handle.hpp"
6#include <expected>
7
8namespace tz
9{
10 namespace detail{struct hier_t{};}
23
44 std::expected<node_handle, tz::error_code> hier_create_node(hier_handle hier, tz::trs transform = {}, node_handle parent = tz::nullhand, void* userdata = nullptr);
57
64 std::expected<tz::trs, tz::error_code> hier_node_get_local_transform(hier_handle hier, node_handle node);
76 std::expected<tz::trs, tz::error_code> hier_node_get_global_transform(hier_handle hier, node_handle node);
82}
83
84#endif // TOPAZ_CORE_HIER_HPP
Represents a generic opaque handle.
Definition handle.hpp:32
std::expected< tz::trs, tz::error_code > hier_node_get_local_transform(hier_handle hier, node_handle node)
Retrieve the local transform of a node.
void hier_node_set_global_transform(hier_handle hier, node_handle node, tz::trs transform)
Set the global transform of a node.
std::expected< node_handle, tz::error_code > hier_create_node(hier_handle hier, tz::trs transform={}, node_handle parent=tz::nullhand, void *userdata=nullptr)
Create a new node within the hierarchy.
tz::handle< hier_handle > node_handle
Represents a single node within a hierarchy.
Definition hier.hpp:22
void hier_node_set_local_transform(hier_handle hier, node_handle node, tz::trs transform)
Set the local transform of a node.
void destroy_hier(hier_handle hier)
Destroy an existing hierarchy, along with all of its nodes.
hier_handle create_hier()
Create a new empty hierarchy.
tz::error_code hier_destroy_node(hier_handle hier, node_handle node)
Destroy a node within the hierarchy.
std::expected< tz::trs, tz::error_code > hier_node_get_global_transform(hier_handle hier, node_handle node)
Retrieve the global transform of a node.
error_code
Error codes for Topaz.
Definition error.hpp:14
constexpr nullhand_t nullhand
Definition handle.hpp:22
Encapsulates a combination of a Translation, Rotation, and Scale in 3D space.
Definition trs.hpp:46