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.
Return: A reference on the descriptive string.
init ()
bool init(property_te _property,
void * _value);
init the element with the defined properties
Parameter [input]: _property Type of the next element
Parameter [input]: _value pointer on the value type
Return: true, the element is corectly initialized.
unInit ()
bool unInit(void);
getUID ()
uint32_t getUID(void);
get the curent Element Unique ID in the all Game.
Return: The requested Unique ID.
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
Parameter [input]: _meshFileName filename of the Mesh.
Return: true if no error occured
setMesh ()
bool setMesh(ewol::Mesh * _mesh);
set the the Mesh properties.
Notes: : this remove the shape and the mesh properties.
Parameter [input]: _mesh The mesh pointer. (NULL to force the mesh remove ...)
Return: true if no error occured
setShape ()
bool setShape(btCollisionShape * _shape);
set the shape properties.
Notes: : this remove the shape properties.
Parameter [input]: _shape The shape pointer.
Return: true if no error occured
getMesh ()
ewol::Mesh * getMesh(void);
get a pointer on the Mesh file.
Return: the mesh pointer.
getShape ()
btCollisionShape * getShape(void);
get a pointer on the bullet collision shape.
Return: the collision pointer.
getLifeRatio ()
float getLifeRatio(void);
get the curent life ratio [0..1]
Return: The proportionnal life
isDead ()
bool isDead(void);
Check if the element is dead.
Return: true if the element does not exist anymore, false otherwise.
needToRemove ()
bool needToRemove(void);
Request if the element might be removed from the system
Return: true == > the object is removed
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.
Parameter [input]: _groupIdSource Source Id of the group, by default all event arrive at all group, buf some event can not be obviously apply at the ennemy like reparing ....
Parameter [input]: _type Type of event on the life propertied
Parameter [input]: _power Power of the event (can be >0 for adding life).
Parameter [input]: _center Some fire decrease in function of space distance...
onLifeChange ()
void onLifeChange(void);
Call chan the element life change
getGroup ()
int32_t getGroup(void);
get the Group of the element.
Return: The group ID
setGroup ()
void setGroup(int32_t _newGroup);
set the group of the curent element
Parameter [input]: newGroup The new Group ID of the 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)
Parameter [input]: the camera properties
draw ()
void draw(int32_t _pass);
draw the curent element (can have multiple display)
Parameter [input]: pass Id of the current pass : [0..?]
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
Parameter [input] [output]: draw Basic system to draw the debug shape and informations
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 ...
Return: the theoric position
setPositionTheoric ()
void setPositionTheoric(const vec3 & _pos);
set the current Theoric position of the element
Parameter [input]: set the 3D position.
getPosition ()
const vec3 & getPosition(void);
get the current position of the element
Return: the 3D position.
setPosition ()
void setPosition(const vec3 & _pos);
set the current position of the element
Parameter [input]: _pos set the 3D position.
getSpeed ()
const vec3 & getSpeed(void);
get the current speed of the element
Return: the 3D speed.
getInvMass ()
const float getInvMass(void);
get the current mass of the element
Return: the mass in kG.
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 ...
Parameter [input]: _removedElement Pointer on the element removed.
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
Return: true : The element is fixed.
getRadius ()
float getRadius(void);
get the current space needed by the element in the workspace
Return: The dimention needed.
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.
Parameter [input]: step : step of time in s
onDestroy ()
void onDestroy(void);
ege::FunctionFreeShape ()
static void FunctionFreeShape(void * _pointer);
removeShape ()
void removeShape(void);
remove the curent selected shape.
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.
-
Return: A reference on the descriptive string.
init ()
bool init(property_te _property, void * _value);
init the element with the defined properties
-
Parameter [input]: _property Type of the next element
Parameter [input]: _value pointer on the value type
Return: true, the element is corectly initialized.
unInit ()
bool unInit(void);
getUID ()
uint32_t getUID(void);
get the curent Element Unique ID in the all Game.
-
Return: The requested Unique ID.
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
-
Parameter [input]: _meshFileName filename of the Mesh.
Return: true if no error occured
setMesh ()
bool setMesh(ewol::Mesh * _mesh);
set the the Mesh properties.
Notes: : this remove the shape and the mesh properties.
-
Parameter [input]: _mesh The mesh pointer. (NULL to force the mesh remove ...)
Return: true if no error occured
setShape ()
bool setShape(btCollisionShape * _shape);
set the shape properties.
Notes: : this remove the shape properties.
-
Parameter [input]: _shape The shape pointer.
Return: true if no error occured
getMesh ()
ewol::Mesh * getMesh(void);
get a pointer on the Mesh file.
-
Return: the mesh pointer.
getShape ()
btCollisionShape * getShape(void);
get a pointer on the bullet collision shape.
-
Return: the collision pointer.
getLifeRatio ()
float getLifeRatio(void);
get the curent life ratio [0..1]
-
Return: The proportionnal life
isDead ()
bool isDead(void);
Check if the element is dead.
-
Return: true if the element does not exist anymore, false otherwise.
needToRemove ()
bool needToRemove(void);
Request if the element might be removed from the system
-
Return: true == > the object is removed
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.
-
Parameter [input]: _groupIdSource Source Id of the group, by default all event arrive at all group, buf some event can not be obviously apply at the ennemy like reparing ....
Parameter [input]: _type Type of event on the life propertied
Parameter [input]: _power Power of the event (can be >0 for adding life).
Parameter [input]: _center Some fire decrease in function of space distance...
onLifeChange ()
void onLifeChange(void);
Call chan the element life change
getGroup ()
int32_t getGroup(void);
get the Group of the element.
-
Return: The group ID
setGroup ()
void setGroup(int32_t _newGroup);
set the group of the curent element
-
Parameter [input]: newGroup The new Group ID of the 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)
-
Parameter [input]: the camera properties
draw ()
void draw(int32_t _pass);
draw the curent element (can have multiple display)
-
Parameter [input]: pass Id of the current pass : [0..?]
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
-
Parameter [input] [output]: draw Basic system to draw the debug shape and informations
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 ...
-
Return: the theoric position
setPositionTheoric ()
void setPositionTheoric(const vec3 & _pos);
set the current Theoric position of the element
-
Parameter [input]: set the 3D position.
getPosition ()
const vec3 & getPosition(void);
get the current position of the element
-
Return: the 3D position.
setPosition ()
void setPosition(const vec3 & _pos);
set the current position of the element
-
Parameter [input]: _pos set the 3D position.
getSpeed ()
const vec3 & getSpeed(void);
get the current speed of the element
-
Return: the 3D speed.
getInvMass ()
const float getInvMass(void);
get the current mass of the element
-
Return: the mass in kG.
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 ...
-
Parameter [input]: _removedElement Pointer on the element removed.
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
-
Return: true : The element is fixed.
getRadius ()
float getRadius(void);
get the current space needed by the element in the workspace
-
Return: The dimention needed.
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.
-
Parameter [input]: step : step of time in s
onDestroy ()
void onDestroy(void);
ege::FunctionFreeShape ()
static void FunctionFreeShape(void * _pointer);
removeShape ()
void removeShape(void);
remove the curent selected shape.