Epok Engine

EPOK RUNTIME

epok::collider2d_center

Function · 1 overload

Function

World centre of a collider: the owner's world position plus the (unrotated) offset.

Belongs to
epok
Header
world2d.hpp
Overloads
1

Declaration

Declaration
inline void collider2d_center(const Collider2D& collider, const Fixed* world_xy, Fixed* out)

World centre of a collider: the owner's world position plus the (unrotated) offset.

ParameterTypeMeaning
colliderconst Collider2D &Value supplied for collider. Keep referenced or pointed-to data valid for the complete call.
world_xyconst Fixed *Value supplied for world_xy. Keep referenced or pointed-to data valid for the complete call.
outFixed *Value supplied for out. Keep referenced or pointed-to data valid for the complete call.

Returns: Nothing (void).

Example

C++ example
#include "world2d.hpp"

// Assume these named values have been initialized with valid data:
// const Collider2D & collider
// const Fixed * world_xy
// Fixed * out

epok::collider2d_center(collider, world_xy, out);

Why use it

It provides direct, allocation-conscious access to the world2d module. No exception-based error path is implied by the signature.

Trade-offs and warnings

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:337

Related members