[DEV] normalize set matrix on openGL
This commit is contained in:
parent
59a2162deb
commit
714662d7a9
@ -20,6 +20,15 @@
|
||||
ege::resource::Mesh::Mesh() :
|
||||
m_normalMode(normalModeNone),
|
||||
m_checkNormal(false),
|
||||
m_GLPosition(-1),
|
||||
m_GLMatrix(-1),
|
||||
m_GLMatrixPosition(-1),
|
||||
m_GLNormal(-1),
|
||||
m_GLtexture(-1),
|
||||
m_GLColor(-1),
|
||||
m_bufferOfset(-1),
|
||||
m_numberOfElments(-1),
|
||||
m_pointerShape(nullptr),
|
||||
m_functionFreeShape(nullptr) {
|
||||
addObjectType("ege::resource::Mesh");
|
||||
}
|
||||
@ -117,8 +126,8 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix,
|
||||
mat4 projMatrix = ewol::openGL::getMatrix();
|
||||
mat4 camMatrix = ewol::openGL::getCameraMatrix();
|
||||
mat4 tmpMatrix = projMatrix * camMatrix;
|
||||
m_GLprogram->uniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
|
||||
m_GLprogram->uniformMatrix4fv(m_GLMatrixPosition, 1, _positionMatrix.m_mat);
|
||||
m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix);
|
||||
m_GLprogram->uniformMatrix(m_GLMatrixPosition, _positionMatrix);
|
||||
// position :
|
||||
m_GLprogram->sendAttributePointer(m_GLPosition, m_verticesVBO, MESH_VBO_VERTICES);
|
||||
// Texture :
|
||||
|
@ -49,8 +49,8 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix,
|
||||
mat4 projMatrix = ewol::openGL::getMatrix();
|
||||
mat4 camMatrix = ewol::openGL::getCameraMatrix();
|
||||
mat4 tmpMatrix = projMatrix * camMatrix;
|
||||
m_GLprogram->uniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
|
||||
m_GLprogram->uniformMatrix4fv(m_GLMatrixPosition, 1, _positionMatrix.m_mat);
|
||||
m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix);
|
||||
m_GLprogram->uniformMatrix(m_GLMatrixPosition, _positionMatrix);
|
||||
vec4 tmpColor(_mainColor.r(), _mainColor.g(), _mainColor.b(), _mainColor.a());
|
||||
m_GLprogram->uniform4(m_GLMainColor, tmpColor);
|
||||
// position :
|
||||
|
@ -21,8 +21,11 @@ namespace ege {
|
||||
int32_t m_normal[3];
|
||||
int32_t m_color[3];
|
||||
public:
|
||||
Face() {
|
||||
m_nbElement = 1;
|
||||
Face() :
|
||||
m_nbElement(1) {
|
||||
m_vertex[0] = -1;
|
||||
m_vertex[1] = -1;
|
||||
m_vertex[2] = -1;
|
||||
m_uv[0] = -1;
|
||||
m_uv[1] = -1;
|
||||
m_uv[2] = -1;
|
||||
@ -35,8 +38,8 @@ namespace ege {
|
||||
};
|
||||
Face(int32_t _v1, int32_t _t1,
|
||||
int32_t _v2, int32_t _t2,
|
||||
int32_t _v3, int32_t _t3) {
|
||||
m_nbElement = 3;
|
||||
int32_t _v3, int32_t _t3) :
|
||||
m_nbElement(3) {
|
||||
m_vertex[0] = _v1;
|
||||
m_vertex[1] = _v2;
|
||||
m_vertex[2] = _v3;
|
||||
@ -52,8 +55,8 @@ namespace ege {
|
||||
};
|
||||
Face(int32_t _v1, int32_t _t1, int32_t _n1,
|
||||
int32_t _v2, int32_t _t2, int32_t _n2,
|
||||
int32_t _v3, int32_t _t3, int32_t _n3) {
|
||||
m_nbElement = 3;
|
||||
int32_t _v3, int32_t _t3, int32_t _n3) :
|
||||
m_nbElement(3) {
|
||||
m_vertex[0] = _v1;
|
||||
m_vertex[1] = _v2;
|
||||
m_vertex[2] = _v3;
|
||||
|
@ -57,6 +57,7 @@ def create(target):
|
||||
|
||||
myModule.compile_flags_CC([
|
||||
'-Wno-write-strings',
|
||||
'-Wmissing-field-initializers',
|
||||
'-Wall'])
|
||||
|
||||
myModule.add_export_path(tools.get_current_path(__file__))
|
||||
|
Loading…
x
Reference in New Issue
Block a user