Topaz 5.0
Topaz Game Engine
Loading...
Searching...
No Matches

Description

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...
 

Function Documentation

◆ create_hier()

hier_handle tz::create_hier ( )

Create a new empty hierarchy.

◆ destroy_hier()

void tz::destroy_hier ( hier_handle hier)

Destroy an existing hierarchy, along with all of its nodes.

◆ hier_create_node()

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.

Parameters
hierHierarchy in which to create the node.
transformInitial local transform of the node.
parentHandle to a node which should be this new node's parent.
userdataUser data to attach to the node.
Returns
tz::error_code::invalid_value If 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.

◆ hier_destroy_node()

tz::error_code tz::hier_destroy_node ( hier_handle hier,
node_handle node )

Destroy a node within the hierarchy.

Any children are also destroyed.

Parameters
hierHierarchy in which the node is located. This must be the same handle used in the call to hier_create_node.
nodeNode to destroy.
Returns
tz::error_code::invalid_value If node is invalid or has already been destroyed.
tz::error_code::unknown_error If destruction of a child node failed.

◆ hier_node_get_local_transform()

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.

Returns
tz::error_code::invalid_value If hier or node are invalid or have previously been destroyed.

◆ hier_node_set_local_transform()

void tz::hier_node_set_local_transform ( hier_handle hier,
node_handle node,
tz::trs transform )

Set the local transform of a node.

◆ hier_node_get_global_transform()

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.

Returns
tz::error_code::invalid_value If hier or node are invalid or have previously been destroyed.

◆ hier_node_set_global_transform()

void tz::hier_node_set_global_transform ( hier_handle hier,
node_handle node,
tz::trs transform )

Set the global transform of a node.

◆ matrix_translate()

tz::m4f tz::matrix_translate ( tz::v3f translate)

Create a matrix that performs the given translation in 3D space.

◆ matrix_scale()

tz::m4f tz::matrix_scale ( tz::v3f scale)

Create a matrix that performs the given scale in 3D space.

◆ matrix_ortho()

tz::m4f tz::matrix_ortho ( float left,
float right,
float top,
float bottom,
float near,
float far )

Create an orthographic projection matrix.

◆ matrix_persp()

tz::m4f tz::matrix_persp ( float fov,
float aspect_ratio,
float near,
float far )

Create a perspective projection matrix.

◆ matrix_persp_nofar()

tz::m4f tz::matrix_persp_nofar ( float fov,
float aspect_ratio,
float near )

Create a perspective projection matrix with an infinitely-distant far plane.

Typedef Documentation

◆ hier_handle

using tz::hier_handle = tz::handle<detail::hier_t>

Represents a single hierarchy.

See create_hier for details.

◆ node_handle

Represents a single node within a hierarchy.