summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/backend/animationclip.cpp4
-rw-r--r--src/animation/backend/gltfimporter.cpp36
-rw-r--r--src/animation/backend/gltfimporter_p.h8
-rw-r--r--src/animation/frontend/qmorphinganimation.cpp8
-rw-r--r--src/animation/frontend/qmorphtarget.cpp22
-rw-r--r--src/animation/frontend/qmorphtarget.h14
-rw-r--r--src/animation/frontend/qmorphtarget_p.h2
-rw-r--r--src/animation/frontend/qvertexblendanimation.cpp12
8 files changed, 53 insertions, 53 deletions
diff --git a/src/animation/backend/animationclip.cpp b/src/animation/backend/animationclip.cpp
index 2c7e4fffb..9f18b5eed 100644
--- a/src/animation/backend/animationclip.cpp
+++ b/src/animation/backend/animationclip.cpp
@@ -42,7 +42,7 @@
#include <Qt3DAnimation/private/animationlogging_p.h>
#include <Qt3DAnimation/private/managers_p.h>
#include <Qt3DAnimation/private/gltfimporter_p.h>
-#include <Qt3DRender/private/qurlhelper_p.h>
+#include <Qt3DCore/private/qurlhelper_p.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qfile.h>
@@ -187,7 +187,7 @@ void AnimationClip::loadAnimation()
void AnimationClip::loadAnimationFromUrl()
{
// TODO: Handle remote files
- QString filePath = Qt3DRender::QUrlHelper::urlToLocalFileOrQrc(m_source);
+ QString filePath = Qt3DCore::QUrlHelper::urlToLocalFileOrQrc(m_source);
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly)) {
qWarning() << "Could not find animation clip:" << filePath;
diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp
index f7907b3c2..82401dd5e 100644
--- a/src/animation/backend/gltfimporter.cpp
+++ b/src/animation/backend/gltfimporter.cpp
@@ -193,7 +193,7 @@ GLTFImporter::BufferView::BufferView(const QJsonObject &json)
}
GLTFImporter::AccessorData::AccessorData()
- : type(Qt3DRender::QAttribute::Float)
+ : type(Qt3DCore::QAttribute::Float)
, dataSize(0)
, count(0)
, byteOffset(0)
@@ -369,39 +369,39 @@ GLTFImporter::Node::Node(const QJsonObject &json)
skinIndex = skinValue.toInt();
}
-Qt3DRender::QAttribute::VertexBaseType GLTFImporter::accessorTypeFromJSON(int componentType)
+Qt3DCore::QAttribute::VertexBaseType GLTFImporter::accessorTypeFromJSON(int componentType)
{
if (componentType == GL_BYTE)
- return Qt3DRender::QAttribute::Byte;
+ return Qt3DCore::QAttribute::Byte;
else if (componentType == GL_UNSIGNED_BYTE)
- return Qt3DRender::QAttribute::UnsignedByte;
+ return Qt3DCore::QAttribute::UnsignedByte;
else if (componentType == GL_SHORT)
- return Qt3DRender::QAttribute::Short;
+ return Qt3DCore::QAttribute::Short;
else if (componentType == GL_UNSIGNED_SHORT)
- return Qt3DRender::QAttribute::UnsignedShort;
+ return Qt3DCore::QAttribute::UnsignedShort;
else if (componentType == GL_UNSIGNED_INT)
- return Qt3DRender::QAttribute::UnsignedInt;
+ return Qt3DCore::QAttribute::UnsignedInt;
else if (componentType == GL_FLOAT)
- return Qt3DRender::QAttribute::Float;
+ return Qt3DCore::QAttribute::Float;
// There shouldn't be an invalid case here
qWarning("unsupported accessor type %d", componentType);
- return Qt3DRender::QAttribute::Float;
+ return Qt3DCore::QAttribute::Float;
}
-uint GLTFImporter::accessorTypeSize(Qt3DRender::QAttribute::VertexBaseType componentType)
+uint GLTFImporter::accessorTypeSize(Qt3DCore::QAttribute::VertexBaseType componentType)
{
switch (componentType) {
- case Qt3DRender::QAttribute::Byte:
- case Qt3DRender::QAttribute::UnsignedByte:
+ case Qt3DCore::QAttribute::Byte:
+ case Qt3DCore::QAttribute::UnsignedByte:
return 1;
- case Qt3DRender::QAttribute::Short:
- case Qt3DRender::QAttribute::UnsignedShort:
+ case Qt3DCore::QAttribute::Short:
+ case Qt3DCore::QAttribute::UnsignedShort:
return 2;
- case Qt3DRender::QAttribute::Int:
- case Qt3DRender::QAttribute::Float:
+ case Qt3DCore::QAttribute::Int:
+ case Qt3DCore::QAttribute::Float:
return 4;
default:
@@ -522,12 +522,12 @@ GLTFImporter::AnimationNameAndChannels GLTFImporter::createAnimationData(int ani
const auto &inputAccessor = m_accessors[sampler.inputAccessorIndex];
const auto &outputAccessor = m_accessors[sampler.outputAccessorIndex];
- if (inputAccessor.type != Qt3DRender::QAttribute::Float) {
+ if (inputAccessor.type != Qt3DCore::QAttribute::Float) {
qWarning() << "Input accessor has wrong data type. Skipping channel.";
continue;
}
- if (outputAccessor.type != Qt3DRender::QAttribute::Float) {
+ if (outputAccessor.type != Qt3DCore::QAttribute::Float) {
qWarning() << "Output accessor has wrong data type. Skipping channel.";
continue;
}
diff --git a/src/animation/backend/gltfimporter_p.h b/src/animation/backend/gltfimporter_p.h
index e31f8d078..ef0486181 100644
--- a/src/animation/backend/gltfimporter_p.h
+++ b/src/animation/backend/gltfimporter_p.h
@@ -50,7 +50,7 @@
#include <QtGlobal>
#include <Qt3DAnimation/private/fcurve_p.h>
-#include <Qt3DRender/qattribute.h>
+#include <Qt3DCore/qattribute.h>
#include <Qt3DCore/private/sqt_p.h>
#include <Qt3DCore/private/qmath3d_p.h>
@@ -100,7 +100,7 @@ public:
explicit AccessorData(const QJsonObject &json);
int bufferViewIndex;
- Qt3DRender::QAttribute::VertexBaseType type;
+ Qt3DCore::QAttribute::VertexBaseType type;
uint dataSize;
int count;
int byteOffset;
@@ -190,8 +190,8 @@ public:
AnimationNameAndChannels createAnimationData(int animationIndex, const QString &animationName = QString()) const;
private:
- static Qt3DRender::QAttribute::VertexBaseType accessorTypeFromJSON(int componentType);
- static uint accessorTypeSize(Qt3DRender::QAttribute::VertexBaseType componentType);
+ static Qt3DCore::QAttribute::VertexBaseType accessorTypeFromJSON(int componentType);
+ static uint accessorTypeSize(Qt3DCore::QAttribute::VertexBaseType componentType);
static uint accessorDataSizeFromJson(const QString &type);
struct RawData
diff --git a/src/animation/frontend/qmorphinganimation.cpp b/src/animation/frontend/qmorphinganimation.cpp
index c73a6abd7..5b16668f9 100644
--- a/src/animation/frontend/qmorphinganimation.cpp
+++ b/src/animation/frontend/qmorphinganimation.cpp
@@ -50,7 +50,7 @@ namespace Qt3DAnimation {
A Qt3DAnimation::QMorphingAnimation class implements blend-shape morphing animation
to a target \l {Qt3DRender::QGeometryRenderer}{QGeometryRenderer}. The QMorphingAnimation
- sets the correct \l {Qt3DRender::QAttribute}{QAttributes} from the
+ sets the correct \l {Qt3DCore::QAttribute}{QAttributes} from the
\l {Qt3DAnimation::QMorphTarget}{morph targets} to the target
\l {Qt3DRender::QGeometryRenderer::geometry} {QGeometryRenderer::geometry} and calculates
interpolator for the current position. The actual blending between the attributes must
@@ -248,16 +248,16 @@ void QMorphingAnimationPrivate::updateAnimation(float position)
void QMorphingAnimationPrivate::setTargetInterpolated(int morphTarget)
{
QMorphTarget *target = m_morphTargets[morphTarget];
- Qt3DRender::QGeometry *geometry = m_target->geometry();
+ Qt3DCore::QGeometry *geometry = m_target->geometry();
// remove attributes from previous frame
if (m_currentTarget && (target != m_currentTarget)) {
- const QVector<Qt3DRender::QAttribute *> targetAttributes = m_currentTarget->attributeList();
+ const QVector<Qt3DCore::QAttribute *> targetAttributes = m_currentTarget->attributeList();
for (int i = 0; i < targetAttributes.size(); ++i)
geometry->removeAttribute(targetAttributes.at(i));
}
- const QVector<Qt3DRender::QAttribute *> targetAttributes = target->attributeList();
+ const QVector<Qt3DCore::QAttribute *> targetAttributes = target->attributeList();
// add attributes from current frame to the geometry
if (target != m_currentTarget) {
diff --git a/src/animation/frontend/qmorphtarget.cpp b/src/animation/frontend/qmorphtarget.cpp
index da068d477..1edaf2445 100644
--- a/src/animation/frontend/qmorphtarget.cpp
+++ b/src/animation/frontend/qmorphtarget.cpp
@@ -49,9 +49,9 @@ namespace Qt3DAnimation {
\inherits QObject
A Qt3DAnimation::QMorphTarget class is a convenience class, which provides a list
- of \l {Qt3DRender::QAttribute} {QAttributes}, which the QMorphingAnimation uses
+ of \l {Qt3DCore::QAttribute} {QAttributes}, which the QMorphingAnimation uses
to animate geometry. A QMorphTarget can also be created based on existing
- \l Qt3DRender::QGeometry.
+ \l Qt3DCore::QGeometry.
*/
/*!
@@ -99,7 +99,7 @@ QMorphTargetPrivate::QMorphTargetPrivate()
void QMorphTargetPrivate::updateAttributeNames()
{
m_attributeNames.clear();
- for (const Qt3DRender::QAttribute *attr : qAsConst(m_targetAttributes))
+ for (const Qt3DCore::QAttribute *attr : qAsConst(m_targetAttributes))
m_attributeNames.push_back(attr->name());
}
@@ -115,7 +115,7 @@ QMorphTarget::QMorphTarget(QObject *parent)
/*!
Returns a list of attributes contained in the morph target.
*/
-QVector<Qt3DRender::QAttribute *> QMorphTarget::attributeList() const
+QVector<Qt3DCore::QAttribute *> QMorphTarget::attributeList() const
{
Q_D(const QMorphTarget);
return d->m_targetAttributes;
@@ -130,12 +130,12 @@ QStringList QMorphTarget::attributeNames() const
/*!
Sets \a attributes to the morph target. Old attributes are cleared.
*/
-void QMorphTarget::setAttributes(const QVector<Qt3DRender::QAttribute *> &attributes)
+void QMorphTarget::setAttributes(const QVector<Qt3DCore::QAttribute *> &attributes)
{
Q_D(QMorphTarget);
d->m_targetAttributes = attributes;
d->m_attributeNames.clear();
- for (const Qt3DRender::QAttribute *attr : attributes)
+ for (const Qt3DCore::QAttribute *attr : attributes)
d->m_attributeNames.push_back(attr->name());
emit attributeNamesChanged(d->m_attributeNames);
@@ -145,10 +145,10 @@ void QMorphTarget::setAttributes(const QVector<Qt3DRender::QAttribute *> &attrib
Adds an \a attribute the morph target. An attribute with the same
name must not have been added previously to the morph target.
*/
-void QMorphTarget::addAttribute(Qt3DRender::QAttribute *attribute)
+void QMorphTarget::addAttribute(Qt3DCore::QAttribute *attribute)
{
Q_D(QMorphTarget);
- for (const Qt3DRender::QAttribute *attr : qAsConst(d->m_targetAttributes)) {
+ for (const Qt3DCore::QAttribute *attr : qAsConst(d->m_targetAttributes)) {
if (attr->name() == attribute->name())
return;
}
@@ -160,7 +160,7 @@ void QMorphTarget::addAttribute(Qt3DRender::QAttribute *attribute)
/*!
Removes an \a attribute from the morph target.
*/
-void QMorphTarget::removeAttribute(Qt3DRender::QAttribute *attribute)
+void QMorphTarget::removeAttribute(Qt3DCore::QAttribute *attribute)
{
Q_D(QMorphTarget);
if (d->m_targetAttributes.contains(attribute)) {
@@ -173,11 +173,11 @@ void QMorphTarget::removeAttribute(Qt3DRender::QAttribute *attribute)
/*!
Returns a morph target based on the \a attributes in the given \a geometry.
*/
-QMorphTarget *QMorphTarget::fromGeometry(Qt3DRender::QGeometry *geometry, const QStringList &attributes)
+QMorphTarget *QMorphTarget::fromGeometry(Qt3DCore::QGeometry *geometry, const QStringList &attributes)
{
QMorphTarget *target = new QMorphTarget();
const auto geometryAttributes = geometry->attributes();
- for (Qt3DRender::QAttribute *attr : geometryAttributes) {
+ for (Qt3DCore::QAttribute *attr : geometryAttributes) {
if (attributes.contains(attr->name()))
target->addAttribute(attr);
}
diff --git a/src/animation/frontend/qmorphtarget.h b/src/animation/frontend/qmorphtarget.h
index ec9761c64..210a3be41 100644
--- a/src/animation/frontend/qmorphtarget.h
+++ b/src/animation/frontend/qmorphtarget.h
@@ -37,8 +37,8 @@
#ifndef QT3DANIMATION_QMORPHTARGET_H
#define QT3DANIMATION_QMORPHTARGET_H
-#include <Qt3DRender/qattribute.h>
-#include <Qt3DRender/qgeometry.h>
+#include <Qt3DCore/qattribute.h>
+#include <Qt3DCore/qgeometry.h>
#include <QtCore/qstringlist.h>
@@ -58,14 +58,14 @@ class Q_3DANIMATIONSHARED_EXPORT QMorphTarget : public QObject
public:
explicit QMorphTarget(QObject *parent = nullptr);
- QVector<Qt3DRender::QAttribute *> attributeList() const;
+ QVector<Qt3DCore::QAttribute *> attributeList() const;
QStringList attributeNames() const;
- void setAttributes(const QVector<Qt3DRender::QAttribute *> &attributes);
- void addAttribute(Qt3DRender::QAttribute *attribute);
- void removeAttribute(Qt3DRender::QAttribute *attribute);
+ void setAttributes(const QVector<Qt3DCore::QAttribute *> &attributes);
+ void addAttribute(Qt3DCore::QAttribute *attribute);
+ void removeAttribute(Qt3DCore::QAttribute *attribute);
- Q_INVOKABLE static QMorphTarget *fromGeometry(Qt3DRender::QGeometry *geometry,
+ Q_INVOKABLE static QMorphTarget *fromGeometry(Qt3DCore::QGeometry *geometry,
const QStringList &attributes);
Q_SIGNALS:
diff --git a/src/animation/frontend/qmorphtarget_p.h b/src/animation/frontend/qmorphtarget_p.h
index 1fc3734ae..3214043f4 100644
--- a/src/animation/frontend/qmorphtarget_p.h
+++ b/src/animation/frontend/qmorphtarget_p.h
@@ -64,7 +64,7 @@ public:
void updateAttributeNames();
QStringList m_attributeNames;
- QVector<Qt3DRender::QAttribute *> m_targetAttributes;
+ QVector<Qt3DCore::QAttribute *> m_targetAttributes;
Q_DECLARE_PUBLIC(QMorphTarget)
};
diff --git a/src/animation/frontend/qvertexblendanimation.cpp b/src/animation/frontend/qvertexblendanimation.cpp
index 143b9553a..77ba9a301 100644
--- a/src/animation/frontend/qvertexblendanimation.cpp
+++ b/src/animation/frontend/qvertexblendanimation.cpp
@@ -51,7 +51,7 @@ namespace Qt3DAnimation {
A Qt3DAnimation::QVertexBlendAnimation class implements vertex-blend morphing animation
to a target \l {Qt3DRender::QGeometryRenderer}{QGeometryRenderer}. The QVertexBlendAnimation
- sets the correct \l {Qt3DRender::QAttribute}{QAttributes} from the
+ sets the correct \l {Qt3DCore::QAttribute}{QAttributes} from the
\l {Qt3DAnimation::QMorphTarget}{morph targets} to the target
\l {Qt3DRender::QGeometryRenderer::geometry} {QGeometryRenderer::geometry} and calculates
interpolator for the current position. Unlike with QMorphingAnimation, where the blending is
@@ -189,21 +189,21 @@ void QVertexBlendAnimationPrivate::updateAnimation(float position)
base = m_morphTargets.at(target0);
target = m_morphTargets.at(target1);
- Qt3DRender::QGeometry *geometry = m_target->geometry();
+ Qt3DCore::QGeometry *geometry = m_target->geometry();
// remove attributes from previous frame
if (m_currentBase && m_currentTarget &&
(base != m_currentBase || target != m_currentTarget)) {
- const QVector<Qt3DRender::QAttribute *> baseAttributes = m_currentBase->attributeList();
- const QVector<Qt3DRender::QAttribute *> targetAttributes = m_currentTarget->attributeList();
+ const QVector<Qt3DCore::QAttribute *> baseAttributes = m_currentBase->attributeList();
+ const QVector<Qt3DCore::QAttribute *> targetAttributes = m_currentTarget->attributeList();
for (int i = 0; i < baseAttributes.size(); ++i) {
geometry->removeAttribute(baseAttributes.at(i));
geometry->removeAttribute(targetAttributes.at(i));
}
}
- const QVector<Qt3DRender::QAttribute *> baseAttributes = base->attributeList();
- const QVector<Qt3DRender::QAttribute *> targetAttributes = target->attributeList();
+ const QVector<Qt3DCore::QAttribute *> baseAttributes = base->attributeList();
+ const QVector<Qt3DCore::QAttribute *> targetAttributes = target->attributeList();
const QStringList attributeNames = base->attributeNames();
// add attributes from current frame to the geometry