CellModules
|
Basis for every cell a user might want to use. More...
#include <basecell.hpp>
Public Types | |
using | body_t = Body< Derived > |
using | embedded_plugin_t = typename body_t::embedded_plugin_t |
using | vec_t = decltype((body_t) nullptr->getPosition()) |
Public Member Functions | |
BaseCell (const Derived &c) | |
BaseCell (const vec_t &pos) | |
size_t | getId () |
void | die () |
bool | isDead () |
vec_t | getPosition () |
Public Attributes | |
friend | body_t |
friend | embedded_plugin_t |
size_t | id = 0 |
Protected Attributes | |
body_t | body |
bool | dead = false |
Basis for every cell a user might want to use.
It uses the curriously reccuring template pattern : Derived is the user's type inheriting BaseCell. Body is the type of body used by the cell. A body is a low level class that handles everything related to physics (deformations, connections, volume). A BaseCell and the classes that inherit from it is a more abstract and general interface meant to expose higher instinctive, meaningful parameters and methods.
Body | the body implementation (which contains most of the core logic) |
Definition at line 22 of file basecell.hpp.
using BaseCell< Derived, Body >::body_t = Body<Derived> |
Definition at line 24 of file basecell.hpp.
using BaseCell< Derived, Body >::embedded_plugin_t = typename body_t::embedded_plugin_t |
Definition at line 25 of file basecell.hpp.
using BaseCell< Derived, Body >::vec_t = decltype((body_t) nullptr->getPosition()) |
Definition at line 26 of file basecell.hpp.
|
inline |
Definition at line 39 of file basecell.hpp.
|
inline |
Definition at line 40 of file basecell.hpp.
|
inline |
Definition at line 53 of file basecell.hpp.
|
inline |
Definition at line 48 of file basecell.hpp.
|
inline |
Definition at line 55 of file basecell.hpp.
|
inline |
Definition at line 54 of file basecell.hpp.
|
protected |
Definition at line 32 of file basecell.hpp.
friend BaseCell< Derived, Body >::body_t |
Definition at line 28 of file basecell.hpp.
|
protected |
Definition at line 33 of file basecell.hpp.
friend BaseCell< Derived, Body >::embedded_plugin_t |
Definition at line 29 of file basecell.hpp.
size_t BaseCell< Derived, Body >::id = 0 |
Definition at line 47 of file basecell.hpp.