Epok Engine

EPOK RUNTIME

epok::swept_bounds

Function template · 1 overload

Function template

Performs `swept bounds` as part of bounded AABB collision queries and movement.

Belongs to
epok
Header
collision.hpp
Overloads
1

Declaration

template
Declaration
template<class Number> inline AabbT<Number> swept_bounds(AabbT<Number> box,const Number* delta)

Performs `swept bounds` as part of bounded AABB collision queries and movement.

ParameterTypeMeaning
boxAabbT<Number>Value supplied for box. Keep referenced or pointed-to data valid for the complete call.
deltaconst Number *Value supplied for delta. Keep referenced or pointed-to data valid for the complete call.

Returns: AabbT<Number>. 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:
// AabbT<Number> box
// const Number * delta

auto result = epok::swept_bounds<Number>(box, delta);

Why use it

Template dispatch is resolved at compile time and normally adds no runtime indirection.

Trade-offs and warnings

Every instantiated type must satisfy the header's compile-time requirements; extra instantiations can increase code size. 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:43

Related members