Fix property value initialization

This commit is contained in:
2020-07-08 14:13:52 -06:00
parent f810f02ea9
commit 85765e38d4
4 changed files with 8 additions and 8 deletions

View File

@@ -115,7 +115,7 @@ void MagnumItem::mouseMoveEvent(QMouseEvent *evt) {
void MagnumItem::wheelEvent(QWheelEvent *evt) {
if (auto& camera = m_renderer->camera()) {
const Float delta = evt->delta();
const Float delta = evt->angleDelta().y();
if (Math::abs(delta) < 1.0e-2f)
return;
camera->zoom(delta*.01f);

View File

@@ -16,9 +16,7 @@ static const auto HUE_BG = 210.0_degf;
static const auto COLOR_BG = Color4::fromHsv({HUE_BG, .3f, .9f}, 1.f);
static const auto COLOR_GRID = Color4::fromHsv({HUE_BG, .3f, .7f}, 1.f);
MagnumRenderer::MagnumRenderer() :
m_init(false),
m_count(1) {}
MagnumRenderer::MagnumRenderer() : m_init(false) {}
MagnumRenderer::~MagnumRenderer() {
delete m_subjectObject;
@@ -76,7 +74,7 @@ void MagnumRenderer::lazyInitialize() {
.setLightColor(Color3{1.f})
.setLightPosition(Vector3{-100.f, 100.f, 50.f});
m_subjectDrawable = new SubjectDrawable{*m_subjectObject, m_subjectShader, m_subject, m_drawables, m_count};
m_subjectDrawable = new SubjectDrawable{*m_subjectObject, m_subjectShader, m_subject, m_drawables, 1, 0, 0};
}
// The Grid

View File

@@ -38,11 +38,13 @@ class SubjectDrawable : public SceneGraph::Drawable3D {
public:
explicit SubjectDrawable(Object3D &object, Shaders::Phong &shader,
GL::Mesh &mesh, SceneGraph::DrawableGroup3D &drawables,
int count)
int count, float hue, float t)
: SceneGraph::Drawable3D{object, &drawables},
m_shader(shader),
m_mesh(mesh),
m_count(count) {}
m_count(count),
m_hue(hue),
m_t(t) {}
void draw(const Matrix4 &transformation, SceneGraph::Camera3D &camera);
@@ -92,7 +94,6 @@ private:
void prepGLState();
bool m_init;
int m_count;
Platform::GLContext *m_ctx{nullptr};
GL::Framebuffer m_FBO{NoCreate};

View File

@@ -108,6 +108,7 @@ ApplicationWindow {
Layout.fillHeight: true
Layout.fillWidth: true
t: 0
hue: hue.value
count: count.value