summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/materials-cpp/houseplant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/materials-cpp/houseplant.cpp')
-rw-r--r--examples/qt3d/materials-cpp/houseplant.cpp35
1 files changed, 7 insertions, 28 deletions
diff --git a/examples/qt3d/materials-cpp/houseplant.cpp b/examples/qt3d/materials-cpp/houseplant.cpp
index 55ee27c2c..12ce2ba37 100644
--- a/examples/qt3d/materials-cpp/houseplant.cpp
+++ b/examples/qt3d/materials-cpp/houseplant.cpp
@@ -62,7 +62,6 @@ HousePlant::HousePlant(Qt3DCore::QNode *parent)
, m_plantMaterial(new Qt3DRender::QNormalDiffuseMapAlphaMaterial())
, m_coverMaterial(new Qt3DRender::QNormalDiffuseMapMaterial())
, m_potImage(new Qt3DRender::QTextureImage())
-
, m_potNormalImage(new Qt3DRender::QTextureImage())
, m_plantImage(new Qt3DRender::QTextureImage())
, m_plantNormalImage(new Qt3DRender::QTextureImage())
@@ -71,7 +70,7 @@ HousePlant::HousePlant(Qt3DCore::QNode *parent)
, m_plantType(Bamboo)
, m_potShape(Cross)
{
- m_pot->scaleTransform()->setScale(0.03f);
+ m_pot->transform()->setScale(0.03f);
m_pot->addComponent(m_potMaterial);
m_plant->addComponent(m_plantMaterial);
m_cover->addComponent(m_coverMaterial);
@@ -130,44 +129,24 @@ HousePlant::Plant HousePlant::plantType() const
return m_plantType;
}
-void HousePlant::setX(float x)
-{
- m_pot->translateTransform()->setDx(x);
-}
-
-void HousePlant::setY(float y)
-{
- m_pot->translateTransform()->setDy(y);
-}
-
-void HousePlant::setZ(float z)
+void HousePlant::setPosition(const QVector3D &pos)
{
- m_pot->translateTransform()->setDz(z);
+ m_pot->transform()->setTranslation(pos);
}
void HousePlant::setScale(float scale)
{
- m_pot->scaleTransform()->setScale(scale);
-}
-
-float HousePlant::x() const
-{
- return m_pot->translateTransform()->dx();
-}
-
-float HousePlant::y() const
-{
- return m_pot->translateTransform()->dy();
+ m_pot->transform()->setScale(scale);
}
-float HousePlant::z() const
+QVector3D HousePlant::position() const
{
- return m_pot->translateTransform()->dz();
+ return m_pot->transform()->translation();
}
float HousePlant::scale() const
{
- return m_pot->scaleTransform()->scale();
+ return m_pot->transform()->scale();
}
void HousePlant::updatePotShape()