Class: ege::ElementGame


Synopsis:

+                             ElementGame         (ege::Environement & _env);
+ ~ElementGame (void);
+ const std::string & getType (void);
+ bool init (property_te _property,
void * _value);
+ bool unInit (void);
+ uint32_t getUID (void);
+ bool loadMesh (const std::string & _meshFileName);
+ bool setMesh (ewol::Mesh * _mesh);
+ bool setShape (btCollisionShape * _shape);
+ ewol::Mesh * getMesh (void);
+ btCollisionShape * getShape (void);
+ float getLifeRatio (void);
+ bool isDead (void);
+ bool needToRemove (void);
+ void setFireOn (int32_t _groupIdSource,
int32_t _type,
float _power,
const vec3 & _center);
+ void onLifeChange (void);
+ int32_t getGroup (void);
+ void setGroup (int32_t _newGroup);
+ void preCalculationDraw (const ege::Camera & _camera);
+ void draw (int32_t _pass);
+ void drawLife (ewol::Colored3DObject * _draw,
const ege::Camera & _camera);
+ void drawDebug (ewol::Colored3DObject * _draw,
const ege::Camera & _camera);
+ vec3 getPositionTheoric (void);
+ void setPositionTheoric (const vec3 & _pos);
+ const vec3 & getPosition (void);
+ void setPosition (const vec3 & _pos);
+ const vec3 & getSpeed (void);
+ const float getInvMass (void);
+ void elementIsRemoved (ege::ElementGame * _removedElement);
+ bool isFixed (void);
+ float getRadius (void);
+ void dynamicEnable (void);
+ void dynamicDisable (void);
+ void iaEnable (void);
+ void iaDisable (void);
+ void iaAction (float _step);
+ void onDestroy (void);
- static void FunctionFreeShape (void * _pointer);
- void removeShape (void);

Detail:

ege::ElementGame ()

ElementGame(ege::Environement & _env);

Constructor (when constructer is called just add element that did not change. The objest will be stored in a pool of element and keep a second time if needed == > redure memory allocation, when needed, the system will call the init and un-init function...


ege::~ElementGame ()

~ElementGame(void);

Destructor


getType ()

const std::string & getType(void);

get the element Type description string.


init ()

bool init(property_te _property,
          void * _value);

init the element with the defined properties


unInit ()

bool unInit(void);



getUID ()

uint32_t getUID(void);

get the curent Element Unique ID in the all Game.


loadMesh ()

bool loadMesh(const std::string & _meshFileName);

Select a mesh with a specific name.
Notes: Automaticly load the shape if it is specify in the mesh file


setMesh ()

bool setMesh(ewol::Mesh * _mesh);

set the the Mesh properties.
Notes: : this remove the shape and the mesh properties.


setShape ()

bool setShape(btCollisionShape * _shape);

set the shape properties.
Notes: : this remove the shape properties.


getMesh ()

ewol::Mesh * getMesh(void);

get a pointer on the Mesh file.


getShape ()

btCollisionShape * getShape(void);

get a pointer on the bullet collision shape.


getLifeRatio ()

float getLifeRatio(void);

get the curent life ratio [0..1]


isDead ()

bool isDead(void);

Check if the element is dead.


needToRemove ()

bool needToRemove(void);

Request if the element might be removed from the system


setFireOn ()

void setFireOn(int32_t _groupIdSource,
               int32_t _type,
               float _power,
               const vec3 & _center);

apply a fire on the element at a current power and a specific power.


onLifeChange ()

void onLifeChange(void);

Call chan the element life change


getGroup ()

int32_t getGroup(void);

get the Group of the element.


setGroup ()

void setGroup(int32_t _newGroup);

set the group of the curent element


preCalculationDraw ()

void preCalculationDraw(const ege::Camera & _camera);

Can be call tu opdate the list of the element displayed on the scren (example : no display of the hiden triangle)


draw ()

void draw(int32_t _pass);

draw the curent element (can have multiple display)


drawLife ()

void drawLife(ewol::Colored3DObject * _draw,
              const ege::Camera & _camera);

draw the current life of the element


drawDebug ()

void drawDebug(ewol::Colored3DObject * _draw,
               const ege::Camera & _camera);

Debug display of the current element


getPositionTheoric ()

vec3 getPositionTheoric(void);

get the theoric position. Sometimes, the element has move due to an explosion or something else, then its real position in not the one that woult it be at the end ...


setPositionTheoric ()

void setPositionTheoric(const vec3 & _pos);

set the current Theoric position of the element


getPosition ()

const vec3 & getPosition(void);

get the current position of the element


setPosition ()

void setPosition(const vec3 & _pos);

set the current position of the element


getSpeed ()

const vec3 & getSpeed(void);

get the current speed of the element


getInvMass ()

const float getInvMass(void);

get the current mass of the element


elementIsRemoved ()

void elementIsRemoved(ege::ElementGame * _removedElement);

Event arrive when an element has been remove from the system == > this permit to keep pointer of ennemy, and not search them every cycle ...


isFixed ()

bool isFixed(void);

get the element if it is fixed or not. if the element is fixed this is for tower, and all thing does not really move


getRadius ()

float getRadius(void);

get the current space needed by the element in the workspace


dynamicEnable ()

void dynamicEnable(void);

set the elment in the physique engine


dynamicDisable ()

void dynamicDisable(void);

remove this element from the physique engine


iaEnable ()

void iaEnable(void);

enable periodic call Of this object for processing Artificial Intelligence


iaDisable ()

void iaDisable(void);

disable periodic call Of this object for processing Artificial Intelligence


iaAction ()

void iaAction(float _step);

periodic call for intelligence artificial.


onDestroy ()

void onDestroy(void);



ege::FunctionFreeShape ()

static void FunctionFreeShape(void * _pointer);



removeShape ()

void removeShape(void);

remove the curent selected shape.