small refactoring
This commit is contained in:
@@ -198,7 +198,7 @@ void RendererService::fillOmniObjects() {
|
||||
foreach (Light * l, ll) {
|
||||
QMatrix4x4 m = invariantSizeMatrix(l->worldPos());
|
||||
m.transposed().copyDataTo(o.modelmatrix);
|
||||
o.object_id = l->id_;
|
||||
o.object_id = l->id();
|
||||
cur_objects << o;
|
||||
}
|
||||
}
|
||||
@@ -218,14 +218,14 @@ void RendererService::fillAimedObjects(const ObjectBaseList & objects, Mesh * li
|
||||
QMatrix4x4 m;
|
||||
m = invariantSizeMatrix(ao->worldPos()) * parentRotationMatrix(ao);
|
||||
m.transposed().copyDataTo(o.modelmatrix);
|
||||
o.object_id = ao->id_;
|
||||
o.object_id = ao->id();
|
||||
cur_objects << o;
|
||||
|
||||
lv << ao->worldPos() << ao->worldAim();
|
||||
|
||||
m = invariantSizeMatrix(ao->worldAim());
|
||||
m.transposed().copyDataTo(o.modelmatrix);
|
||||
o.object_id = ao->id_ + 1;
|
||||
o.object_id = ao->id() + 1;
|
||||
cur_aims << o;
|
||||
}
|
||||
ln.resize(lv.size());
|
||||
@@ -269,7 +269,7 @@ bool RendererService::calculateCenter() {
|
||||
axis_mat = QMatrix4x4();
|
||||
if ((sol.size() == 1)) {
|
||||
if (current_action == haMove) {
|
||||
if (sol[0]->selected_aim)
|
||||
if (sol[0]->isAimSelected())
|
||||
selection_center = ((AimedObject*)sol[0])->worldAim();
|
||||
} else {
|
||||
axis_mat = parentRotationMatrix(sol[0]);
|
||||
@@ -330,7 +330,7 @@ void RendererService::drawLights() {
|
||||
|
||||
fillOmniObjects();
|
||||
omni_mesh->loadObjects(v, cur_objects);
|
||||
r->fillSelectionsBuffer(rs.cur_selections_, lights2objectList(v->scene_->lights_used.value(Light::Omni)));
|
||||
r->fillSelectionsBuffer(rs.cur_selections_, lights2objectList(v->scene()->lights_used.value(Light::Omni)));
|
||||
omni_mesh->loadSelections(v, rs.cur_selections_);
|
||||
omni_mesh->draw(v, cur_objects.size());
|
||||
|
||||
@@ -354,7 +354,7 @@ void RendererService::drawLightsFrame(QColor color) {
|
||||
fillOmniObjects();
|
||||
setObjectsColor(cur_objects, color);
|
||||
omni_mesh_f->loadObjects(v, cur_objects);
|
||||
r->fillSelectionsBuffer(rs.cur_selections_, lights2objectList(v->scene_->lights_used.value(Light::Omni)));
|
||||
r->fillSelectionsBuffer(rs.cur_selections_, lights2objectList(v->scene()->lights_used.value(Light::Omni)));
|
||||
omni_mesh_f->loadSelections(v, rs.cur_selections_);
|
||||
omni_mesh_f->draw(v, cur_objects.size());
|
||||
|
||||
@@ -446,14 +446,12 @@ void RendererService::renderService() {
|
||||
|
||||
}
|
||||
if (r->bindShader(Renderer::srServiceLine, &prog)) {
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
r->setUniformCamera(prog, r->view->camera());
|
||||
line_object.color = QColor2QVector(Qt::white);
|
||||
line_spot_f ->loadObject(f, line_object);
|
||||
line_camera_f->loadObject(f, line_object);
|
||||
line_spot_f ->draw(f, 1);
|
||||
line_camera_f->draw(f, 1);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
}
|
||||
glEnable(GL_CULL_FACE);
|
||||
if (r->bindShader(Renderer::srServiceFill, &prog)) {
|
||||
|
||||
Reference in New Issue
Block a user