[DEV] AABB draw lines

This commit is contained in:
Edouard DUPIN 2017-05-22 23:34:05 +00:00
parent 1ac5daa456
commit 48efe503a7
2 changed files with 55 additions and 0 deletions

View File

@ -156,6 +156,55 @@ void ewol::resource::Colored3DObject::drawLine(std::vector<vec3>& _vertices,
}
}
void ewol::resource::Colored3DObject::drawCubeLine(const vec3& _min,
const vec3& _max,
const etk::Color<float>& _color,
mat4& _transformationMatrix,
bool _updateDepthBuffer,
bool _depthtest) {
std::vector<vec3> vertices;
vertices.push_back(vec3(_min.x(), _min.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _min.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _min.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _min.y(),_max.z()));
vertices.push_back(vec3(_max.x(), _min.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _min.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _min.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _min.y(),_min.z()));
vertices.push_back(vec3(_min.x(), _max.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _max.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _max.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _max.y(),_max.z()));
vertices.push_back(vec3(_max.x(), _max.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _max.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _max.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _max.y(),_min.z()));
vertices.push_back(vec3(_min.x(), _min.y(),_min.z()));
vertices.push_back(vec3(_min.x(), _max.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _min.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _max.y(),_min.z()));
vertices.push_back(vec3(_max.x(), _min.y(),_max.z()));
vertices.push_back(vec3(_max.x(), _max.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _min.y(),_max.z()));
vertices.push_back(vec3(_min.x(), _max.y(),_max.z()));
drawLine(vertices, _color, _transformationMatrix, _updateDepthBuffer, _depthtest);
}
void ewol::resource::Colored3DObject::drawSquare(const vec3& _size,
mat4& _transformationMatrix,
const etk::Color<float>& _tmpColor) {

View File

@ -44,6 +44,12 @@ namespace ewol {
mat4& _transformationMatrix,
bool _updateDepthBuffer=true,
bool _depthtest=true);
virtual void drawCubeLine(const vec3& _min,
const vec3& _max,
const etk::Color<float>& _color,
mat4& _transformationMatrix,
bool _updateDepthBuffer=true,
bool _depthtest=true);
public:
void drawSquare(const vec3& _size,
mat4& _transformationMatrix,