class: ege::ElementGame


Description:



Constructor and Destructor:

+                                 ElementGame              (ege::Environement & _env);
+ virtual ~ElementGame (void );

Synopsis:

#         ege::Environement &     m_env;
# btRigidBody* m_body;
+ virtual const std::string & getType (void ) const;
+ virtual bool init (enum property _property,
void* _value);
+ virtual bool unInit (void );
+ uint32_t getUID (void ) const;
+ bool loadMesh (const std::string & _meshFileName);
+ bool setMesh (ege::resource::Mesh* _mesh);
+ bool setShape (btCollisionShape* _shape);
+ ege::resource::Mesh* getMesh (void );
+ btCollisionShape* getShape (void );
# float m_life;
# float m_lifeMax;
+ float getLifeRatio (void );
+ bool isDead (void );
+ virtual bool needToRemove (void );
+ virtual void setFireOn (int32_t _groupIdSource,
int32_t _type,
float _power,
const vec3 & _center);
+ virtual void onLifeChange (void );
# int32_t m_group;
+ int32_t getGroup (void ) const;
+ void setGroup (int32_t _newGroup);
+ virtual void preCalculationDraw (const ege::Camera & _camera);
+ virtual void draw (int32_t _pass);
+ virtual void drawLife (ewol::resource::Colored3DObject* _draw,
const ege::Camera & _camera);
# ewol::compositing::Text m_debugText;
+ virtual void drawDebug (ewol::resource::Colored3DObject* _draw,
const ege::Camera & _camera);
+ virtual vec3 getPositionTheoric (void );
+ virtual void setPositionTheoric (const vec3 & _pos);
+ const vec3 & getPosition (void );
+ void setPosition (const vec3 & _pos);
+ const vec3 & getSpeed (void );
+ const float getInvMass (void );
+ virtual void elementIsRemoved (ege::ElementGame* _removedElement);
# bool m_fixe;
+ bool isFixed (void );
# float m_radius;
+ float getRadius (void );
# bool m_elementInPhysicsSystem;
+ void dynamicEnable (void );
+ void dynamicDisable (void );
+ void iaEnable (void );
+ void iaDisable (void );
+ virtual void iaAction (float _step);
+ virtual void onDestroy (void );

Detail:

m_env

# ege::Environement & m_env;



m_body

# btRigidBody* m_body;
all the element have a body == > otherwise it will be not manage with this system...


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...


~ElementGame

+ virtual  ~ElementGame (void );
Destructor


getType

+ virtual const std::string & getType (void ) const;
get the element Type description string.


init

+ virtual bool init (enum property _property,
void* _value);
init the element with the defined properties


unInit

+ virtual bool unInit (void );



getUID

+ uint32_t getUID (void ) const;
get the curent Element Unique ID in the all Game.


loadMesh

+ bool loadMesh (const std::string & _meshFileName);
Select a mesh with a specific name.
Note: Automaticly load the shape if it is specify in the mesh file


setMesh

+ bool setMesh (ege::resource::Mesh* _mesh);
set the the Mesh properties.
Note: : this remove the shape and the mesh properties.


setShape

+ bool setShape (btCollisionShape* _shape);
set the shape properties.
Note: : this remove the shape properties.


getMesh

+ ege::resource::Mesh* getMesh (void );
get a pointer on the Mesh file.


getShape

+ btCollisionShape* getShape (void );
get a pointer on the bullet collision shape.


m_life

# float m_life;
Current life of the object


m_lifeMax

# float m_lifeMax;
Maximum possible life of the element


getLifeRatio

+ float getLifeRatio (void );
get the curent life ratio [0..1]


isDead

+ bool isDead (void );
Check if the element is dead.


needToRemove

+ virtual bool needToRemove (void );
Request if the element might be removed from the system


setFireOn

+ virtual 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

+ virtual void onLifeChange (void );
Call chan the element life change


m_group

# int32_t m_group;
Every element has a generic group


getGroup

+ int32_t getGroup (void ) const;
get the Group of the element.


setGroup

+ void setGroup (int32_t _newGroup);
set the group of the curent element


preCalculationDraw

+ virtual 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

+ virtual void draw (int32_t _pass);
draw the curent element (can have multiple display)


drawLife

+ virtual void drawLife (ewol::resource::Colored3DObject* _draw,
const ege::Camera & _camera);
draw the current life of the element


m_debugText

# ewol::compositing::Text m_debugText;



drawDebug

+ virtual void drawDebug (ewol::resource::Colored3DObject* _draw,
const ege::Camera & _camera);
Debug display of the current element


getPositionTheoric

+ virtual 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

+ virtual 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

+ virtual 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 ...


m_fixe

# bool m_fixe;
is a fixed element == > used for placement of every elements


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


m_radius

# float m_radius;
Radius of the element (all element have a radius, if == 0 ==> then ghost ...


getRadius

+ float getRadius (void );
get the current space needed by the element in the workspace


m_elementInPhysicsSystem

# bool m_elementInPhysicsSystem;



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

+ virtual void iaAction (float _step);
periodic call for intelligence artificial.


onDestroy

+ virtual void onDestroy (void );