[DEV] integarate std x11

This commit is contained in:
Edouard DUPIN 2013-11-11 20:18:14 +01:00
parent a52c92e96f
commit 1d10f95332
11 changed files with 83 additions and 83 deletions

View File

@ -31,7 +31,7 @@ btCollisionShape* ege::collision::createShape(const ewol::Mesh* _mesh) {
if (NULL == _mesh) { if (NULL == _mesh) {
return new btEmptyShape();; return new btEmptyShape();;
} }
const etk::Vector<ewol::PhysicsShape*>& physiqueProperty = _mesh->getPhysicalProperties(); const std::vector<ewol::PhysicsShape*>& physiqueProperty = _mesh->getPhysicalProperties();
if (physiqueProperty.size() == 0) { if (physiqueProperty.size() == 0) {
return new btEmptyShape();; return new btEmptyShape();;
} }

View File

@ -29,8 +29,8 @@
#undef __class__ #undef __class__
#define __class__ "ElementGame" #define __class__ "ElementGame"
const etk::UString& ege::ElementGame::getType(void) const { const std::string& ege::ElementGame::getType(void) const {
static const etk::UString nameType("----"); static const std::string nameType("----");
return nameType; return nameType;
} }
@ -96,7 +96,7 @@ void ege::ElementGame::FunctionFreeShape(void* _pointer) {
delete(static_cast<btCollisionShape*>(_pointer)); delete(static_cast<btCollisionShape*>(_pointer));
} }
bool ege::ElementGame::loadMesh(const etk::UString& _meshFileName) { bool ege::ElementGame::loadMesh(const std::string& _meshFileName) {
ewol::Mesh* tmpMesh=NULL; ewol::Mesh* tmpMesh=NULL;
tmpMesh = ewol::Mesh::keep(_meshFileName); tmpMesh = ewol::Mesh::keep(_meshFileName);
if(NULL == tmpMesh) { if(NULL == tmpMesh) {
@ -191,7 +191,7 @@ static void drawSphere(ewol::Colored3DObject* _draw,
mat4& _transformationMatrix, mat4& _transformationMatrix,
etk::Color<float>& _tmpColor) { etk::Color<float>& _tmpColor) {
int i, j; int i, j;
etk::Vector<vec3> EwolVertices; std::vector<vec3> EwolVertices;
for(i = 0; i <= _lats; i++) { for(i = 0; i <= _lats; i++) {
btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / _lats); btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / _lats);
btScalar z0 = _radius*sin(lat0); btScalar z0 = _radius*sin(lat0);
@ -215,13 +215,13 @@ static void drawSphere(ewol::Colored3DObject* _draw,
vec3 v2 = vec3(x * zr1, y * zr1, z1); vec3 v2 = vec3(x * zr1, y * zr1, z1);
vec3 v3 = vec3(x * zr0, y * zr0, z0); vec3 v3 = vec3(x * zr0, y * zr0, z0);
EwolVertices.pushBack(v1); EwolVertices.push_back(v1);
EwolVertices.pushBack(v2); EwolVertices.push_back(v2);
EwolVertices.pushBack(v3); EwolVertices.push_back(v3);
EwolVertices.pushBack(v1); EwolVertices.push_back(v1);
EwolVertices.pushBack(v3); EwolVertices.push_back(v3);
EwolVertices.pushBack(v4); EwolVertices.push_back(v4);
} }
} }
_draw->draw(EwolVertices, _tmpColor, _transformationMatrix); _draw->draw(EwolVertices, _tmpColor, _transformationMatrix);
@ -243,23 +243,23 @@ void ege::ElementGame::drawLife(ewol::Colored3DObject* _draw, const ege::Camera&
mat4 transformationMatrix = etk::matTranslate(getPosition()) mat4 transformationMatrix = etk::matTranslate(getPosition())
* etk::matRotate(vec3(0,0,1),_camera.getAngleZ()) * etk::matRotate(vec3(0,0,1),_camera.getAngleZ())
* etk::matRotate(vec3(1,0,0),(M_PI/2.0f-_camera.getAngleTeta())); * etk::matRotate(vec3(1,0,0),(M_PI/2.0f-_camera.getAngleTeta()));
etk::Vector<vec3> localVertices; std::vector<vec3> localVertices;
localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0)); localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0));
localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0)); localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0));
localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0)); localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos -lifeBorder,0)); localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos -lifeBorder,0));
etk::Color<float> myColor(0x0000FF99); etk::Color<float> myColor(0x0000FF99);
_draw->draw(localVertices, myColor, transformationMatrix, false, false); _draw->draw(localVertices, myColor, transformationMatrix, false, false);
localVertices.clear(); localVertices.clear();
/** Bounding box == > model shape **/ /** Bounding box == > model shape **/
localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos,0)); localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos,0));
localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos + lifeHeight,0)); localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos + lifeHeight,0));
localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0)); localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0));
localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos,0)); localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos,0));
localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0)); localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0));
localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos,0)); localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos,0));
myColor =0x00FF00FF; myColor =0x00FF00FF;
if (ratio < 0.2f) { if (ratio < 0.2f) {
myColor = 0xFF0000FF; myColor = 0xFF0000FF;
@ -272,7 +272,7 @@ void ege::ElementGame::drawLife(ewol::Colored3DObject* _draw, const ege::Camera&
static void drawShape(const btCollisionShape* _shape, static void drawShape(const btCollisionShape* _shape,
ewol::Colored3DObject* _draw, ewol::Colored3DObject* _draw,
mat4 _transformationMatrix, mat4 _transformationMatrix,
etk::Vector<vec3> _tmpVertices) { std::vector<vec3> _tmpVertices) {
if( NULL == _draw if( NULL == _draw
|| NULL == _shape) { || NULL == _shape) {
return; return;
@ -312,9 +312,9 @@ static void drawShape(const btCollisionShape* _shape,
// normal calculation : // normal calculation :
//btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]); //btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]);
//normal.normalize (); //normal.normalize ();
_tmpVertices.pushBack(vertices[indices[iii]]); _tmpVertices.push_back(vertices[indices[iii]]);
_tmpVertices.pushBack(vertices[indices[iii+1]]); _tmpVertices.push_back(vertices[indices[iii+1]]);
_tmpVertices.pushBack(vertices[indices[iii+2]]); _tmpVertices.push_back(vertices[indices[iii+2]]);
} }
_draw->draw(_tmpVertices, tmpColor, _transformationMatrix); _draw->draw(_tmpVertices, tmpColor, _transformationMatrix);
break; break;
@ -443,8 +443,8 @@ void ege::ElementGame::drawDebug(ewol::Colored3DObject* _draw, const ege::Camera
m_debugText.setPos(vec3(-20,32,0)); m_debugText.setPos(vec3(-20,32,0));
m_debugText.print(getType()); m_debugText.print(getType());
m_debugText.setPos(vec3(-20,20,0)); m_debugText.setPos(vec3(-20,20,0));
m_debugText.print(etk::UString("life=(")+etk::UString(getLifeRatio())); m_debugText.print(std::string("life=(")+std::string(getLifeRatio()));
//m_debugText.print(etk::UString("Axe=(")+etk::UString(m_tmpAxe.x())+etk::UString(",")+etk::UString(m_tmpAxe.y())+etk::UString(",")+etk::UString(m_tmpAxe.z())+etk::UString(")")); //m_debugText.print(std::string("Axe=(")+std::string(m_tmpAxe.x())+std::string(",")+etk::UString(m_tmpAxe.y())+etk::UString(",")+etk::UString(m_tmpAxe.z())+etk::UString(")"));
btScalar mmm[16]; btScalar mmm[16];
btDefaultMotionState* myMotionState = (btDefaultMotionState*)m_body->getMotionState(); btDefaultMotionState* myMotionState = (btDefaultMotionState*)m_body->getMotionState();
myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(mmm); myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(mmm);
@ -453,7 +453,7 @@ void ege::ElementGame::drawDebug(ewol::Colored3DObject* _draw, const ege::Camera
transformationMatrix.transpose(); transformationMatrix.transpose();
// note : set the vertice here to prevent multiple allocations... // note : set the vertice here to prevent multiple allocations...
etk::Vector<vec3> EwolVertices; std::vector<vec3> EwolVertices;
drawShape(m_shape, _draw, transformationMatrix, EwolVertices); drawShape(m_shape, _draw, transformationMatrix, EwolVertices);
m_debugText.draw( etk::matTranslate(getPosition()) m_debugText.draw( etk::matTranslate(getPosition())

View File

@ -12,7 +12,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/math/Vector3D.h> #include <etk/math/Vector3D.h>
#include <etk/math/Matrix4.h> #include <etk/math/Matrix4.h>
#include <etk/Vector.h> #include <vector>
#include <ewol/debug.h> #include <ewol/debug.h>
#include <ewol/widget/Widget.h> #include <ewol/widget/Widget.h>
#include <ewol/renderer/openGL.h> #include <ewol/renderer/openGL.h>
@ -52,7 +52,7 @@ namespace ege
* @brief get the element Type description string. * @brief get the element Type description string.
* @return A reference on the descriptive string. * @return A reference on the descriptive string.
*/ */
virtual const etk::UString& getType(void) const; virtual const std::string& getType(void) const;
/** /**
* @brief init the element with the defined properties * @brief init the element with the defined properties
* @param[in] _property Type of the next element * @param[in] _property Type of the next element
@ -85,7 +85,7 @@ namespace ege
* @note Automaticly load the shape if it is specify in the mesh file * @note Automaticly load the shape if it is specify in the mesh file
* @return true if no error occured * @return true if no error occured
*/ */
bool loadMesh(const etk::UString& _meshFileName); bool loadMesh(const std::string& _meshFileName);
/** /**
* @brief set the the Mesh properties. * @brief set the the Mesh properties.
* @param[in] _mesh The mesh pointer. (NULL to force the mesh remove ...) * @param[in] _mesh The mesh pointer. (NULL to force the mesh remove ...)

View File

@ -48,7 +48,7 @@ ege::ElementGame* ege::Environement::getElementNearest(ege::ElementGame* _source
void ege::Environement::getElementNearest(const vec3& _sourcePosition, void ege::Environement::getElementNearest(const vec3& _sourcePosition,
float _distanceMax, float _distanceMax,
etk::Vector<ege::Environement::ResultNearestElement>& _resultList) { std::vector<ege::Environement::ResultNearestElement>& _resultList) {
_resultList.clear(); _resultList.clear();
ege::Environement::ResultNearestElement result; ege::Environement::ResultNearestElement result;
result.dist = 99999999999.0f; result.dist = 99999999999.0f;
@ -67,14 +67,14 @@ void ege::Environement::getElementNearest(const vec3& _sourcePosition,
result.dist = btDistance(_sourcePosition, destPosition); result.dist = btDistance(_sourcePosition, destPosition);
//EGE_DEBUG("Distance : " << _distance << " >? " << distance << " id=" << iii); //EGE_DEBUG("Distance : " << _distance << " >? " << distance << " id=" << iii);
if (_distanceMax>result.dist) { if (_distanceMax>result.dist) {
_resultList.pushBack(result); _resultList.push_back(result);
} }
} }
} }
void ege::Environement::getElementNearestFixed(const vec3& _sourcePosition, void ege::Environement::getElementNearestFixed(const vec3& _sourcePosition,
float _distanceMax, float _distanceMax,
etk::Vector<ege::Environement::ResultNearestElement>& _resultList) { std::vector<ege::Environement::ResultNearestElement>& _resultList) {
_resultList.clear(); _resultList.clear();
ege::Environement::ResultNearestElement result; ege::Environement::ResultNearestElement result;
result.dist = 99999999999.0f; result.dist = 99999999999.0f;
@ -105,7 +105,7 @@ void ege::Environement::getElementNearestFixed(const vec3& _sourcePosition,
} }
// add element at the end : // add element at the end :
if (jjj >= _resultList.size()) { if (jjj >= _resultList.size()) {
_resultList.pushBack(result); _resultList.push_back(result);
} }
} }
} }
@ -115,7 +115,7 @@ static etk::Hash<ege::createElement_tf>& getHachTableCreating(void) {
return s_table; return s_table;
} }
void ege::Environement::addCreator(const etk::UString& _type, ege::createElement_tf _creator) { void ege::Environement::addCreator(const std::string& _type, ege::createElement_tf _creator) {
if (NULL == _creator) { if (NULL == _creator) {
EGE_ERROR("Try to add an empty CREATOR ..."); EGE_ERROR("Try to add an empty CREATOR ...");
return; return;
@ -127,7 +127,7 @@ void ege::Environement::addCreator(const etk::UString& _type, ege::createElement
getHachTableCreating().add(_type, _creator); getHachTableCreating().add(_type, _creator);
} }
ege::ElementGame* ege::Environement::createElement(const etk::UString& _type, bool _autoAddElement, ege::property_te _property, void* _value) { ege::ElementGame* ege::Environement::createElement(const std::string& _type, bool _autoAddElement, ege::property_te _property, void* _value) {
if (false == getHachTableCreating().exist(_type)) { if (false == getHachTableCreating().exist(_type)) {
EGE_ERROR("Request creating of an type that is not known '" << _type << "'"); EGE_ERROR("Request creating of an type that is not known '" << _type << "'");
return NULL; return NULL;
@ -154,15 +154,15 @@ ege::ElementGame* ege::Environement::createElement(const etk::UString& _type, bo
return tmpElement; return tmpElement;
} }
ege::ElementGame* ege::Environement::createElement(const etk::UString& _type, etk::UString& _description, bool _autoAddElement) { ege::ElementGame* ege::Environement::createElement(const std::string& _type, std::string& _description, bool _autoAddElement) {
return createElement(_type, _autoAddElement, ege::typeString, static_cast<void*>(&_description)); return createElement(_type, _autoAddElement, ege::typeString, static_cast<void*>(&_description));
} }
ege::ElementGame* ege::Environement::createElement(const etk::UString& _type, ejson::Value* _value, bool _autoAddElement) { ege::ElementGame* ege::Environement::createElement(const std::string& _type, ejson::Value* _value, bool _autoAddElement) {
return createElement(_type, _autoAddElement, ege::typeJson, static_cast<void*>(_value)); return createElement(_type, _autoAddElement, ege::typeJson, static_cast<void*>(_value));
} }
ege::ElementGame* ege::Environement::createElement(const etk::UString& _type, exml::Node* _node, bool _autoAddElement) { ege::ElementGame* ege::Environement::createElement(const std::string& _type, exml::Node* _node, bool _autoAddElement) {
return createElement(_type, _autoAddElement, ege::typeXml, static_cast<void*>(_node)); return createElement(_type, _autoAddElement, ege::typeXml, static_cast<void*>(_node));
} }
@ -179,7 +179,7 @@ void ege::Environement::addElementGame(ege::ElementGame* _newElement) {
return; return;
} }
} }
m_listElementGame.pushBack(_newElement); m_listElementGame.push_back(_newElement);
_newElement->dynamicEnable(); _newElement->dynamicEnable();
} }
@ -206,7 +206,7 @@ void ege::Environement::rmElementGame(ege::ElementGame* _removeElement) {
} }
void ege::Environement::getOrderedElementForDisplay(etk::Vector<ege::Environement::ResultNearestElement>& _resultList, void ege::Environement::getOrderedElementForDisplay(std::vector<ege::Environement::ResultNearestElement>& _resultList,
const vec3& _position, const vec3& _position,
const vec3& _direction) { const vec3& _direction) {
// remove all unneeded elements (old display...) // remove all unneeded elements (old display...)
@ -247,7 +247,7 @@ void ege::Environement::getOrderedElementForDisplay(etk::Vector<ege::Environemen
} }
// add element at the end : // add element at the end :
if (jjj >= _resultList.size()) { if (jjj >= _resultList.size()) {
_resultList.pushBack(result); _resultList.push_back(result);
} }
} }
} }

View File

@ -19,7 +19,7 @@ namespace ege {
#include <BulletDynamics/Dynamics/btActionInterface.h> #include <BulletDynamics/Dynamics/btActionInterface.h>
class btDynamicsWorld; class btDynamicsWorld;
#include <etk/Vector.h> #include <vector>
#include <etk/math/Vector3D.h> #include <etk/math/Vector3D.h>
#include <ejson/ejson.h> #include <ejson/ejson.h>
#include <exml/exml.h> #include <exml/exml.h>
@ -28,7 +28,7 @@ class btDynamicsWorld;
namespace ege { namespace ege {
typedef enum { typedef enum {
typeNone, //!< no element property typeNone, //!< no element property
typeString, //!< type element static_cast<etk::UString*>(xxxxxxx) typeString, //!< type element static_cast<std::string*>(xxxxxxx)
typeJson, //!< type element static_cast<ejson::Value*>(xxxxxxx) typeJson, //!< type element static_cast<ejson::Value*>(xxxxxxx)
typeXml, //!< type element static_cast<exml::Node*>(xxxxxxx) typeXml, //!< type element static_cast<exml::Node*>(xxxxxxx)
typeUser1, //!< user type 1 typeUser1, //!< user type 1
@ -48,10 +48,10 @@ namespace ege {
public: public:
int32_t getSourceGroup(void) { return m_groupSource; }; int32_t getSourceGroup(void) { return m_groupSource; };
protected: protected:
etk::Vector<int32_t> m_groupDestination; std::vector<int32_t> m_groupDestination;
public: public:
const etk::Vector<int32_t>& getDestinationGroup(void) { return m_groupDestination; }; const std::vector<int32_t>& getDestinationGroup(void) { return m_groupDestination; };
void addGroupDestination(int32_t _id) { m_groupDestination.pushBack(_id); }; void addGroupDestination(int32_t _id) { m_groupDestination.push_back(_id); };
protected: protected:
vec3 m_positionSource; vec3 m_positionSource;
public: public:
@ -69,7 +69,7 @@ namespace ege {
class Environement { class Environement {
private: private:
btDynamicsWorld* m_dynamicsWorld; //!< curent system world description btDynamicsWorld* m_dynamicsWorld; //!< curent system world description
etk::Vector<ege::ElementGame*> m_listElementGame; //!< List of all element added in the Game std::vector<ege::ElementGame*> m_listElementGame; //!< List of all element added in the Game
public: public:
Environement(void); Environement(void);
virtual ~Environement(void) { }; virtual ~Environement(void) { };
@ -79,7 +79,7 @@ namespace ege {
* @param[in] _type Type of the element. * @param[in] _type Type of the element.
* @param[in] _creator Function pointer that reference the element creating. * @param[in] _creator Function pointer that reference the element creating.
*/ */
static void addCreator(const etk::UString& _type, ege::createElement_tf _creator); static void addCreator(const std::string& _type, ege::createElement_tf _creator);
/** /**
* @brief Create an element on the curent scene. * @brief Create an element on the curent scene.
* @param[in] _type Type of the element that might be created. * @param[in] _type Type of the element that might be created.
@ -88,10 +88,10 @@ namespace ege {
* @return NULL if an error occured OR the pointer on the element and it is already added on the system. * @return NULL if an error occured OR the pointer on the element and it is already added on the system.
* @note Pointer is return in case of setting properties on it... * @note Pointer is return in case of setting properties on it...
*/ */
ege::ElementGame* createElement(const etk::UString& _type, bool _autoAddElement=true, ege::property_te _property=ege::typeNone, void* _value=NULL); ege::ElementGame* createElement(const std::string& _type, bool _autoAddElement=true, ege::property_te _property=ege::typeNone, void* _value=NULL);
ege::ElementGame* createElement(const etk::UString& _type, etk::UString& _description, bool _autoAddElement=true); ege::ElementGame* createElement(const std::string& _type, std::string& _description, bool _autoAddElement=true);
ege::ElementGame* createElement(const etk::UString& _type, ejson::Value* _value, bool _autoAddElement=true); ege::ElementGame* createElement(const std::string& _type, ejson::Value* _value, bool _autoAddElement=true);
ege::ElementGame* createElement(const etk::UString& _type, exml::Node* _node, bool _autoAddElement=true); ege::ElementGame* createElement(const std::string& _type, exml::Node* _node, bool _autoAddElement=true);
public: public:
class ResultNearestElement { class ResultNearestElement {
public: public:
@ -116,7 +116,7 @@ namespace ege {
* @breif get a reference on the curent list of element games * @breif get a reference on the curent list of element games
* @return all element list * @return all element list
*/ */
etk::Vector<ege::ElementGame*>& getElementGame(void) { std::vector<ege::ElementGame*>& getElementGame(void) {
return m_listElementGame; return m_listElementGame;
}; };
/** /**
@ -129,10 +129,10 @@ namespace ege {
void getElementNearest(const vec3& _sourcePosition, void getElementNearest(const vec3& _sourcePosition,
float _distanceMax, float _distanceMax,
etk::Vector<ege::Environement::ResultNearestElement>& _resultList); std::vector<ege::Environement::ResultNearestElement>& _resultList);
void getElementNearestFixed(const vec3& _sourcePosition, void getElementNearestFixed(const vec3& _sourcePosition,
float _distanceMax, float _distanceMax,
etk::Vector<ege::Environement::ResultNearestElement>& _resultList); std::vector<ege::Environement::ResultNearestElement>& _resultList);
/** /**
* @brief add an element on the list availlable. * @brief add an element on the list availlable.
* @param[in] _newElement Element to add. * @param[in] _newElement Element to add.
@ -149,7 +149,7 @@ namespace ege {
* @param[in] _position Camera position in the space. * @param[in] _position Camera position in the space.
* @param[in] _direction Camera direction of the view. * @param[in] _direction Camera direction of the view.
*/ */
void getOrderedElementForDisplay(etk::Vector<ege::Environement::ResultNearestElement>& _resultList, const vec3& _position, const vec3& _direction); void getOrderedElementForDisplay(std::vector<ege::Environement::ResultNearestElement>& _resultList, const vec3& _position, const vec3& _direction);
/** /**
* @brief generate an event on all the sub element of the game == > usefull for explosion, or lazer fire ... * @brief generate an event on all the sub element of the game == > usefull for explosion, or lazer fire ...
* @param[in] _event event that might be apply ... * @param[in] _event event that might be apply ...

View File

@ -34,7 +34,7 @@ void ege::ParticuleEngine::add(Particule* _particule) {
return; return;
} }
// Just add it at the end ... // Just add it at the end ...
m_particuleList.pushBack(_particule); m_particuleList.push_back(_particule);
} }
void ege::ParticuleEngine::addRemoved(Particule* _particule) { void ege::ParticuleEngine::addRemoved(Particule* _particule) {
@ -49,7 +49,7 @@ void ege::ParticuleEngine::addRemoved(Particule* _particule) {
return; return;
} }
// Just add it at the end ... // Just add it at the end ...
m_particuleRemoved.pushBack(_particule); m_particuleRemoved.push_back(_particule);
} }
ege::Particule* ege::ParticuleEngine::respown(const char* _particuleType) { ege::Particule* ege::ParticuleEngine::respown(const char* _particuleType) {

View File

@ -16,7 +16,7 @@ namespace ege {
}; };
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/Vector.h> #include <vector>
#include <ege/Particule.h> #include <ege/Particule.h>
namespace ege { namespace ege {
@ -27,8 +27,8 @@ namespace ege {
ParticuleEngine(ege::Environement& _env); // note : need the engine to register has an dynamic element ... (the first ...) ParticuleEngine(ege::Environement& _env); // note : need the engine to register has an dynamic element ... (the first ...)
~ParticuleEngine(void); ~ParticuleEngine(void);
private: private:
etk::Vector<Particule*> m_particuleList; //!< all particule created and active std::vector<Particule*> m_particuleList; //!< all particule created and active
etk::Vector<Particule*> m_particuleRemoved; //!< removed particule std::vector<Particule*> m_particuleRemoved; //!< removed particule
public: public:
/** /**
* @brief clear the particule engine * @brief clear the particule engine

View File

@ -272,7 +272,7 @@ void ege::Scene::periodicCall(const ewol::EventTime& _event) {
{ {
int32_t numberEnnemyKilled=0; int32_t numberEnnemyKilled=0;
int32_t victoryPoint=0; int32_t victoryPoint=0;
etk::Vector<ege::ElementGame*>& elementList = m_env.getElementGame(); std::vector<ege::ElementGame*>& elementList = m_env.getElementGame();
for (int32_t iii=elementList.size()-1; iii >= 0; --iii) { for (int32_t iii=elementList.size()-1; iii >= 0; --iii) {
if(NULL != elementList[iii]) { if(NULL != elementList[iii]) {
if (true == elementList[iii]->needToRemove()) { if (true == elementList[iii]->needToRemove()) {

View File

@ -12,7 +12,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/math/Vector3D.h> #include <etk/math/Vector3D.h>
#include <etk/math/Matrix4.h> #include <etk/math/Matrix4.h>
#include <etk/Vector.h> #include <vector>
#include <ewol/debug.h> #include <ewol/debug.h>
#include <ege/Camera.h> #include <ege/Camera.h>
#include <ewol/widget/Widget.h> #include <ewol/widget/Widget.h>
@ -73,7 +73,7 @@ namespace ege {
bool m_isRunning; //!< the display is running (not in pause) bool m_isRunning; //!< the display is running (not in pause)
float m_ratioTime; //!< Ratio time for the speed of the game ... float m_ratioTime; //!< Ratio time for the speed of the game ...
// Note : This is only for temporary elements : on the display // Note : This is only for temporary elements : on the display
etk::Vector<ege::Environement::ResultNearestElement> m_displayElementOrdered; std::vector<ege::Environement::ResultNearestElement> m_displayElementOrdered;
public: public:
/** /**
* @brief set the scene in pause for a while * @brief set the scene in pause for a while
@ -127,7 +127,7 @@ namespace ege {
mat4& _transformationMatrix, mat4& _transformationMatrix,
etk::Color<float>& _tmpColor); etk::Color<float>& _tmpColor);
void getElementAroundNewElement(vec3 _sourcePosition, void getElementAroundNewElement(vec3 _sourcePosition,
etk::Vector<ege::Environement::ResultNearestElement>& _resultList); std::vector<ege::Environement::ResultNearestElement>& _resultList);
protected: // Derived function protected: // Derived function
virtual void onDraw(void); virtual void onDraw(void);

View File

@ -10,7 +10,7 @@
#include <ege/resource/ParticuleMesh.h> #include <ege/resource/ParticuleMesh.h>
#include <ewol/resources/ResourceManager.h> #include <ewol/resources/ResourceManager.h>
ege::resource::ParticuleMesh::ParticuleMesh(const etk::UString& _fileName, const etk::UString& _shaderName) : ege::resource::ParticuleMesh::ParticuleMesh(const std::string& _fileName, const std::string& _shaderName) :
ewol::Mesh(_fileName, _shaderName) ewol::Mesh(_fileName, _shaderName)
{ {
if (m_GLprogram != NULL) { if (m_GLprogram != NULL) {
@ -84,15 +84,15 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix,
vec3 cameraNormal = vec3(0,0,-1); vec3 cameraNormal = vec3(0,0,-1);
cameraNormal.normalized(); cameraNormal.normalized();
// remove face that is notin the view ... // remove face that is notin the view ...
etk::Vector<uint32_t> tmpIndexResult; std::vector<uint32_t> tmpIndexResult;
etk::Vector<ewol::Face>& tmppFaces = m_listFaces.getValue(kkk).m_faces; std::vector<ewol::Face>& tmppFaces = m_listFaces.getValue(kkk).m_faces;
etk::Vector<uint32_t>& tmppIndex = m_listFaces.getValue(kkk).m_index; std::vector<uint32_t>& tmppIndex = m_listFaces.getValue(kkk).m_index;
if (normalModeFace == m_normalMode) { if (normalModeFace == m_normalMode) {
for(int32_t iii=0; iii<tmppFaces.size() ; ++iii) { for(int32_t iii=0; iii<tmppFaces.size() ; ++iii) {
if(btDot(mattttt * m_listFacesNormal[tmppFaces[iii].m_normal[0]], cameraNormal) >= 0.0f) { if(btDot(mattttt * m_listFacesNormal[tmppFaces[iii].m_normal[0]], cameraNormal) >= 0.0f) {
tmpIndexResult.pushBack(iii*3); tmpIndexResult.push_back(iii*3);
tmpIndexResult.pushBack(iii*3+1); tmpIndexResult.push_back(iii*3+1);
tmpIndexResult.pushBack(iii*3+2); tmpIndexResult.push_back(iii*3+2);
} }
} }
} else { } else {
@ -100,9 +100,9 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix,
if( (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[0]], cameraNormal) >= -0.2f) if( (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[0]], cameraNormal) >= -0.2f)
|| (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[1]], cameraNormal) >= -0.2f) || (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[1]], cameraNormal) >= -0.2f)
|| (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[2]], cameraNormal) >= -0.2f) ) { || (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[2]], cameraNormal) >= -0.2f) ) {
tmpIndexResult.pushBack(iii*3); tmpIndexResult.push_back(iii*3);
tmpIndexResult.pushBack(iii*3+1); tmpIndexResult.push_back(iii*3+1);
tmpIndexResult.pushBack(iii*3+2); tmpIndexResult.push_back(iii*3+2);
} }
} }
} }
@ -126,7 +126,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix,
glBindBuffer(GL_ARRAY_BUFFER,0); glBindBuffer(GL_ARRAY_BUFFER,0);
} }
ege::resource::ParticuleMesh* ege::resource::ParticuleMesh::keep(const etk::UString& _meshName, const etk::UString& _shaderName) ege::resource::ParticuleMesh* ege::resource::ParticuleMesh::keep(const std::string& _meshName, const std::string& _shaderName)
{ {
ege::resource::ParticuleMesh* object = static_cast<ege::resource::ParticuleMesh*>(getManager().localKeep(_meshName)); ege::resource::ParticuleMesh* object = static_cast<ege::resource::ParticuleMesh*>(getManager().localKeep(_meshName));
if (NULL != object) { if (NULL != object) {

View File

@ -20,7 +20,7 @@ namespace ege
protected: protected:
int32_t m_GLMainColor; int32_t m_GLMainColor;
protected: protected:
ParticuleMesh(const etk::UString& _fileName, const etk::UString& _shaderName); ParticuleMesh(const std::string& _fileName, const std::string& _shaderName);
virtual ~ParticuleMesh(void); virtual ~ParticuleMesh(void);
public: public:
virtual const char* getType(void) { return "ege::resource::ParticuleMesh"; }; virtual const char* getType(void) { return "ege::resource::ParticuleMesh"; };
@ -32,7 +32,7 @@ namespace ege
* @param[in] _filename Name of the ewol mesh file. * @param[in] _filename Name of the ewol mesh file.
* @return pointer on the resource or NULL if an error occured. * @return pointer on the resource or NULL if an error occured.
*/ */
static ege::resource::ParticuleMesh* keep(const etk::UString& _meshName, const etk::UString& _shaderName="DATA:ParticuleMesh.prog"); static ege::resource::ParticuleMesh* keep(const std::string& _meshName, const std::string& _shaderName="DATA:ParticuleMesh.prog");
/** /**
* @brief release the keeped resources * @brief release the keeped resources
* @param[in,out] reference on the object pointer * @param[in,out] reference on the object pointer