[DEBUG] correct the VBO FULL implement
This commit is contained in:
parent
2305cdbbcc
commit
21c6ab2f80
@ -90,36 +90,38 @@ ege::Ray ege::camera::View::getRayFromScreen(const vec2& _offset) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ege::camera::View::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
|
#ifndef __TARGET_OS__Web
|
||||||
mat4 mat;
|
void ege::camera::View::drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera) {
|
||||||
if (_camera != sharedFromThis()) {
|
mat4 mat;
|
||||||
|
if (_camera != sharedFromThis()) {
|
||||||
|
mat.identity();
|
||||||
|
vec2 angles = tansformPositionToAngle(-getViewVector());
|
||||||
|
mat.rotate(vec3(0,0,1), angles.x() - M_PI/2.0f);
|
||||||
|
mat.rotate(vec3(1,0,0), -M_PI*0.5f + angles.y());
|
||||||
|
mat.translate(vec3(0,0,getViewVector().length()));
|
||||||
|
mat.rotate(vec3(0,0,1), m_angle);
|
||||||
|
//mat.translate(vec3(m_eye.x(), m_eye.y(), m_eye.z()));
|
||||||
|
_draw->drawSquare(vec3(2,2,2), mat, etk::Color<float>(0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
std::vector<vec3> EwolVertices;
|
||||||
|
EwolVertices.push_back(vec3(0,0,0));
|
||||||
|
EwolVertices.push_back(vec3(-5,-5,-5));
|
||||||
|
EwolVertices.push_back(vec3(5,-5,-5));
|
||||||
|
|
||||||
|
EwolVertices.push_back(vec3(0,0,0));
|
||||||
|
EwolVertices.push_back(vec3(5,-5,-5));
|
||||||
|
EwolVertices.push_back(vec3(5,5,-5));
|
||||||
|
|
||||||
|
EwolVertices.push_back(vec3(0,0,0));
|
||||||
|
EwolVertices.push_back(vec3(5,5,-5));
|
||||||
|
EwolVertices.push_back(vec3(-5,5,-5));
|
||||||
|
|
||||||
|
EwolVertices.push_back(vec3(0,0,0));
|
||||||
|
EwolVertices.push_back(vec3(-5,5,-5));
|
||||||
|
EwolVertices.push_back(vec3(-5,-5,-5));
|
||||||
|
_draw->draw(EwolVertices, etk::Color<float>(0.0f, 0.0f, 1.0f, 0.5f), mat);
|
||||||
|
}
|
||||||
mat.identity();
|
mat.identity();
|
||||||
vec2 angles = tansformPositionToAngle(-getViewVector());
|
mat.translate(m_target);
|
||||||
mat.rotate(vec3(0,0,1), angles.x() - M_PI/2.0f);
|
_draw->drawSphere(1, 3, 3, mat, etk::Color<float>(0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
mat.rotate(vec3(1,0,0), -M_PI*0.5f + angles.y());
|
|
||||||
mat.translate(vec3(0,0,getViewVector().length()));
|
|
||||||
mat.rotate(vec3(0,0,1), m_angle);
|
|
||||||
//mat.translate(vec3(m_eye.x(), m_eye.y(), m_eye.z()));
|
|
||||||
_draw->drawSquare(vec3(2,2,2), mat, etk::Color<float>(0.0f, 0.0f, 1.0f, 1.0f));
|
|
||||||
std::vector<vec3> EwolVertices;
|
|
||||||
EwolVertices.push_back(vec3(0,0,0));
|
|
||||||
EwolVertices.push_back(vec3(-5,-5,-5));
|
|
||||||
EwolVertices.push_back(vec3(5,-5,-5));
|
|
||||||
|
|
||||||
EwolVertices.push_back(vec3(0,0,0));
|
|
||||||
EwolVertices.push_back(vec3(5,-5,-5));
|
|
||||||
EwolVertices.push_back(vec3(5,5,-5));
|
|
||||||
|
|
||||||
EwolVertices.push_back(vec3(0,0,0));
|
|
||||||
EwolVertices.push_back(vec3(5,5,-5));
|
|
||||||
EwolVertices.push_back(vec3(-5,5,-5));
|
|
||||||
|
|
||||||
EwolVertices.push_back(vec3(0,0,0));
|
|
||||||
EwolVertices.push_back(vec3(-5,5,-5));
|
|
||||||
EwolVertices.push_back(vec3(-5,-5,-5));
|
|
||||||
_draw->draw(EwolVertices, etk::Color<float>(0.0f, 0.0f, 1.0f, 0.5f), mat);
|
|
||||||
}
|
}
|
||||||
mat.identity();
|
#endif
|
||||||
mat.translate(m_target);
|
|
||||||
_draw->drawSphere(1, 3, 3, mat, etk::Color<float>(0.0f, 0.0f, 1.0f, 1.0f));
|
|
||||||
}
|
|
||||||
|
@ -73,7 +73,9 @@ namespace ege {
|
|||||||
virtual vec3 getViewVector() const;
|
virtual vec3 getViewVector() const;
|
||||||
public:
|
public:
|
||||||
virtual ege::Ray getRayFromScreen(const vec2& _offset);
|
virtual ege::Ray getRayFromScreen(const vec2& _offset);
|
||||||
|
#ifndef __TARGET_OS__Web
|
||||||
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
|
virtual void drawDebug(ememory::SharedPtr<ewol::resource::Colored3DObject> _draw, ememory::SharedPtr<ege::Camera> _camera);
|
||||||
|
#endif
|
||||||
virtual float getTetha();
|
virtual float getTetha();
|
||||||
virtual float getPsy();
|
virtual float getPsy();
|
||||||
};
|
};
|
||||||
|
@ -60,7 +60,7 @@ void ege::resource::Mesh::init(const std::string& _fileName, const std::string&
|
|||||||
EGE_ERROR("can not instanciate VBO ...");
|
EGE_ERROR("can not instanciate VBO ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TO facilitate some debugs we add a name of the VBO :
|
// TO facilitate some debugs we add a name of the VBO:
|
||||||
m_verticesVBO->setName("[VBO] of " + _fileName);
|
m_verticesVBO->setName("[VBO] of " + _fileName);
|
||||||
// load the curent file :
|
// load the curent file :
|
||||||
std::string tmpName = etk::tolower(_fileName);
|
std::string tmpName = etk::tolower(_fileName);
|
||||||
@ -148,7 +148,7 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix,
|
|||||||
#else
|
#else
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// position :
|
// colors :
|
||||||
m_GLprogram->sendAttributePointer(m_GLColor, m_verticesVBO, MESH_VBO_COLOR);
|
m_GLprogram->sendAttributePointer(m_GLColor, m_verticesVBO, MESH_VBO_COLOR);
|
||||||
// draw lights :
|
// draw lights :
|
||||||
m_light.draw(m_GLprogram);
|
m_light.draw(m_GLprogram);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user