[DEV] update mesh properties to had extern shape

This commit is contained in:
Edouard DUPIN 2013-08-21 22:10:03 +02:00
parent 2b946f19d0
commit 0be9626063
5 changed files with 38 additions and 4 deletions

2
external/ege vendored

@ -1 +1 @@
Subproject commit c741f6e1c8fe23e68a56937ecea08d6972fa3fd3
Subproject commit efca3ae4bac53ed7565ca221274ba9c7c93611db

2
external/ejson vendored

@ -1 +1 @@
Subproject commit 3c102ab263a93b410c3e0cd118bb8d2bc67e0b28
Subproject commit e7723856e4504b2a6e37554d8dc202c152487300

2
external/etk vendored

@ -1 +1 @@
Subproject commit 3ac971ecb6c1a8d60593c1edc5db4368d3a601ca
Subproject commit 4fb6bcebac0309f27531bfe525f6d30a4c283642

View File

@ -17,7 +17,9 @@
ewol::Mesh::Mesh(const etk::UString& _fileName, const etk::UString& _shaderName) :
ewol::Resource(_fileName),
m_normalMode(normalModeNone),
m_checkNormal(false)
m_checkNormal(false),
m_pointerShape(NULL),
m_functionFreeShape(NULL)
{
EWOL_DEBUG("Load a new mesh : '" << _fileName << "'");
// get the shader resource :
@ -68,6 +70,10 @@ ewol::Mesh::~Mesh(void)
// remove dynamics dependencies :
ewol::resource::Release(m_GLprogram);
ewol::resource::Release(m_verticesVBO);
if (m_functionFreeShape!=NULL) {
m_functionFreeShape(m_pointerShape);
m_pointerShape = NULL;
}
}
//#define DISPLAY_NB_VERTEX_DISPLAYED
@ -994,3 +1000,14 @@ void ewol::Mesh::AddMaterial(const etk::UString& _name, ewol::Material* _data)
// really add the material :
m_materials.Add(_name, _data);
}
void ewol::Mesh::SetShape(void* _shape)
{
if (m_functionFreeShape!=NULL) {
m_functionFreeShape(m_pointerShape);
m_pointerShape = NULL;
}
m_pointerShape=_shape;
};

View File

@ -126,6 +126,23 @@ namespace ewol
public:
const etk::Vector<ewol::PhysicsShape*>& GetPhysicalProperties(void) const { return m_physics; };
private:
void* m_pointerShape; //!< all mesh have a basic shape (bullet or other) the void pointer mermit to not depent on the bullet lib
public:
/**
* @brief Set the shape pointer (no type ==> user might know it ...)
* @param[in] _shape The new shape (this remove the previous one)
*/
void SetShape(void* _shape);
/**
* @brief Get the pointer on the shame (no type)
* @return Pointer on shape.
*/
void* GetShape(void) { return m_pointerShape; };
private:
void (*m_functionFreeShape)(void* _pointer);
public:
void SetFreeShapeFunction(void (*_functionFreeShape)(void* _pointer)) { m_functionFreeShape = _functionFreeShape; };
};
};