Epok Engine

EPOK RUNTIME

epok::world_matrix_2d

Function template · 1 overload

Function template

World matrix of a SceneComponent2D by walking its attach_parent chain.

Belongs to
epok
Header
world2d.hpp
Overloads
1

Declaration

template
Declaration
template <class Resolver> inline bool world_matrix_2d(const SceneComponent2D& leaf, Resolver&& resolve, Affine2D& out)

World matrix of a SceneComponent2D by walking its attach_parent chain.

ParameterTypeMeaning
leafconst SceneComponent2D &Value supplied for leaf. Keep referenced or pointed-to data valid for the complete call.
resolveResolver &&Value supplied for resolve. Keep referenced or pointed-to data valid for the complete call.
outAffine2D &Value supplied for out. Keep referenced or pointed-to data valid for the complete call.

Returns: bool. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "world2d.hpp"

// Replace these template arguments with types or values accepted by the declaration:
// Resolver

// Assume these named values have been initialized with valid data:
// const SceneComponent2D & leaf
// Resolver && resolve
// Affine2D & out

auto result = epok::world_matrix_2d<Resolver>(leaf, resolve, out);

Why use it

Template dispatch is resolved at compile time and normally adds no runtime indirection. The boolean result makes success, availability or state explicit without exceptions.

Trade-offs and warnings

Every instantiated type must satisfy the header's compile-time requirements; extra instantiations can increase code size. Check the return value; `false` is part of normal control flow for many PSX resource operations. Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in runtime/world2d.hpp:185

Related members