git-svn-id: svn://db.shs.com.ru/libs@630 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-11-24 20:39:02 +00:00
parent 6c8da692e2
commit 9059a17cd0
3 changed files with 13 additions and 9 deletions

View File

@@ -37,7 +37,7 @@ RendererService::RendererService(Renderer * r_): r(r_) {
QMatrix4x4 m;
m.rotate(90., _rot[i]);
mat_xyz[i] = m;
color_xyz[i] = QVector4D(0,0,0,1);
color_xyz[i] = QVector4D(0,0,0,0.667);
color_xyz[i][i] = 1.;
}
axis_camera = new Camera();
@@ -155,13 +155,13 @@ bool RendererService::fillCurrentHandleObjects() {
selection_center = sol[0]->worldPos();
else
selection_center = bb.center();
QMatrix4x4 rm;
axis_mat = QMatrix4x4();
if ((sol.size() == 1) && (current_handle >= htRotateX)) {
rm.rotate(sol[0]->angles_.z(), 0., 0., 1.);
rm.rotate(sol[0]->angles_.y(), 0., 1., 0.);
rm.rotate(sol[0]->angles_.x(), 1., 0., 0.);
axis_mat.rotate(sol[0]->angles_.z(), 0., 0., 1.);
axis_mat.rotate(sol[0]->angles_.y(), 0., 1., 0.);
axis_mat.rotate(sol[0]->angles_.x(), 1., 0., 0.);
}
fillHandleObjects(selection_center, current_handle, rm);
fillHandleObjects(selection_center, current_handle, axis_mat);
return true;
}
@@ -211,11 +211,14 @@ void RendererService::renderService() {
/// handles
if (fillCurrentHandleObjects()) {
f->glEnable(GL_BLEND);
f->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Mesh * hm = currentHandleMesh();
if (hm) {
hm->loadObjects(r->view, cur_objects);
hm->draw(f, 3);
}
f->glDisable(GL_BLEND);
}
/// axis