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
 
using Stats = CollisionStats
 

Public Member Functions

 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)
 
 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 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 ,
  CHECK = 1u << 0 , RESOLVE = 1u << 1 , MAX_COLLIDERS_UPDATED = 1u << 2 , MAX_COLLISIONS_UPDATED = 1u << 3
}
 
enum  Flag : uint8_t {
  CHECK = 1u << 0 , RESOLVE = 1u << 1 , MAX_COLLIDERS_UPDATED = 1u << 2 , MAX_COLLISIONS_UPDATED = 1u << 3 ,
  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 [1/2]

◆ Stats [2/2]

Member Enumeration Documentation

◆ Flag [1/2]

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

◆ Flag [2/2]

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

Constructor & Destructor Documentation

◆ Colliders() [1/2]

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

◆ ~Colliders() [1/2]

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

◆ Colliders() [2/2]

nngn::Colliders::Colliders ( void  )

◆ ~Colliders() [2/2]

nngn::Colliders::~Colliders ( void  )

Member Function Documentation

◆ aabb() [1/2]

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

◆ aabb() [2/2]

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

◆ add() [1/10]

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/10]

AABBCollider * nngn::Colliders::add ( const AABBCollider c)

◆ add() [3/10]

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

◆ add() [4/10]

BBCollider * nngn::Colliders::add ( const BBCollider c)

◆ add() [5/10]

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

◆ add() [6/10]

GravityCollider * nngn::Colliders::add ( const GravityCollider c)

◆ add() [7/10]

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

◆ add() [8/10]

PlaneCollider * nngn::Colliders::add ( const PlaneCollider c)

◆ add() [9/10]

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

◆ add() [10/10]

SphereCollider * nngn::Colliders::add ( const SphereCollider c)

◆ bb() [1/2]

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

◆ bb() [2/2]

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

◆ check() [1/2]

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

◆ check() [2/2]

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

◆ check_collisions() [1/2]

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

◆ check_collisions() [2/2]

bool nngn::Colliders::check_collisions ( const Timing t)

◆ clear() [1/2]

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

◆ clear() [2/2]

void nngn::Colliders::clear ( void  )

◆ collisions() [1/2]

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

◆ collisions() [2/2]

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

◆ compute_backend() [1/2]

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

◆ compute_backend() [2/2]

static std::unique_ptr< Backend > nngn::Colliders::compute_backend ( Compute c)
static

◆ gravity() [1/2]

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

◆ gravity() [2/2]

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

◆ has_backend() [1/2]

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

◆ has_backend() [2/2]

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

◆ load() [1/2]

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

◆ load() [2/2]

Collider * nngn::Colliders::load ( nngn::lua::table_view  t)

◆ lua_on_collision() [1/2]

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

◆ lua_on_collision() [2/2]

bool nngn::Colliders::lua_on_collision ( nngn::lua::state_view  lua)

◆ max_colliders() [1/2]

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

◆ max_colliders() [2/2]

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

◆ max_collisions() [1/2]

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

◆ max_collisions() [2/2]

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

◆ native_backend() [1/2]

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

◆ native_backend() [2/2]

static std::unique_ptr< Backend > nngn::Colliders::native_backend ( )
static

◆ plane() [1/2]

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

◆ plane() [2/2]

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

◆ remove() [1/2]

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

◆ remove() [2/2]

void nngn::Colliders::remove ( Collider p)

◆ resolve() [1/2]

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

◆ resolve() [2/2]

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

◆ resolve_collisions() [1/2]

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

◆ resolve_collisions() [2/2]

void nngn::Colliders::resolve_collisions ( void  ) const

◆ set_backend() [1/2]

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

◆ set_backend() [2/2]

bool nngn::Colliders::set_backend ( std::unique_ptr< Backend p)

◆ set_check() [1/2]

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

◆ set_check() [2/2]

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

◆ set_max_colliders() [1/2]

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

◆ set_max_colliders() [2/2]

bool nngn::Colliders::set_max_colliders ( std::size_t  n)

◆ set_max_collisions() [1/2]

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

◆ set_max_collisions() [2/2]

bool nngn::Colliders::set_max_collisions ( std::size_t  n)

◆ set_resolve() [1/2]

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

◆ set_resolve() [2/2]

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

◆ sphere() [1/2]

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

◆ sphere() [2/2]

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

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

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