Topaz 5.0
Topaz Game Engine
|
Represent transformations and hierarchies of transformations in 3D space.
Typedefs | |
using | tz::hier_handle = tz::handle<detail::hier_t> |
Represents a single hierarchy. | |
using | tz::node_handle = tz::handle<hier_handle> |
Represents a single node within a hierarchy. | |
Classes | |
struct | tz::trs |
Encapsulates a combination of a Translation, Rotation, and Scale in 3D space. More... | |
hier_handle tz::create_hier | ( | ) |
Create a new empty hierarchy.
void tz::destroy_hier | ( | hier_handle | hier | ) |
Destroy an existing hierarchy, along with all of its nodes.
std::expected< node_handle, tz::error_code > tz::hier_create_node | ( | hier_handle | hier, |
tz::trs | transform = {}, | ||
node_handle | parent = tz::nullhand, | ||
void * | userdata = nullptr ) |
Create a new node within the hierarchy.
hier | Hierarchy in which to create the node. |
transform | Initial local transform of the node. |
parent | Handle to a node which should be this new node's parent. |
userdata | User data to attach to the node. |
parent
is not a null handle, but also doesn't refer to a valid node within the hierarchy. For example, the node handle is invalid or has been destroyed. tz::error_code tz::hier_destroy_node | ( | hier_handle | hier, |
node_handle | node ) |
Destroy a node within the hierarchy.
Any children are also destroyed.
hier | Hierarchy in which the node is located. This must be the same handle used in the call to hier_create_node. |
node | Node to destroy. |
node
is invalid or has already been destroyed. std::expected< tz::trs, tz::error_code > tz::hier_node_get_local_transform | ( | hier_handle | hier, |
node_handle | node ) |
Retrieve the local transform of a node.
hier
or node
are invalid or have previously been destroyed. void tz::hier_node_set_local_transform | ( | hier_handle | hier, |
node_handle | node, | ||
tz::trs | transform ) |
Set the local transform of a node.
std::expected< tz::trs, tz::error_code > tz::hier_node_get_global_transform | ( | hier_handle | hier, |
node_handle | node ) |
Retrieve the global transform of a node.
hier
or node
are invalid or have previously been destroyed. void tz::hier_node_set_global_transform | ( | hier_handle | hier, |
node_handle | node, | ||
tz::trs | transform ) |
Set the global transform of a node.
Create a matrix that performs the given translation in 3D space.
Create a matrix that performs the given scale in 3D space.
tz::m4f tz::matrix_ortho | ( | float | left, |
float | right, | ||
float | top, | ||
float | bottom, | ||
float | near, | ||
float | far ) |
Create an orthographic projection matrix.
tz::m4f tz::matrix_persp | ( | float | fov, |
float | aspect_ratio, | ||
float | near, | ||
float | far ) |
Create a perspective projection matrix.
tz::m4f tz::matrix_persp_nofar | ( | float | fov, |
float | aspect_ratio, | ||
float | near ) |
Create a perspective projection matrix with an infinitely-distant far plane.
using tz::hier_handle = tz::handle<detail::hier_t> |
Represents a single hierarchy.
See create_hier for details.
using tz::node_handle = tz::handle<hier_handle> |
Represents a single node within a hierarchy.