Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 3 #87

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Task 3 #87

wants to merge 9 commits into from

Conversation

Nvoid09
Copy link
Collaborator

@Nvoid09 Nvoid09 commented May 23, 2021

Features: c - cube color, b - background

@Nvoid09 Nvoid09 force-pushed the feature-voitov-task-3 branch from 015f847 to 78f197f Compare May 26, 2021 06:55
@Nvoid09 Nvoid09 force-pushed the feature-voitov-task-3 branch from c008b01 to 293cdd0 Compare May 26, 2021 09:32
this->center_ = center;
//initialize block
{
gVertexes.append(VertexData({half_width, half_width, half_width}, {0.0f, 0.0f, 1.0f}));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Задайте индексы через initializer list, зачем делать кучу append'ов :)


namespace geometry{

VertexData::VertexData(QVector3D position, QVector3D normal){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Конструктор не нужен

namespace geometry {

QVector<VertexData> FigureInformation::getVertexes() const noexcept{
return this->gVertexes;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Каждый раз возвращаете копию объекта (это медленно), возвращайте ссылку. И для функций ниже

window.setFormat(format);
window.resize(640, 480);

QVector<geometry::Cube*> cube;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Используйте умные указатели.


void UIWindow::addObj(geometry::figure * const f)
{
//std::unique_ptr<geometry::figure> tmp = std::make_unique<geometry::figure>(f);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давайте убирать закомментированный код

GLfloat ambientStrength_ = 1.0;

QVector<geometry::figure*> figures;
//QVector<std::unique_ptr<geometry::figure>> figures;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Неиспользуемый код

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants