Skip to content

Commit ad9da79

Browse files
authored
Merge pull request #1339 from marauder2k9-torque/assimp-cleanup
final cleanup
2 parents 70f546a + 87de724 commit ad9da79

3 files changed

Lines changed: 0 additions & 55 deletions

File tree

Engine/source/ts/assimp/assimpAppNode.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ MatrixF AssimpAppNode::getTransform(F32 time)
7171
// no parent (ie. root level) => scale by global shape <unit>
7272
mLastTransform.identity();
7373
mLastTransform.scale(ColladaUtils::getOptions().unit * ColladaUtils::getOptions().formatScaleFactor);
74-
/*if (!isBounds())
75-
convertMat(mLastTransform);*/
7674
}
7775

7876
// If this node is animated in the active sequence, fetch the animated transform
@@ -254,41 +252,6 @@ void AssimpAppNode::assimpToTorqueMat(const aiMatrix4x4& inAssimpMat, MatrixF& o
254252
(F32)inAssimpMat.d3, (F32)inAssimpMat.d4));
255253
}
256254

257-
void AssimpAppNode::convertMat(MatrixF& outMat)
258-
{
259-
MatrixF rot(true);
260-
261-
switch (ColladaUtils::getOptions().upAxis)
262-
{
263-
case UPAXISTYPE_X_UP:
264-
// rotate 90 around Y-axis, then 90 around Z-axis
265-
rot(0, 0) = 0.0f; rot(1, 0) = 1.0f;
266-
rot(1, 1) = 0.0f; rot(2, 1) = 1.0f;
267-
rot(0, 2) = 1.0f; rot(2, 2) = 0.0f;
268-
269-
// pre-multiply the transform by the rotation matrix
270-
outMat.mulL(rot);
271-
break;
272-
273-
case UPAXISTYPE_Y_UP:
274-
// rotate 180 around Y-axis, then 90 around X-axis
275-
rot(0, 0) = 1.0f;
276-
rot(1, 1) = 0.0f;
277-
rot(1, 2) = -1.0f;
278-
rot(2, 1) = 1.0f;
279-
rot(2, 2) = 0.0f;
280-
281-
// pre-multiply the transform by the rotation matrix
282-
outMat.mulL(rot);
283-
break;
284-
285-
case UPAXISTYPE_Z_UP:
286-
default:
287-
// nothing to do
288-
break;
289-
}
290-
}
291-
292255
aiNode* AssimpAppNode::findChildNodeByName(const char* nodeName, aiNode* rootNode)
293256
{
294257
aiNode* retNode = NULL;

Engine/source/ts/assimp/assimpAppNode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class AssimpAppNode : public AppNode
114114
bool isParentRoot() override { return (appParent == NULL); }
115115

116116
static void assimpToTorqueMat(const aiMatrix4x4& inAssimpMat, MatrixF& outMat);
117-
static void convertMat(MatrixF& outMat);
118117
static aiNode* findChildNodeByName(const char* nodeName, aiNode* rootNode);
119118

120119
void addChild(AssimpAppNode* child);

Engine/source/ts/assimp/assimpShapeLoader.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,6 @@ void applyTransformation(aiNode* node, const aiMatrix4x4& transform) {
128128
node->mTransformation = transform * node->mTransformation; // Apply transformation to the node
129129
}
130130

131-
void applyRootTransformation(aiNode* node, const aiMatrix4x4& transform) {
132-
node->mTransformation = transform * node->mTransformation; // Apply transformation to the node
133-
134-
// Recursively apply to all child nodes
135-
for (unsigned int i = 0; i < node->mNumChildren; ++i) {
136-
applyRootTransformation(node->mChildren[i], transform);
137-
}
138-
}
139-
140131
void scaleScene(const aiScene* scene, F32 scaleFactor) {
141132
aiMatrix4x4 scaleMatrix;
142133
scaleMatrix = aiMatrix4x4::Scaling(aiVector3D(scaleFactor, scaleFactor, scaleFactor), scaleMatrix);
@@ -263,9 +254,6 @@ void AssimpShapeLoader::enumerateScene()
263254
}
264255
}
265256

266-
if (fileExt == String::ToString("glb"))
267-
ColladaUtils::getOptions().upAxis = UPAXISTYPE_X_UP;
268-
269257
for (U32 i = 0; i < mScene->mNumTextures; ++i) {
270258
extractTexture(i, mScene->mTextures[i]);
271259
}
@@ -330,11 +318,6 @@ void AssimpShapeLoader::configureImportUnits() {
330318
}
331319
options.unit = static_cast<F32>(unitScaleFactor);
332320
}
333-
334-
int upAxis = UPAXISTYPE_Z_UP;
335-
if (getMetaInt("UpAxis", upAxis)) {
336-
options.upAxis = static_cast<domUpAxisType>(upAxis);
337-
}
338321
}
339322

340323
void AssimpShapeLoader::processAssimpNode(const aiNode* node, const aiScene* scene, AssimpAppNode* parentNode)

0 commit comments

Comments
 (0)