nngn
Loading...
Searching...
No Matches
nngn::Colliders Struct Reference

#include <collision.h>

Collaboration diagram for nngn::Colliders:

Classes

struct  Backend
 

Public Types

using Stats = CollisionStats
 

Public Member Functions

 Colliders (const Colliders &)=delete
 
Collidersoperator= (const Colliders &)=delete
 
 Colliders (Colliders &&) noexcept=default
 
Collidersoperator= (Colliders &&) noexcept=default
 
 Colliders (void)
 
 ~Colliders (void)
 
auto & aabb (void) const
 
auto & bb (void) const
 
auto & sphere (void) const
 
auto & plane (void) const
 
auto & gravity (void) const
 
std::size_t max_colliders (void) const
 
std::size_t max_collisions (void) const
 
auto & collisions (void) const
 
bool check (void) const
 
bool resolve (void) const
 
bool has_backend (void) const
 
void set_check (bool b)
 
void set_resolve (bool b)
 
bool set_max_colliders (std::size_t n)
 
bool set_max_collisions (std::size_t n)
 
bool set_backend (std::unique_ptr< Backend > p)
 
AABBCollideradd (const AABBCollider &c)
 
BBCollideradd (const BBCollider &c)
 
SphereCollideradd (const SphereCollider &c)
 
PlaneCollideradd (const PlaneCollider &c)
 
GravityCollideradd (const GravityCollider &c)
 
Colliderload (nngn::lua::table_view t)
 
void remove (Collider *p)
 
void clear (void)
 
bool check_collisions (const Timing &t)
 
void resolve_collisions (void) const
 
bool lua_on_collision (nngn::lua::state_view lua)
 

Static Public Member Functions

static std::unique_ptr< Backendnative_backend ()
 
static std::unique_ptr< Backendcompute_backend (Compute *c)
 

Static Public Attributes

static constexpr std::size_t STATS_IDX = 1
 

Private Types

enum  Flag : uint8_t { CHECK = 1u << 0 , RESOLVE = 1u << 1 , MAX_COLLIDERS_UPDATED = 1u << 2 , MAX_COLLISIONS_UPDATED = 1u << 3 }
 

Private Attributes

Flags< Flagm_flags = {static_cast<Flag>(Flag::CHECK | Flag::RESOLVE)}
 
std::size_t m_max_colliders = 0
 
Backend::Input input = {}
 
Backend::Output output = {}
 
std::unique_ptr< Backendbackend = {}
 

Member Typedef Documentation

◆ Stats

Member Enumeration Documentation

◆ Flag

enum nngn::Colliders::Flag : uint8_t
private
Enumerator
CHECK 
RESOLVE 
MAX_COLLIDERS_UPDATED 
MAX_COLLISIONS_UPDATED 

Constructor & Destructor Documentation

◆ Colliders() [1/3]

nngn::Colliders::Colliders ( const Colliders & )
delete

◆ Colliders() [2/3]

nngn::Colliders::Colliders ( Colliders && )
defaultnoexcept

◆ Colliders() [3/3]

nngn::Colliders::Colliders ( void )
Here is the call graph for this function:

◆ ~Colliders()

nngn::Colliders::~Colliders ( void )
Here is the call graph for this function:

Member Function Documentation

◆ aabb()

auto & nngn::Colliders::aabb ( void ) const
inline

◆ add() [1/5]

AABBCollider * nngn::Colliders::add ( const AABBCollider & c)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add() [2/5]

BBCollider * nngn::Colliders::add ( const BBCollider & c)
Here is the call graph for this function:

◆ add() [3/5]

GravityCollider * nngn::Colliders::add ( const GravityCollider & c)
Here is the call graph for this function:

◆ add() [4/5]

PlaneCollider * nngn::Colliders::add ( const PlaneCollider & c)
Here is the call graph for this function:

◆ add() [5/5]

SphereCollider * nngn::Colliders::add ( const SphereCollider & c)
Here is the call graph for this function:

◆ bb()

auto & nngn::Colliders::bb ( void ) const
inline

◆ check()

bool nngn::Colliders::check ( void ) const
inline
Here is the call graph for this function:

◆ check_collisions()

bool nngn::Colliders::check_collisions ( const Timing & t)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void nngn::Colliders::clear ( void )
Here is the caller graph for this function:

◆ collisions()

auto & nngn::Colliders::collisions ( void ) const
inline
Here is the caller graph for this function:

◆ compute_backend()

auto nngn::Colliders::compute_backend ( Compute * c)
static
Here is the caller graph for this function:

◆ gravity()

auto & nngn::Colliders::gravity ( void ) const
inline

◆ has_backend()

bool nngn::Colliders::has_backend ( void ) const
inline

◆ load()

Collider * nngn::Colliders::load ( nngn::lua::table_view t)
Here is the call graph for this function:

◆ lua_on_collision()

bool nngn::Colliders::lua_on_collision ( nngn::lua::state_view lua)
Here is the call graph for this function:

◆ max_colliders()

std::size_t nngn::Colliders::max_colliders ( void ) const
inline

◆ max_collisions()

std::size_t nngn::Colliders::max_collisions ( void ) const
inline

◆ native_backend()

auto nngn::Colliders::native_backend ( )
static
Here is the caller graph for this function:

◆ operator=() [1/2]

Colliders & nngn::Colliders::operator= ( Colliders && )
defaultnoexcept

◆ operator=() [2/2]

Colliders & nngn::Colliders::operator= ( const Colliders & )
delete

◆ plane()

auto & nngn::Colliders::plane ( void ) const
inline
Here is the caller graph for this function:

◆ remove()

void nngn::Colliders::remove ( Collider * p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolve()

bool nngn::Colliders::resolve ( void ) const
inline
Here is the call graph for this function:

◆ resolve_collisions()

void nngn::Colliders::resolve_collisions ( void ) const
Here is the call graph for this function:

◆ set_backend()

bool nngn::Colliders::set_backend ( std::unique_ptr< Backend > p)
Here is the caller graph for this function:

◆ set_check()

void nngn::Colliders::set_check ( bool b)
inline
Here is the call graph for this function:

◆ set_max_colliders()

bool nngn::Colliders::set_max_colliders ( std::size_t n)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_max_collisions()

bool nngn::Colliders::set_max_collisions ( std::size_t n)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_resolve()

void nngn::Colliders::set_resolve ( bool b)
inline
Here is the call graph for this function:

◆ sphere()

auto & nngn::Colliders::sphere ( void ) const
inline

Member Data Documentation

◆ backend

std::unique_ptr<Backend> nngn::Colliders::backend = {}
private

◆ input

Backend::Input nngn::Colliders::input = {}
private

◆ m_flags

Flags<Flag> nngn::Colliders::m_flags = {static_cast<Flag>(Flag::CHECK | Flag::RESOLVE)}
private

◆ m_max_colliders

std::size_t nngn::Colliders::m_max_colliders = 0
private

◆ output

Backend::Output nngn::Colliders::output = {}
private

◆ STATS_IDX

std::size_t nngn::Colliders::STATS_IDX = 1
staticconstexpr

The documentation for this struct was generated from the following files: