Epok Engine

EPOK RUNTIME

epok::screen_to_world

Function · 1 overload

Function

Exact inverse of world_to_screen up to Q12 rounding.

Belongs to
epok
Header
world2d.hpp
Overloads
1

Declaration

Declaration
inline void screen_to_world(const Camera2D& camera, const Fixed* screen_xy, Fixed* world_xy)

Exact inverse of world_to_screen up to Q12 rounding.

ParameterTypeMeaning
cameraconst Camera2D &Value supplied for camera. Keep referenced or pointed-to data valid for the complete call.
screen_xyconst Fixed *Value supplied for screen_xy. Keep referenced or pointed-to data valid for the complete call.
world_xyFixed *Value supplied for world_xy. 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 Camera2D & camera
// const Fixed * screen_xy
// Fixed * world_xy

epok::screen_to_world(camera, screen_xy, world_xy);

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

Related members