Epok Engine

EPOK RUNTIME

epok::aabb_may_touch

Function template · 1 overload

Function template

Performs `aabb may touch` as part of bounded AABB collision queries and movement.

Belongs to
epok
Header
collision.hpp
Overloads
1

Declaration

template
Declaration
template<class Number> inline bool aabb_may_touch(const AabbT<Number>& a,const AabbT<Number>& b)

Performs `aabb may touch` as part of bounded AABB collision queries and movement.

ParameterTypeMeaning
aconst AabbT<Number> &Value supplied for a. Keep referenced or pointed-to data valid for the complete call.
bconst AabbT<Number> &Value supplied for b. 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 "collision.hpp"

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

// Assume these named values have been initialized with valid data:
// const AabbT<Number> & a
// const AabbT<Number> & b

auto result = epok::aabb_may_touch<Number>(a, b);

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/collision.hpp:39

Related members