Epok Engine

EPOK RUNTIME

epok::collider2d_overlap

Function · 1 overload

Function

Shape-aware pair test in world space.

Belongs to
epok
Header
world2d.hpp
Overloads
1

Declaration

Declaration
inline bool collider2d_overlap(const Collider2D& a, const Fixed* world_a, const Collider2D& b, const Fixed* world_b, bool inclusive = false)

Shape-aware pair test in world space.

ParameterTypeMeaning
aconst Collider2D &Value supplied for a. Keep referenced or pointed-to data valid for the complete call.
world_aconst Fixed *Value supplied for world_a. Keep referenced or pointed-to data valid for the complete call.
bconst Collider2D &Value supplied for b. Keep referenced or pointed-to data valid for the complete call.
world_bconst Fixed *Value supplied for world_b. Keep referenced or pointed-to data valid for the complete call.
inclusiveboolValue supplied for inclusive. 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"

// Assume these named values have been initialized with valid data:
// const Collider2D & a
// const Fixed * world_a
// const Collider2D & b
// const Fixed * world_b
// bool inclusive

auto result = epok::collider2d_overlap(a, world_a, b, world_b, inclusive);

Why use it

The boolean result makes success, availability or state explicit without exceptions.

Trade-offs and warnings

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

Related members