summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/bigscene-cpp/main.cpp4
-rw-r--r--examples/dynamicscene-cpp/boxentity.cpp4
-rw-r--r--examples/dynamicscene-cpp/examplescene.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/bigscene-cpp/main.cpp b/examples/bigscene-cpp/main.cpp
index c6fb4df37..5ab25bf5e 100644
--- a/examples/bigscene-cpp/main.cpp
+++ b/examples/bigscene-cpp/main.cpp
@@ -111,12 +111,12 @@ int main(int ac, char **av)
const float angle = M_PI * 2.0f * i * det * 10.;
- material->setDiffuse(QColor(fabs(cosf(angle)) * 255, 204, 75));
+ material->setDiffuse(QColor(qFabs(qCos(angle)) * 255, 204, 75));
material->setAmbient(Qt::gray);
material->setSpecular(Qt::white);
material->setShininess(150.0f);
- translation->setTranslation(QVector3D(radius * cos(angle), 200.* i * det, radius * sin(angle)));
+ translation->setTranslation(QVector3D(radius * qCos(angle), 200.* i * det, radius * qSin(angle)));
rotateX->setAxis(QVector3D(1.0f, 0.0f, 0.0f));
rotateZ->setAxis(QVector3D(0.0f, 0.0f, 1.0f));
rotateX->setAngleDeg(30.0f * i);
diff --git a/examples/dynamicscene-cpp/boxentity.cpp b/examples/dynamicscene-cpp/boxentity.cpp
index dea4b9365..a3f539564 100644
--- a/examples/dynamicscene-cpp/boxentity.cpp
+++ b/examples/dynamicscene-cpp/boxentity.cpp
@@ -101,8 +101,8 @@ float BoxEntity::radius() const
void BoxEntity::updateTransformation()
{
- m_translate->setTranslation(QVector3D(cosf(m_angle) * m_radius,
+ m_translate->setTranslation(QVector3D(qCos(m_angle) * m_radius,
1.0f,
- sinf(m_angle) * m_radius));
+ qSin(m_angle) * m_radius));
}
diff --git a/examples/dynamicscene-cpp/examplescene.cpp b/examples/dynamicscene-cpp/examplescene.cpp
index fe0c46108..ca15b1a9f 100644
--- a/examples/dynamicscene-cpp/examplescene.cpp
+++ b/examples/dynamicscene-cpp/examplescene.cpp
@@ -80,7 +80,7 @@ void ExampleScene::buildScene()
const float angle = M_PI * 2.0f * float(i) / count;
entity->setAngle(angle);
entity->setRadius(radius);
- entity->setDiffuseColor(QColor(fabs(cosf(angle)) * 255, 204, 75));
+ entity->setDiffuseColor(QColor(qFabs(qCos(angle)) * 255, 204, 75));
m_entities.append(entity);
}
}