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.
Return: | | A reference on the descriptive 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.
Return: | | The requested Unique ID. |
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
Parameter [input]: | _meshFileName | filename of the Mesh. |
Return: | | true if no error occured |
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.
Parameter [input]: | _shape | The shape pointer. |
Return: | | true if no error occured |
getMesh
+ ege::resource::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. |
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]
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
+ virtual bool needToRemove (void );
Request if the element might be removed from the system
Return: | | true == > the object is removed |
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.
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
+ 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)
Parameter [input]: | the | camera properties |
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 ...
Return: | | the theoric position |
setPositionTheoric
+ virtual 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
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
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
Return: | | true : The element is fixed. |
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
Return: | | The dimention needed. |
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.
Parameter [input]: | step | : step of time in s |
onDestroy
+ virtual void onDestroy (void );