Rename all member variables to follow the style guidelines (prefixed with the 'm') - struct ImportOptions (ColladaUtils)

This commit is contained in:
bank 2014-05-12 19:23:25 +04:00
parent 40037b8b51
commit 733347fd61
9 changed files with 68 additions and 68 deletions

View file

@ -155,8 +155,8 @@ ColladaAppMaterial::ColladaAppMaterial(const domMaterial *pMat)
normalMap = getSamplerImagePath(effect, effectExt->bumpSampler);
// Set the material name
name = ColladaUtils::getOptions().matNamePrefix;
if ( ColladaUtils::getOptions().useDiffuseNames )
name = ColladaUtils::getOptions().mMatNamePrefix;
if ( ColladaUtils::getOptions().mUseDiffuseNames )
{
Torque::Path diffusePath( diffuseMap );
name += diffusePath.getFileName();

View file

@ -1083,7 +1083,7 @@ void ColladaAppMesh::lookupSkinData()
// stores default node transform and rotation. Compensate for this by
// removing the scaling from the inverse bind transform as well
MatrixF invBind = streams.mInvBindMatrices.getMatrixFValue(iJoint);
if (!ColladaUtils::getOptions().ignoreNodeScale)
if (!ColladaUtils::getOptions().mIgnoreNodeScale)
{
Point3F invScale = invBind.getScale();
invScale.x = invScale.x ? (1.0f / invScale.x) : 0;

View file

@ -221,7 +221,7 @@ MatrixF ColladaAppNode::getTransform(F32 time)
else {
// no parent (ie. root level) => scale by global shape <unit>
lastTransform.identity();
lastTransform.scale(ColladaUtils::getOptions().unit);
lastTransform.scale(ColladaUtils::getOptions().mUnit);
if (!isBounds())
ColladaUtils::convertTransform(lastTransform); // don't convert bounds node transform (or upAxis won't work!)
}
@ -242,7 +242,7 @@ MatrixF ColladaAppNode::getTransform(F32 time)
}
// Remove node scaling (but keep reflections) if desired
if (ColladaUtils::getOptions().ignoreNodeScale)
if (ColladaUtils::getOptions().mIgnoreNodeScale)
{
Point3F invScale = mat.getScale();
invScale.x = invScale.x ? (1.0f / invScale.x) : 0;

View file

@ -247,7 +247,7 @@ public:
// OpenCOLLADA profile
pTechnique = findExtraTechnique(node, "OpenCOLLADA");
if (!visibility.element)
if (!visibility.mElement)
GET_EXTRA_PARAM(visibility, 1.0);
GET_EXTRA_PARAM(user_properties, user_properties);
}

View file

@ -210,8 +210,8 @@ ConsoleFunction( loadColladaLights, bool, 2, 4,
upAxis = root->getAsset()->getUp_axis()->getValue();
}
ColladaUtils::getOptions().unit = unit;
ColladaUtils::getOptions().upAxis = upAxis;
ColladaUtils::getOptions().mUnit = unit;
ColladaUtils::getOptions().mUpAxis = upAxis;
// First grab all of the top-level nodes
Vector<ColladaAppNode*> sceneNodes;

View file

@ -86,11 +86,11 @@ ColladaShapeLoader::ColladaShapeLoader(domCOLLADA* _root)
}
// Set import options (if they are not set to override)
if (ColladaUtils::getOptions().unit <= 0.0f)
ColladaUtils::getOptions().unit = unit;
if (ColladaUtils::getOptions().mUnit <= 0.0f)
ColladaUtils::getOptions().mUnit = unit;
if (ColladaUtils::getOptions().upAxis == UPAXISTYPE_COUNT)
ColladaUtils::getOptions().upAxis = upAxis;
if (ColladaUtils::getOptions().mUpAxis == UPAXISTYPE_COUNT)
ColladaUtils::getOptions().mUpAxis = upAxis;
}
ColladaShapeLoader::~ColladaShapeLoader()
@ -267,7 +267,7 @@ void ColladaShapeLoader::enumerateScene()
// Set LOD option
bool singleDetail = true;
switch (ColladaUtils::getOptions().lodType)
switch (ColladaUtils::getOptions().mLodType)
{
case ColladaUtils::ImportOptions::DetectDTS:
// Check for a baseXX->startXX hierarchy at the top-level, if we find
@ -298,7 +298,7 @@ void ColladaShapeLoader::enumerateScene()
break;
}
ColladaAppMesh::fixDetailSize( singleDetail, ColladaUtils::getOptions().singleDetailSize );
ColladaAppMesh::fixDetailSize( singleDetail, ColladaUtils::getOptions().mSingleDetailSize );
// Process the top level nodes
for (S32 iNode = 0; iNode < sceneNodes.size(); iNode++) {
@ -321,18 +321,18 @@ void ColladaShapeLoader::enumerateScene()
bool ColladaShapeLoader::ignoreNode(const String& name)
{
if (FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().alwaysImport, name, false))
if (FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().mAlwaysImport, name, false))
return false;
else
return FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().neverImport, name, false);
return FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().mNeverImport, name, false);
}
bool ColladaShapeLoader::ignoreMesh(const String& name)
{
if (FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().alwaysImportMesh, name, false))
if (FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().mAlwaysImportMesh, name, false))
return false;
else
return FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().neverImportMesh, name, false);
return FindMatch::isMatchMultipleExprs(ColladaUtils::getOptions().mNeverImportMesh, name, false);
}
void ColladaShapeLoader::computeBounds(Box3F& bounds)
@ -341,17 +341,17 @@ void ColladaShapeLoader::computeBounds(Box3F& bounds)
// Check if the model origin needs adjusting
if ( bounds.isValidBox() &&
(ColladaUtils::getOptions().adjustCenter ||
ColladaUtils::getOptions().adjustFloor) )
(ColladaUtils::getOptions().mAdjustCenter ||
ColladaUtils::getOptions().mAdjustFloor) )
{
// Compute shape offset
Point3F shapeOffset = Point3F::Zero;
if ( ColladaUtils::getOptions().adjustCenter )
if ( ColladaUtils::getOptions().mAdjustCenter )
{
bounds.getCenter( &shapeOffset );
shapeOffset = -shapeOffset;
}
if ( ColladaUtils::getOptions().adjustFloor )
if ( ColladaUtils::getOptions().mAdjustFloor )
shapeOffset.z = -bounds.minExtents.z;
// Adjust bounds
@ -448,7 +448,7 @@ void copySketchupTexture(const Torque::Path &path, String &textureFilename)
void updateMaterialsScript(const Torque::Path &path, bool copyTextures = false)
{
#ifdef DAE2DTS_TOOL
if (!ColladaUtils::getOptions().forceUpdateMaterials)
if (!ColladaUtils::getOptions().mForceUpdateMaterials)
return;
#endif
@ -467,7 +467,7 @@ void updateMaterialsScript(const Torque::Path &path, bool copyTextures = false)
if ( Sim::findObject( MATMGR->getMapEntry( mat->getName() ), mappedMat ) )
{
// Only update existing materials if forced to
if ( ColladaUtils::getOptions().forceUpdateMaterials )
if ( ColladaUtils::getOptions().mForceUpdateMaterials )
persistMgr.setDirty( mappedMat );
}
else
@ -677,8 +677,8 @@ TSShape* loadColladaShape(const Torque::Path &path)
#ifdef DAE2DTS_TOOL
// Command line overrides certain options
ColladaUtils::getOptions().forceUpdateMaterials = cmdLineOptions.forceUpdateMaterials;
ColladaUtils::getOptions().useDiffuseNames = cmdLineOptions.useDiffuseNames;
ColladaUtils::getOptions().mForceUpdateMaterials = cmdLineOptions.mForceUpdateMaterials;
ColladaUtils::getOptions().mUseDiffuseNames = cmdLineOptions.mUseDiffuseNames;
#endif
}

View file

@ -49,7 +49,7 @@ void ColladaUtils::convertTransform(MatrixF& mat)
{
MatrixF rot(true);
switch (ColladaUtils::getOptions().upAxis)
switch (ColladaUtils::getOptions().mUpAxis)
{
case UPAXISTYPE_X_UP:
// rotate 90 around Y-axis, then 90 around Z-axis

View file

@ -76,20 +76,20 @@ namespace ColladaUtils
NumLodTypes
};
domUpAxisType upAxis; // Override for the collada <up_axis> element
F32 unit; // Override for the collada <unit> element
eLodType lodType; // LOD type option
S32 singleDetailSize; // Detail size for all meshes in the model
String matNamePrefix; // Prefix to apply to collada material names
String alwaysImport; // List of node names (with wildcards) to import, even if in the neverImport list
String neverImport; // List of node names (with wildcards) to ignore on loading
String alwaysImportMesh; // List of mesh names (with wildcards) to import, even if in the neverImportMesh list
String neverImportMesh; // List of mesh names (with wildcards) to ignore on loading
bool ignoreNodeScale; // Ignore <scale> elements in <node>s
bool adjustCenter; // Translate model so origin is at the center
bool adjustFloor; // Translate model so origin is at the bottom
bool forceUpdateMaterials; // Force update of materials.cs
bool useDiffuseNames; // Use diffuse texture as the material name
domUpAxisType mUpAxis; // Override for the collada <up_axis> element
F32 mUnit; // Override for the collada <unit> element
eLodType mLodType; // LOD type option
S32 mSingleDetailSize; // Detail size for all meshes in the model
String mMatNamePrefix; // Prefix to apply to collada material names
String mAlwaysImport; // List of node names (with wildcards) to import, even if in the neverImport list
String mNeverImport; // List of node names (with wildcards) to ignore on loading
String mAlwaysImportMesh; // List of mesh names (with wildcards) to import, even if in the neverImportMesh list
String mNeverImportMesh; // List of mesh names (with wildcards) to ignore on loading
bool mIgnoreNodeScale; // Ignore <scale> elements in <node>s
bool mAdjustCenter; // Translate model so origin is at the center
bool mAdjustFloor; // Translate model so origin is at the bottom
bool mForceUpdateMaterials; // Force update of materials.cs
bool mUseDiffuseNames; // Use diffuse texture as the material name
ImportOptions()
{
@ -98,20 +98,20 @@ namespace ColladaUtils
void reset()
{
upAxis = UPAXISTYPE_COUNT;
unit = -1.0f;
lodType = DetectDTS;
singleDetailSize = 2;
matNamePrefix = "";
alwaysImport = "";
neverImport = "";
alwaysImportMesh = "";
neverImportMesh = "";
ignoreNodeScale = false;
adjustCenter = false;
adjustFloor = false;
forceUpdateMaterials = false;
useDiffuseNames = false;
mUpAxis = UPAXISTYPE_COUNT;
mUnit = -1.0f;
mLodType = DetectDTS;
mSingleDetailSize = 2;
mMatNamePrefix = "";
mAlwaysImport = "";
mNeverImport = "";
mAlwaysImportMesh = "";
mNeverImportMesh = "";
mIgnoreNodeScale = false;
mAdjustCenter = false;
mAdjustFloor = false;
mForceUpdateMaterials = false;
mUseDiffuseNames = false;
}
};