-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
Task 3 #87
Conversation
015f847
to
78f197f
Compare
c008b01
to
293cdd0
Compare
this->center_ = center; | ||
//initialize block | ||
{ | ||
gVertexes.append(VertexData({half_width, half_width, half_width}, {0.0f, 0.0f, 1.0f})); |
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Неиспользуемый код
Features: c - cube color, b - background