Epok Engine

EPOK RUNTIME

epok::distance_squared_raw_2d

Function · 1 overload

Function

Squared distance in raw Q24; |position| <= 8192 keeps this inside 2^51.

Belongs to
epok
Header
world2d.hpp
Overloads
1

Declaration

Declaration
inline int64_t distance_squared_raw_2d(const Fixed* a, const Fixed* b)

Squared distance in raw Q24; |position| <= 8192 keeps this inside 2^51.

ParameterTypeMeaning
aconst Fixed *Value supplied for a. Keep referenced or pointed-to data valid for the complete call.
bconst Fixed *Value supplied for b. Keep referenced or pointed-to data valid for the complete call.

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

Example

C++ example
#include "world2d.hpp"

// Assume these named values have been initialized with valid data:
// const Fixed * a
// const Fixed * b

auto result = epok::distance_squared_raw_2d(a, b);

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

Related members