summaryrefslogtreecommitdiffstats
path: root/src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp')
-rw-r--r--src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp b/src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp
index 55d23c67..a098a301 100644
--- a/src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp
+++ b/src/Authoring/QT3DSIMP/Qt3DSImportSGTranslation/Qt3DSImportSceneGraphTranslation.cpp
@@ -38,7 +38,6 @@
#include "foundation/Qt3DSVec3.h"
#include "foundation/Qt3DSMemoryBuffer.h"
#include "Qt3DSImportComposerTypes.h"
-#include "CommonConstants.h"
#include <QtCore/qstring.h>
@@ -247,7 +246,7 @@ void matrixFromAxisAngle(float inDegreeAngle, float inXAxis, float inYAxis, floa
return;
}
- inDegreeAngle *= (float)QT3DS_DEGREES_TO_RADIANS;
+ inDegreeAngle *= float(Q3DStudio::QT3DS_DEGREES_TO_RADIANS);
Q3DStudio::CVector3 theAxis(inXAxis, inYAxis, inZAxis);
if (theAxis.LengthSquared() != 1.0f)
@@ -406,7 +405,7 @@ public:
TCharPtr ToImport(const char *data)
{
- if (data == NULL || *data == 0)
+ if (data == nullptr || *data == 0)
return L"";
// Convert from multi byte to wide character string
@@ -428,7 +427,7 @@ public:
}
TCharPtr name(ToImport(inName));
- if (name == NULL || *name == 0)
+ if (name == nullptr || *name == 0)
name = ComposerObjectTypes::Convert(inType);
Q3DStudio::CFilePath objectName = Q3DStudio::CFilePath(name);
@@ -491,8 +490,6 @@ public:
void SetLightProperties(int type, const SFloat4 &color, double intensity, double linearfade,
double quadfade, bool shadows) override
{
- Q_UNUSED(linearfade)
- Q_UNUSED(quadfade)
TIMPHandle light = m_InstanceStack.back();
switch (type) {
case 0:
@@ -511,10 +508,8 @@ public:
}
m_Import.SetInstancePropertyValue(light, m_Light.m_LightColor, color);
m_Import.SetInstancePropertyValue(light, m_Light.m_Brightness, intensity);
- // TODO: These do not seem to be incuded in FbxLight. Kept here in case Collada has support
- // for them (QT3DS-2857)
- //m_Import.SetInstancePropertyValue(light, m_Light.m_LinearFade, linearfade);
- //m_Import.SetInstancePropertyValue(light, m_Light.m_ExpFade, quadfade);
+ m_Import.SetInstancePropertyValue(light, m_Light.m_LinearFade, linearfade);
+ m_Import.SetInstancePropertyValue(light, m_Light.m_ExpFade, quadfade);
m_Import.SetInstancePropertyValue(light, m_Light.m_CastShadow, shadows);
}
void PopLight() override { PopObject(); }
@@ -530,8 +525,10 @@ public:
m_Import.SetInstancePropertyValue(camera, m_Camera.m_ClipFar, clipend);
m_Import.SetInstancePropertyValue(camera, m_Camera.m_Orthographic, ortho);
m_Import.SetInstancePropertyValue(camera, m_Camera.m_Fov, fov);
- if (m_AuthoringToolType == EAuthoringToolType_FBX_Maya)
+ if (m_AuthoringToolType == EAuthoringToolType_FBX_Maya
+ || m_AuthoringToolType == EAuthoringToolType_OpenCollada_Maya) {
m_Import.SetInstancePropertyValue(camera, m_Camera.m_FovHorizontal, true);
+ }
}
void PopCamera() override { PopObject(); }
@@ -635,7 +632,7 @@ public:
}
CharPtrOrError result = m_Import.AddImage(source);
TCharPtr dest = result.m_Value;
- TCharPtr imgPath = NULL;
+ TCharPtr imgPath = nullptr;
wchar_t pathBuf[1024];
if (result.m_Error) {
ESceneGraphWarningCode code = ESceneGraphWarningCode_Generic;
@@ -648,7 +645,7 @@ public:
}
m_Log.OnWarning(code, errorStr);
}
- if (result.m_Value != NULL && *result.m_Value)
+ if (result.m_Value != nullptr && *result.m_Value)
imgPath = result.m_Value;
else {
swprintf(pathBuf, 1024, L"%hs/missing.png",
@@ -1007,7 +1004,7 @@ public:
template <typename TDataType>
static NVConstDataRef<QT3DSU8> toRef(const std::vector<TDataType> &data)
{
- const TDataType *dataPtr = data.size() ? &data[0] : NULL;
+ const TDataType *dataPtr = data.size() ? &data[0] : nullptr;
return toU8ConstDataRef(dataPtr, (QT3DSU32)data.size());
}