[DEV] integarate std x11
This commit is contained in:
parent
a52c92e96f
commit
1d10f95332
@ -31,7 +31,7 @@ btCollisionShape* ege::collision::createShape(const ewol::Mesh* _mesh) {
|
||||
if (NULL == _mesh) {
|
||||
return new btEmptyShape();;
|
||||
}
|
||||
const etk::Vector<ewol::PhysicsShape*>& physiqueProperty = _mesh->getPhysicalProperties();
|
||||
const std::vector<ewol::PhysicsShape*>& physiqueProperty = _mesh->getPhysicalProperties();
|
||||
if (physiqueProperty.size() == 0) {
|
||||
return new btEmptyShape();;
|
||||
}
|
||||
|
@ -29,8 +29,8 @@
|
||||
#undef __class__
|
||||
#define __class__ "ElementGame"
|
||||
|
||||
const etk::UString& ege::ElementGame::getType(void) const {
|
||||
static const etk::UString nameType("----");
|
||||
const std::string& ege::ElementGame::getType(void) const {
|
||||
static const std::string nameType("----");
|
||||
return nameType;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ void ege::ElementGame::FunctionFreeShape(void* _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;
|
||||
tmpMesh = ewol::Mesh::keep(_meshFileName);
|
||||
if(NULL == tmpMesh) {
|
||||
@ -191,7 +191,7 @@ static void drawSphere(ewol::Colored3DObject* _draw,
|
||||
mat4& _transformationMatrix,
|
||||
etk::Color<float>& _tmpColor) {
|
||||
int i, j;
|
||||
etk::Vector<vec3> EwolVertices;
|
||||
std::vector<vec3> EwolVertices;
|
||||
for(i = 0; i <= _lats; i++) {
|
||||
btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / _lats);
|
||||
btScalar z0 = _radius*sin(lat0);
|
||||
@ -215,13 +215,13 @@ static void drawSphere(ewol::Colored3DObject* _draw,
|
||||
vec3 v2 = vec3(x * zr1, y * zr1, z1);
|
||||
vec3 v3 = vec3(x * zr0, y * zr0, z0);
|
||||
|
||||
EwolVertices.pushBack(v1);
|
||||
EwolVertices.pushBack(v2);
|
||||
EwolVertices.pushBack(v3);
|
||||
EwolVertices.push_back(v1);
|
||||
EwolVertices.push_back(v2);
|
||||
EwolVertices.push_back(v3);
|
||||
|
||||
EwolVertices.pushBack(v1);
|
||||
EwolVertices.pushBack(v3);
|
||||
EwolVertices.pushBack(v4);
|
||||
EwolVertices.push_back(v1);
|
||||
EwolVertices.push_back(v3);
|
||||
EwolVertices.push_back(v4);
|
||||
}
|
||||
}
|
||||
_draw->draw(EwolVertices, _tmpColor, _transformationMatrix);
|
||||
@ -243,23 +243,23 @@ void ege::ElementGame::drawLife(ewol::Colored3DObject* _draw, const ege::Camera&
|
||||
mat4 transformationMatrix = etk::matTranslate(getPosition())
|
||||
* etk::matRotate(vec3(0,0,1),_camera.getAngleZ())
|
||||
* etk::matRotate(vec3(1,0,0),(M_PI/2.0f-_camera.getAngleTeta()));
|
||||
etk::Vector<vec3> localVertices;
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0));
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
|
||||
localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0));
|
||||
localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
|
||||
localVertices.pushBack(vec3( lifeWidth/2.0+lifeBorder,lifeYPos -lifeBorder,0));
|
||||
std::vector<vec3> localVertices;
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
|
||||
localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0-lifeBorder,lifeYPos -lifeBorder,0));
|
||||
localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos+lifeHeight+lifeBorder,0));
|
||||
localVertices.push_back(vec3( lifeWidth/2.0+lifeBorder,lifeYPos -lifeBorder,0));
|
||||
etk::Color<float> myColor(0x0000FF99);
|
||||
_draw->draw(localVertices, myColor, transformationMatrix, false, false);
|
||||
localVertices.clear();
|
||||
/** Bounding box == > model shape **/
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos,0));
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos + lifeHeight,0));
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0));
|
||||
localVertices.pushBack(vec3(-lifeWidth/2.0 ,lifeYPos,0));
|
||||
localVertices.pushBack(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 ,lifeYPos,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos + lifeHeight,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0 ,lifeYPos,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos + lifeHeight,0));
|
||||
localVertices.push_back(vec3(-lifeWidth/2.0+lifeWidth*ratio,lifeYPos,0));
|
||||
myColor =0x00FF00FF;
|
||||
if (ratio < 0.2f) {
|
||||
myColor = 0xFF0000FF;
|
||||
@ -272,7 +272,7 @@ void ege::ElementGame::drawLife(ewol::Colored3DObject* _draw, const ege::Camera&
|
||||
static void drawShape(const btCollisionShape* _shape,
|
||||
ewol::Colored3DObject* _draw,
|
||||
mat4 _transformationMatrix,
|
||||
etk::Vector<vec3> _tmpVertices) {
|
||||
std::vector<vec3> _tmpVertices) {
|
||||
if( NULL == _draw
|
||||
|| NULL == _shape) {
|
||||
return;
|
||||
@ -312,9 +312,9 @@ static void drawShape(const btCollisionShape* _shape,
|
||||
// normal calculation :
|
||||
//btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]);
|
||||
//normal.normalize ();
|
||||
_tmpVertices.pushBack(vertices[indices[iii]]);
|
||||
_tmpVertices.pushBack(vertices[indices[iii+1]]);
|
||||
_tmpVertices.pushBack(vertices[indices[iii+2]]);
|
||||
_tmpVertices.push_back(vertices[indices[iii]]);
|
||||
_tmpVertices.push_back(vertices[indices[iii+1]]);
|
||||
_tmpVertices.push_back(vertices[indices[iii+2]]);
|
||||
}
|
||||
_draw->draw(_tmpVertices, tmpColor, _transformationMatrix);
|
||||
break;
|
||||
@ -443,8 +443,8 @@ void ege::ElementGame::drawDebug(ewol::Colored3DObject* _draw, const ege::Camera
|
||||
m_debugText.setPos(vec3(-20,32,0));
|
||||
m_debugText.print(getType());
|
||||
m_debugText.setPos(vec3(-20,20,0));
|
||||
m_debugText.print(etk::UString("life=(")+etk::UString(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("life=(")+std::string(getLifeRatio()));
|
||||
//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];
|
||||
btDefaultMotionState* myMotionState = (btDefaultMotionState*)m_body->getMotionState();
|
||||
myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(mmm);
|
||||
@ -453,7 +453,7 @@ void ege::ElementGame::drawDebug(ewol::Colored3DObject* _draw, const ege::Camera
|
||||
transformationMatrix.transpose();
|
||||
|
||||
// note : set the vertice here to prevent multiple allocations...
|
||||
etk::Vector<vec3> EwolVertices;
|
||||
std::vector<vec3> EwolVertices;
|
||||
drawShape(m_shape, _draw, transformationMatrix, EwolVertices);
|
||||
|
||||
m_debugText.draw( etk::matTranslate(getPosition())
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <etk/types.h>
|
||||
#include <etk/math/Vector3D.h>
|
||||
#include <etk/math/Matrix4.h>
|
||||
#include <etk/Vector.h>
|
||||
#include <vector>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
@ -52,7 +52,7 @@ namespace ege
|
||||
* @brief get the element Type description 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
|
||||
* @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
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool loadMesh(const etk::UString& _meshFileName);
|
||||
bool loadMesh(const std::string& _meshFileName);
|
||||
/**
|
||||
* @brief set the the Mesh properties.
|
||||
* @param[in] _mesh The mesh pointer. (NULL to force the mesh remove ...)
|
||||
|
@ -48,7 +48,7 @@ ege::ElementGame* ege::Environement::getElementNearest(ege::ElementGame* _source
|
||||
|
||||
void ege::Environement::getElementNearest(const vec3& _sourcePosition,
|
||||
float _distanceMax,
|
||||
etk::Vector<ege::Environement::ResultNearestElement>& _resultList) {
|
||||
std::vector<ege::Environement::ResultNearestElement>& _resultList) {
|
||||
_resultList.clear();
|
||||
ege::Environement::ResultNearestElement result;
|
||||
result.dist = 99999999999.0f;
|
||||
@ -67,14 +67,14 @@ void ege::Environement::getElementNearest(const vec3& _sourcePosition,
|
||||
result.dist = btDistance(_sourcePosition, destPosition);
|
||||
//EGE_DEBUG("Distance : " << _distance << " >? " << distance << " id=" << iii);
|
||||
if (_distanceMax>result.dist) {
|
||||
_resultList.pushBack(result);
|
||||
_resultList.push_back(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ege::Environement::getElementNearestFixed(const vec3& _sourcePosition,
|
||||
float _distanceMax,
|
||||
etk::Vector<ege::Environement::ResultNearestElement>& _resultList) {
|
||||
std::vector<ege::Environement::ResultNearestElement>& _resultList) {
|
||||
_resultList.clear();
|
||||
ege::Environement::ResultNearestElement result;
|
||||
result.dist = 99999999999.0f;
|
||||
@ -105,7 +105,7 @@ void ege::Environement::getElementNearestFixed(const vec3& _sourcePosition,
|
||||
}
|
||||
// add element at the end :
|
||||
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;
|
||||
}
|
||||
|
||||
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) {
|
||||
EGE_ERROR("Try to add an empty CREATOR ...");
|
||||
return;
|
||||
@ -127,7 +127,7 @@ void ege::Environement::addCreator(const etk::UString& _type, ege::createElement
|
||||
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)) {
|
||||
EGE_ERROR("Request creating of an type that is not known '" << _type << "'");
|
||||
return NULL;
|
||||
@ -154,15 +154,15 @@ ege::ElementGame* ege::Environement::createElement(const etk::UString& _type, bo
|
||||
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));
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void ege::Environement::addElementGame(ege::ElementGame* _newElement) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_listElementGame.pushBack(_newElement);
|
||||
m_listElementGame.push_back(_newElement);
|
||||
_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& _direction) {
|
||||
// remove all unneeded elements (old display...)
|
||||
@ -247,7 +247,7 @@ void ege::Environement::getOrderedElementForDisplay(etk::Vector<ege::Environemen
|
||||
}
|
||||
// add element at the end :
|
||||
if (jjj >= _resultList.size()) {
|
||||
_resultList.pushBack(result);
|
||||
_resultList.push_back(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace ege {
|
||||
#include <BulletDynamics/Dynamics/btActionInterface.h>
|
||||
class btDynamicsWorld;
|
||||
|
||||
#include <etk/Vector.h>
|
||||
#include <vector>
|
||||
#include <etk/math/Vector3D.h>
|
||||
#include <ejson/ejson.h>
|
||||
#include <exml/exml.h>
|
||||
@ -28,7 +28,7 @@ class btDynamicsWorld;
|
||||
namespace ege {
|
||||
typedef enum {
|
||||
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)
|
||||
typeXml, //!< type element static_cast<exml::Node*>(xxxxxxx)
|
||||
typeUser1, //!< user type 1
|
||||
@ -48,10 +48,10 @@ namespace ege {
|
||||
public:
|
||||
int32_t getSourceGroup(void) { return m_groupSource; };
|
||||
protected:
|
||||
etk::Vector<int32_t> m_groupDestination;
|
||||
std::vector<int32_t> m_groupDestination;
|
||||
public:
|
||||
const etk::Vector<int32_t>& getDestinationGroup(void) { return m_groupDestination; };
|
||||
void addGroupDestination(int32_t _id) { m_groupDestination.pushBack(_id); };
|
||||
const std::vector<int32_t>& getDestinationGroup(void) { return m_groupDestination; };
|
||||
void addGroupDestination(int32_t _id) { m_groupDestination.push_back(_id); };
|
||||
protected:
|
||||
vec3 m_positionSource;
|
||||
public:
|
||||
@ -69,7 +69,7 @@ namespace ege {
|
||||
class Environement {
|
||||
private:
|
||||
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:
|
||||
Environement(void);
|
||||
virtual ~Environement(void) { };
|
||||
@ -79,7 +79,7 @@ namespace ege {
|
||||
* @param[in] _type Type of the element.
|
||||
* @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.
|
||||
* @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.
|
||||
* @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 etk::UString& _type, etk::UString& _description, bool _autoAddElement=true);
|
||||
ege::ElementGame* createElement(const etk::UString& _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, bool _autoAddElement=true, ege::property_te _property=ege::typeNone, void* _value=NULL);
|
||||
ege::ElementGame* createElement(const std::string& _type, std::string& _description, bool _autoAddElement=true);
|
||||
ege::ElementGame* createElement(const std::string& _type, ejson::Value* _value, bool _autoAddElement=true);
|
||||
ege::ElementGame* createElement(const std::string& _type, exml::Node* _node, bool _autoAddElement=true);
|
||||
public:
|
||||
class ResultNearestElement {
|
||||
public:
|
||||
@ -116,7 +116,7 @@ namespace ege {
|
||||
* @breif get a reference on the curent list of element games
|
||||
* @return all element list
|
||||
*/
|
||||
etk::Vector<ege::ElementGame*>& getElementGame(void) {
|
||||
std::vector<ege::ElementGame*>& getElementGame(void) {
|
||||
return m_listElementGame;
|
||||
};
|
||||
/**
|
||||
@ -129,10 +129,10 @@ namespace ege {
|
||||
|
||||
void getElementNearest(const vec3& _sourcePosition,
|
||||
float _distanceMax,
|
||||
etk::Vector<ege::Environement::ResultNearestElement>& _resultList);
|
||||
std::vector<ege::Environement::ResultNearestElement>& _resultList);
|
||||
void getElementNearestFixed(const vec3& _sourcePosition,
|
||||
float _distanceMax,
|
||||
etk::Vector<ege::Environement::ResultNearestElement>& _resultList);
|
||||
std::vector<ege::Environement::ResultNearestElement>& _resultList);
|
||||
/**
|
||||
* @brief add an element on the list availlable.
|
||||
* @param[in] _newElement Element to add.
|
||||
@ -149,7 +149,7 @@ namespace ege {
|
||||
* @param[in] _position Camera position in the space.
|
||||
* @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 ...
|
||||
* @param[in] _event event that might be apply ...
|
||||
|
@ -34,7 +34,7 @@ void ege::ParticuleEngine::add(Particule* _particule) {
|
||||
return;
|
||||
}
|
||||
// Just add it at the end ...
|
||||
m_particuleList.pushBack(_particule);
|
||||
m_particuleList.push_back(_particule);
|
||||
}
|
||||
|
||||
void ege::ParticuleEngine::addRemoved(Particule* _particule) {
|
||||
@ -49,7 +49,7 @@ void ege::ParticuleEngine::addRemoved(Particule* _particule) {
|
||||
return;
|
||||
}
|
||||
// Just add it at the end ...
|
||||
m_particuleRemoved.pushBack(_particule);
|
||||
m_particuleRemoved.push_back(_particule);
|
||||
}
|
||||
|
||||
ege::Particule* ege::ParticuleEngine::respown(const char* _particuleType) {
|
||||
|
@ -16,7 +16,7 @@ namespace ege {
|
||||
};
|
||||
|
||||
#include <etk/UString.h>
|
||||
#include <etk/Vector.h>
|
||||
#include <vector>
|
||||
#include <ege/Particule.h>
|
||||
|
||||
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(void);
|
||||
private:
|
||||
etk::Vector<Particule*> m_particuleList; //!< all particule created and active
|
||||
etk::Vector<Particule*> m_particuleRemoved; //!< removed particule
|
||||
std::vector<Particule*> m_particuleList; //!< all particule created and active
|
||||
std::vector<Particule*> m_particuleRemoved; //!< removed particule
|
||||
public:
|
||||
/**
|
||||
* @brief clear the particule engine
|
||||
|
@ -272,7 +272,7 @@ void ege::Scene::periodicCall(const ewol::EventTime& _event) {
|
||||
{
|
||||
int32_t numberEnnemyKilled=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) {
|
||||
if(NULL != elementList[iii]) {
|
||||
if (true == elementList[iii]->needToRemove()) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <etk/types.h>
|
||||
#include <etk/math/Vector3D.h>
|
||||
#include <etk/math/Matrix4.h>
|
||||
#include <etk/Vector.h>
|
||||
#include <vector>
|
||||
#include <ewol/debug.h>
|
||||
#include <ege/Camera.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
@ -73,7 +73,7 @@ namespace ege {
|
||||
bool m_isRunning; //!< the display is running (not in pause)
|
||||
float m_ratioTime; //!< Ratio time for the speed of the game ...
|
||||
// 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:
|
||||
/**
|
||||
* @brief set the scene in pause for a while
|
||||
@ -127,7 +127,7 @@ namespace ege {
|
||||
mat4& _transformationMatrix,
|
||||
etk::Color<float>& _tmpColor);
|
||||
void getElementAroundNewElement(vec3 _sourcePosition,
|
||||
etk::Vector<ege::Environement::ResultNearestElement>& _resultList);
|
||||
std::vector<ege::Environement::ResultNearestElement>& _resultList);
|
||||
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <ege/resource/ParticuleMesh.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)
|
||||
{
|
||||
if (m_GLprogram != NULL) {
|
||||
@ -84,15 +84,15 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix,
|
||||
vec3 cameraNormal = vec3(0,0,-1);
|
||||
cameraNormal.normalized();
|
||||
// remove face that is notin the view ...
|
||||
etk::Vector<uint32_t> tmpIndexResult;
|
||||
etk::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> tmpIndexResult;
|
||||
std::vector<ewol::Face>& tmppFaces = m_listFaces.getValue(kkk).m_faces;
|
||||
std::vector<uint32_t>& tmppIndex = m_listFaces.getValue(kkk).m_index;
|
||||
if (normalModeFace == m_normalMode) {
|
||||
for(int32_t iii=0; iii<tmppFaces.size() ; ++iii) {
|
||||
if(btDot(mattttt * m_listFacesNormal[tmppFaces[iii].m_normal[0]], cameraNormal) >= 0.0f) {
|
||||
tmpIndexResult.pushBack(iii*3);
|
||||
tmpIndexResult.pushBack(iii*3+1);
|
||||
tmpIndexResult.pushBack(iii*3+2);
|
||||
tmpIndexResult.push_back(iii*3);
|
||||
tmpIndexResult.push_back(iii*3+1);
|
||||
tmpIndexResult.push_back(iii*3+2);
|
||||
}
|
||||
}
|
||||
} 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)
|
||||
|| (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[1]], cameraNormal) >= -0.2f)
|
||||
|| (btDot(mattttt * m_listVertexNormal[tmppFaces[iii].m_normal[2]], cameraNormal) >= -0.2f) ) {
|
||||
tmpIndexResult.pushBack(iii*3);
|
||||
tmpIndexResult.pushBack(iii*3+1);
|
||||
tmpIndexResult.pushBack(iii*3+2);
|
||||
tmpIndexResult.push_back(iii*3);
|
||||
tmpIndexResult.push_back(iii*3+1);
|
||||
tmpIndexResult.push_back(iii*3+2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -126,7 +126,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix,
|
||||
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));
|
||||
if (NULL != object) {
|
||||
|
@ -20,7 +20,7 @@ namespace ege
|
||||
protected:
|
||||
int32_t m_GLMainColor;
|
||||
protected:
|
||||
ParticuleMesh(const etk::UString& _fileName, const etk::UString& _shaderName);
|
||||
ParticuleMesh(const std::string& _fileName, const std::string& _shaderName);
|
||||
virtual ~ParticuleMesh(void);
|
||||
public:
|
||||
virtual const char* getType(void) { return "ege::resource::ParticuleMesh"; };
|
||||
@ -32,7 +32,7 @@ namespace ege
|
||||
* @param[in] _filename Name of the ewol mesh file.
|
||||
* @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
|
||||
* @param[in,out] reference on the object pointer
|
||||
|
Loading…
x
Reference in New Issue
Block a user