mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Update assimpShapeLoader.cpp
most uniform shape import across the formats....
This commit is contained in:
parent
4ac9639a52
commit
684f299e86
1 changed files with 3 additions and 13 deletions
|
|
@ -182,7 +182,7 @@ void AssimpShapeLoader::enumerateScene()
|
||||||
Con::printf("[ASSIMP] Attempting to load file: %s", shapePath.getFullPath().c_str());
|
Con::printf("[ASSIMP] Attempting to load file: %s", shapePath.getFullPath().c_str());
|
||||||
|
|
||||||
// Define post-processing steps
|
// Define post-processing steps
|
||||||
unsigned int ppsteps = aiProcess_Triangulate | aiProcess_ConvertToLeftHanded & ~aiProcess_MakeLeftHanded;
|
unsigned int ppsteps = aiProcess_Triangulate | aiProcess_ConvertToLeftHanded & ~aiProcess_FlipWindingOrder;
|
||||||
|
|
||||||
const auto& options = ColladaUtils::getOptions();
|
const auto& options = ColladaUtils::getOptions();
|
||||||
if (options.reverseWindingOrder) ppsteps |= aiProcess_FlipWindingOrder;
|
if (options.reverseWindingOrder) ppsteps |= aiProcess_FlipWindingOrder;
|
||||||
|
|
@ -249,12 +249,6 @@ void AssimpShapeLoader::enumerateScene()
|
||||||
}
|
}
|
||||||
|
|
||||||
aiMatrix4x4 rotationMatrix;
|
aiMatrix4x4 rotationMatrix;
|
||||||
rotationMatrix = aiMatrix4x4::RotationX(-AI_MATH_PI / 2, rotationMatrix);
|
|
||||||
applyTransformation(mScene->mRootNode, rotationMatrix);
|
|
||||||
|
|
||||||
rotationMatrix = aiMatrix4x4::RotationY(AI_MATH_PI, rotationMatrix);
|
|
||||||
applyTransformation(mScene->mRootNode, rotationMatrix);
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < mScene->mNumTextures; ++i) {
|
for (unsigned int i = 0; i < mScene->mNumTextures; ++i) {
|
||||||
extractTexture(i, mScene->mTextures[i]);
|
extractTexture(i, mScene->mTextures[i]);
|
||||||
}
|
}
|
||||||
|
|
@ -280,12 +274,8 @@ void AssimpShapeLoader::enumerateScene()
|
||||||
if (!boundsNode) {
|
if (!boundsNode) {
|
||||||
auto* reqNode = new aiNode("bounds");
|
auto* reqNode = new aiNode("bounds");
|
||||||
mScene->mRootNode->addChildren(1, &reqNode);
|
mScene->mRootNode->addChildren(1, &reqNode);
|
||||||
rotationMatrix = aiMatrix4x4::RotationX(-AI_MATH_PI / 2, rotationMatrix);
|
reqNode->mTransformation = mScene->mRootNode->mTransformation;
|
||||||
applyTransformation(reqNode, rotationMatrix);
|
auto* appBoundsNode = new AssimpAppNode(mScene, reqNode);
|
||||||
/*rotationMatrix = aiMatrix4x4::RotationY(-AI_MATH_PI, rotationMatrix);
|
|
||||||
applyTransformation(reqNode, rotationMatrix);*/
|
|
||||||
|
|
||||||
auto* appBoundsNode = new AssimpAppNode(mScene, reqNode, rootNode);
|
|
||||||
if (!processNode(appBoundsNode)) {
|
if (!processNode(appBoundsNode)) {
|
||||||
delete appBoundsNode;
|
delete appBoundsNode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue