Rename all member variables to follow the style guidelines (prefixed with the 'm') - class ColladaAppMesh

This commit is contained in:
bank 2014-05-12 18:37:22 +04:00
parent 9e3eab7551
commit 7c1544317b
2 changed files with 85 additions and 85 deletions

View file

@ -40,8 +40,8 @@ namespace DictHash
using namespace ColladaUtils; using namespace ColladaUtils;
bool ColladaAppMesh::fixedSizeEnabled = false; bool ColladaAppMesh::mFixedSizeEnabled = false;
S32 ColladaAppMesh::fixedSize = 2; S32 ColladaAppMesh::mFixedSize = 2;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Define a VertTuple dictionary to allow fast tuple lookups // Define a VertTuple dictionary to allow fast tuple lookups
@ -317,7 +317,7 @@ public:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
ColladaAppMesh::ColladaAppMesh(const domInstance_geometry* instance, ColladaAppNode* node) ColladaAppMesh::ColladaAppMesh(const domInstance_geometry* instance, ColladaAppNode* node)
: instanceGeom(instance), instanceCtrl(0), appNode(node), geomExt(0) : mInstanceGeom(instance), mInstanceCtrl(0), mAppNode(node), mGeomExt(0)
{ {
mFlags = 0; mFlags = 0;
mNumFrames = 0; mNumFrames = 0;
@ -325,7 +325,7 @@ ColladaAppMesh::ColladaAppMesh(const domInstance_geometry* instance, ColladaAppN
} }
ColladaAppMesh::ColladaAppMesh(const domInstance_controller* instance, ColladaAppNode* node) ColladaAppMesh::ColladaAppMesh(const domInstance_controller* instance, ColladaAppNode* node)
: instanceGeom(0), instanceCtrl(instance), appNode(node), geomExt(0) : mInstanceGeom(0), mInstanceCtrl(instance), mAppNode(node), mGeomExt(0)
{ {
mFlags = 0; mFlags = 0;
mNumFrames = 0; mNumFrames = 0;
@ -337,18 +337,18 @@ const char* ColladaAppMesh::getName(bool allowFixed)
// Some exporters add a 'PIVOT' or unnamed node between the mesh and the // Some exporters add a 'PIVOT' or unnamed node between the mesh and the
// actual object node. Detect this and return the object node name instead // actual object node. Detect this and return the object node name instead
// of the pivot node. // of the pivot node.
const char* nodeName = appNode->getName(); const char* nodeName = mAppNode->getName();
if ( dStrEqual(nodeName, "null") || dStrEndsWith(nodeName, "PIVOT") ) if ( dStrEqual(nodeName, "null") || dStrEndsWith(nodeName, "PIVOT") )
nodeName = appNode->getParentName(); nodeName = mAppNode->getParentName();
// If all geometry is being fixed to the same size, append the size // If all geometry is being fixed to the same size, append the size
// to the name // to the name
return allowFixed && fixedSizeEnabled ? avar("%s %d", nodeName, fixedSize) : nodeName; return allowFixed && mFixedSizeEnabled ? avar("%s %d", nodeName, mFixedSize) : nodeName;
} }
MatrixF ColladaAppMesh::getMeshTransform(F32 time) MatrixF ColladaAppMesh::getMeshTransform(F32 time)
{ {
return appNode->getNodeTransform(time); return mAppNode->getNodeTransform(time);
} }
bool ColladaAppMesh::animatesVis(const AppSequence* appSeq) bool ColladaAppMesh::animatesVis(const AppSequence* appSeq)
@ -357,7 +357,7 @@ bool ColladaAppMesh::animatesVis(const AppSequence* appSeq)
(dynamic_cast<const ColladaAppNode*>(node)->nodeExt->visibility.isAnimated(appSeq->getStart(), appSeq->getEnd())) (dynamic_cast<const ColladaAppNode*>(node)->nodeExt->visibility.isAnimated(appSeq->getStart(), appSeq->getEnd()))
// Check if the node visibility is animated within the sequence interval // Check if the node visibility is animated within the sequence interval
return IS_VIS_ANIMATED(appNode) || (appNode->appParent ? IS_VIS_ANIMATED(appNode->appParent) : false); return IS_VIS_ANIMATED(mAppNode) || (mAppNode->appParent ? IS_VIS_ANIMATED(mAppNode->appParent) : false);
} }
bool ColladaAppMesh::animatesMatFrame(const AppSequence* appSeq) bool ColladaAppMesh::animatesMatFrame(const AppSequence* appSeq)
@ -421,7 +421,7 @@ F32 ColladaAppMesh::getVisValue(F32 t)
(dynamic_cast<const ColladaAppNode*>(node)->nodeExt->visibility.getValue(t)) (dynamic_cast<const ColladaAppNode*>(node)->nodeExt->visibility.getValue(t))
// Get the visibility of the mesh's node at time, 't' // Get the visibility of the mesh's node at time, 't'
return GET_VIS(appNode) * (appNode->appParent ? GET_VIS(appNode->appParent) : 1.0f); return GET_VIS(mAppNode) * (mAppNode->appParent ? GET_VIS(mAppNode->appParent) : 1.0f);
} }
S32 ColladaAppMesh::addMaterial(const char* symbol) S32 ColladaAppMesh::addMaterial(const char* symbol)
@ -431,14 +431,14 @@ S32 ColladaAppMesh::addMaterial(const char* symbol)
// Lookup the symbol in the materials already bound to this geometry/controller // Lookup the symbol in the materials already bound to this geometry/controller
// instance // instance
Map<StringTableEntry,U32>::Iterator itr = boundMaterials.find(symbol); Map<StringTableEntry,U32>::Iterator itr = mBoundMaterials.find(symbol);
if (itr != boundMaterials.end()) if (itr != mBoundMaterials.end())
return itr->value; return itr->value;
// Find the Collada material that this symbol maps to // Find the Collada material that this symbol maps to
U32 matIndex = TSDrawPrimitive::NoMaterial; U32 matIndex = TSDrawPrimitive::NoMaterial;
const domBind_material* binds = instanceGeom ? instanceGeom->getBind_material() : const domBind_material* binds = mInstanceGeom ? mInstanceGeom->getBind_material() :
instanceCtrl->getBind_material(); mInstanceCtrl->getBind_material();
if (binds) { if (binds) {
const domInstance_material_Array& matArray = binds->getTechnique_common()->getInstance_material_array(); const domInstance_material_Array& matArray = binds->getTechnique_common()->getInstance_material_array();
for (S32 iBind = 0; iBind < matArray.getCount(); iBind++) { for (S32 iBind = 0; iBind < matArray.getCount(); iBind++) {
@ -470,7 +470,7 @@ S32 ColladaAppMesh::addMaterial(const char* symbol)
} }
// Add this symbol to the bound list for the mesh // Add this symbol to the bound list for the mesh
boundMaterials.insert(StringTable->insert(symbol), matIndex); mBoundMaterials.insert(StringTable->insert(symbol), matIndex);
return matIndex; return matIndex;
} }
@ -481,8 +481,8 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry)
return; return;
// Read the <geometry> extension // Read the <geometry> extension
if (!geomExt) if (!mGeomExt)
geomExt = new ColladaExtension_geometry(geometry); mGeomExt = new ColladaExtension_geometry(geometry);
// Get the supported primitive elements for this geometry, and warn // Get the supported primitive elements for this geometry, and warn
// about unsupported elements // about unsupported elements
@ -529,7 +529,7 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry)
appMat = static_cast<ColladaAppMaterial*>(mAppMaterials[primitive.matIndex & TSDrawPrimitive::MaterialMask]); appMat = static_cast<ColladaAppMaterial*>(mAppMaterials[primitive.matIndex & TSDrawPrimitive::MaterialMask]);
// Force the material to be double-sided if this geometry is double-sided. // Force the material to be double-sided if this geometry is double-sided.
if (geomExt->double_sided && appMat && appMat->effectExt) if (mGeomExt->double_sided && appMat && appMat->effectExt)
appMat->effectExt->double_sided = true; appMat->effectExt->double_sided = true;
// Pre-allocate triangle indices // Pre-allocate triangle indices
@ -555,12 +555,12 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry)
// If the next triangle could cause us to index across a 16-bit // If the next triangle could cause us to index across a 16-bit
// boundary, split this primitive and clear the tuple map to // boundary, split this primitive and clear the tuple map to
// ensure primitives only index verts within a 16-bit range. // ensure primitives only index verts within a 16-bit range.
if (vertTuples.size() && if (mVertTuples.size() &&
(((vertTuples.size()-1) ^ (vertTuples.size()+2)) & 0x10000)) (((mVertTuples.size()-1) ^ (mVertTuples.size()+2)) & 0x10000))
{ {
// Pad vertTuples up to the next 16-bit boundary // Pad vertTuples up to the next 16-bit boundary
while (vertTuples.size() & 0xFFFF) while (mVertTuples.size() & 0xFFFF)
vertTuples.push_back(VertTuple(vertTuples.last())); mVertTuples.push_back(VertTuple(mVertTuples.last()));
// Split the primitive at the current triangle // Split the primitive at the current triangle
S32 indicesRemaining = (numTriangles - iTri) * 3; S32 indicesRemaining = (numTriangles - iTri) * 3;
@ -602,13 +602,13 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry)
VertTupleMap::Iterator itr = tupleMap.find(tuple); VertTupleMap::Iterator itr = tupleMap.find(tuple);
if (itr == tupleMap.end()) if (itr == tupleMap.end())
{ {
itr = tupleMap.insert(tuple, vertTuples.size()); itr = tupleMap.insert(tuple, mVertTuples.size());
vertTuples.push_back(tuple); mVertTuples.push_back(tuple);
} }
// Collada uses CCW for front face and Torque uses the opposite, so // Collada uses CCW for front face and Torque uses the opposite, so
// for normal (non-inverted) meshes, the indices are flipped. // for normal (non-inverted) meshes, the indices are flipped.
if (appNode->invertMeshes) if (mAppNode->invertMeshes)
dstIndex[v] = itr->value; dstIndex[v] = itr->value;
else else
dstIndex[2 - v] = itr->value; dstIndex[2 - v] = itr->value;
@ -648,20 +648,20 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
// If appending values, pre-allocate the arrays // If appending values, pre-allocate the arrays
if (appendValues) { if (appendValues) {
v_points.setSize(v_points.size() + vertTuples.size()); v_points.setSize(v_points.size() + mVertTuples.size());
v_uvs.setSize(v_uvs.size() + vertTuples.size()); v_uvs.setSize(v_uvs.size() + mVertTuples.size());
} }
// Get pointers to arrays // Get pointers to arrays
Point3F* points_array = &v_points[v_points.size() - vertTuples.size()]; Point3F* points_array = &v_points[v_points.size() - mVertTuples.size()];
Point2F* uvs_array = &v_uvs[v_uvs.size() - vertTuples.size()]; Point2F* uvs_array = &v_uvs[v_uvs.size() - mVertTuples.size()];
Point3F* norms_array = NULL; Point3F* norms_array = NULL;
ColorI* colors_array = NULL; ColorI* colors_array = NULL;
Point2F* uv2s_array = NULL; Point2F* uv2s_array = NULL;
for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++) {
const VertTuple& tuple = vertTuples[iVert]; const VertTuple& tuple = mVertTuples[iVert];
// Change primitives? // Change primitives?
if (tuple.mPrim != lastPrimitive) { if (tuple.mPrim != lastPrimitive) {
@ -690,7 +690,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
points_array[iVert] = streams.points.getPoint3FValue(tuple.mVertex); points_array[iVert] = streams.points.getPoint3FValue(tuple.mVertex);
// Flip verts for inverted meshes // Flip verts for inverted meshes
if (appNode->invertMeshes) if (mAppNode->invertMeshes)
points_array[iVert].z = -points_array[iVert].z; points_array[iVert].z = -points_array[iVert].z;
objectOffset.mulP(points_array[iVert]); objectOffset.mulP(points_array[iVert]);
@ -708,15 +708,15 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
if ( (tuple.mNormal >= 0) && (tuple.mNormal < streams.normals.size()) ) { if ( (tuple.mNormal >= 0) && (tuple.mNormal < streams.normals.size()) ) {
if ( !norms_array && iVert == 0 ) if ( !norms_array && iVert == 0 )
{ {
v_norms.setSize(v_norms.size() + vertTuples.size()); v_norms.setSize(v_norms.size() + mVertTuples.size());
norms_array = &v_norms[v_norms.size() - vertTuples.size()]; norms_array = &v_norms[v_norms.size() - mVertTuples.size()];
} }
if ( norms_array ) { if ( norms_array ) {
norms_array[iVert] = streams.normals.getPoint3FValue(tuple.mNormal); norms_array[iVert] = streams.normals.getPoint3FValue(tuple.mNormal);
// Flip normals for inverted meshes // Flip normals for inverted meshes
if (appNode->invertMeshes) if (mAppNode->invertMeshes)
norms_array[iVert].z = -norms_array[iVert].z; norms_array[iVert].z = -norms_array[iVert].z;
} }
} }
@ -725,8 +725,8 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
{ {
if ( !colors_array && iVert == 0 ) if ( !colors_array && iVert == 0 )
{ {
v_colors.setSize(v_colors.size() + vertTuples.size()); v_colors.setSize(v_colors.size() + mVertTuples.size());
colors_array = &v_colors[v_colors.size() - vertTuples.size()]; colors_array = &v_colors[v_colors.size() - mVertTuples.size()];
} }
if ( colors_array ) if ( colors_array )
@ -737,8 +737,8 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
{ {
if ( !uv2s_array && iVert == 0 ) if ( !uv2s_array && iVert == 0 )
{ {
v_uv2s.setSize(v_uv2s.size() + vertTuples.size()); v_uv2s.setSize(v_uv2s.size() + mVertTuples.size());
uv2s_array = &v_uv2s[v_uv2s.size() - vertTuples.size()]; uv2s_array = &v_uv2s[v_uv2s.size() - mVertTuples.size()];
} }
if ( uv2s_array ) if ( uv2s_array )
@ -810,11 +810,11 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M
getVertexData(baseGeometry, time, objectOffset, v_points, v_norms, v_colors, v_uvs, v_uv2s, true); getVertexData(baseGeometry, time, objectOffset, v_points, v_norms, v_colors, v_uvs, v_uv2s, true);
// Get pointers to the arrays of base geometry data // Get pointers to the arrays of base geometry data
Point3F* points_array = &v_points[v_points.size() - vertTuples.size()]; Point3F* points_array = &v_points[v_points.size() - mVertTuples.size()];
Point3F* norms_array = &v_norms[v_norms.size() - vertTuples.size()]; Point3F* norms_array = &v_norms[v_norms.size() - mVertTuples.size()];
Point2F* uvs_array = &v_uvs[v_uvs.size() - vertTuples.size()]; Point2F* uvs_array = &v_uvs[v_uvs.size() - mVertTuples.size()];
ColorI* colors_array = v_colors.size() ? &v_colors[v_colors.size() - vertTuples.size()] : 0; ColorI* colors_array = v_colors.size() ? &v_colors[v_colors.size() - mVertTuples.size()] : 0;
Point2F* uv2s_array = v_uv2s.size() ? &v_uv2s[v_uv2s.size() - vertTuples.size()] : 0; Point2F* uv2s_array = v_uv2s.size() ? &v_uv2s[v_uv2s.size() - mVertTuples.size()] : 0;
// Normalize base vertex data? // Normalize base vertex data?
if (morph->getMethod() == MORPHMETHODTYPE_NORMALIZED) { if (morph->getMethod() == MORPHMETHODTYPE_NORMALIZED) {
@ -827,14 +827,14 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M
// Result = Base*(1.0-w1-w2 ... -wN) + w1*Target1 + w2*Target2 ... + wN*TargetN // Result = Base*(1.0-w1-w2 ... -wN) + w1*Target1 + w2*Target2 ... + wN*TargetN
weightSum = mClampF(1.0f - weightSum, 0.0f, 1.0f); weightSum = mClampF(1.0f - weightSum, 0.0f, 1.0f);
for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++) {
points_array[iVert] *= weightSum; points_array[iVert] *= weightSum;
norms_array[iVert] *= weightSum; norms_array[iVert] *= weightSum;
uvs_array[iVert] *= weightSum; uvs_array[iVert] *= weightSum;
} }
if (uv2s_array) { if (uv2s_array) {
for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++)
uv2s_array[iVert] *= weightSum; uv2s_array[iVert] *= weightSum;
} }
} }
@ -855,29 +855,29 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M
// Copy base geometry into target geometry (will be used if target does // Copy base geometry into target geometry (will be used if target does
// not define normals or uvs) // not define normals or uvs)
targetPoints.set(points_array, vertTuples.size()); targetPoints.set(points_array, mVertTuples.size());
targetNorms.set(norms_array, vertTuples.size()); targetNorms.set(norms_array, mVertTuples.size());
targetUvs.set(uvs_array, vertTuples.size()); targetUvs.set(uvs_array, mVertTuples.size());
if (colors_array) if (colors_array)
targetColors.set(colors_array, vertTuples.size()); targetColors.set(colors_array, mVertTuples.size());
if (uv2s_array) if (uv2s_array)
targetUv2s.set(uv2s_array, vertTuples.size()); targetUv2s.set(uv2s_array, mVertTuples.size());
getVertexData(targetGeoms[iTarget], time, objectOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false); getVertexData(targetGeoms[iTarget], time, objectOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false);
// Combine with base geometry // Combine with base geometry
for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++) {
points_array[iVert] += targetPoints[iVert] * targetWeights[iTarget]; points_array[iVert] += targetPoints[iVert] * targetWeights[iTarget];
norms_array[iVert] += targetNorms[iVert] * targetWeights[iTarget]; norms_array[iVert] += targetNorms[iVert] * targetWeights[iTarget];
uvs_array[iVert] += targetUvs[iVert] * targetWeights[iTarget]; uvs_array[iVert] += targetUvs[iVert] * targetWeights[iTarget];
} }
if (uv2s_array) { if (uv2s_array) {
for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++)
uv2s_array[iVert] += targetUv2s[iVert] * targetWeights[iTarget]; uv2s_array[iVert] += targetUv2s[iVert] * targetWeights[iTarget];
} }
if (colors_array) { if (colors_array) {
for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++)
colors_array[iVert] += targetColors[iVert] * (F32)targetWeights[iTarget]; colors_array[iVert] += targetColors[iVert] * (F32)targetWeights[iTarget];
} }
} }
@ -891,12 +891,12 @@ void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objectOffset)
// 3) a skin (skin geometry could also be a morph!) // 3) a skin (skin geometry could also be a morph!)
daeElement* geometry = 0; daeElement* geometry = 0;
if (instanceGeom) { if (mInstanceGeom) {
// Simple, static mesh // Simple, static mesh
geometry = instanceGeom->getUrl().getElement(); geometry = mInstanceGeom->getUrl().getElement();
} }
else if (instanceCtrl) { else if (mInstanceCtrl) {
const domController* ctrl = daeSafeCast<domController>(instanceCtrl->getUrl().getElement()); const domController* ctrl = daeSafeCast<domController>(mInstanceCtrl->getUrl().getElement());
if (!ctrl) { if (!ctrl) {
daeErrorHandler::get()->handleWarning(avar("Failed to find <controller> " daeErrorHandler::get()->handleWarning(avar("Failed to find <controller> "
"element for %s", getName())); "element for %s", getName()));
@ -941,7 +941,7 @@ void ColladaAppMesh::lookupSkinData()
return; return;
// Get the skin and vertex weight data // Get the skin and vertex weight data
const domSkin* skin = daeSafeCast<domController>(instanceCtrl->getUrl().getElement())->getSkin(); const domSkin* skin = daeSafeCast<domController>(mInstanceCtrl->getUrl().getElement())->getSkin();
const domSkin::domVertex_weights& weightIndices = *(skin->getVertex_weights()); const domSkin::domVertex_weights& weightIndices = *(skin->getVertex_weights());
const domListOfInts& weights_v = weightIndices.getV()->getValue(); const domListOfInts& weights_v = weightIndices.getV()->getValue();
const domListOfUInts& weights_vcount = weightIndices.getVcount()->getValue(); const domListOfUInts& weights_vcount = weightIndices.getVcount()->getValue();
@ -974,11 +974,11 @@ void ColladaAppMesh::lookupSkinData()
for (S32 iVert = 0; iVert < mVertsPerFrame; iVert++) { for (S32 iVert = 0; iVert < mVertsPerFrame; iVert++) {
const domUint* vcount = (domUint*)weights_vcount.getRaw(0); const domUint* vcount = (domUint*)weights_vcount.getRaw(0);
const domInt* vindices = (domInt*)weights_v.getRaw(0); const domInt* vindices = (domInt*)weights_v.getRaw(0);
vindices += vindicesOffset[vertTuples[iVert].mVertex]; vindices += vindicesOffset[mVertTuples[iVert].mVertex];
S32 nonZeroWeightCount = 0; S32 nonZeroWeightCount = 0;
for (S32 iWeight = 0; iWeight < vcount[vertTuples[iVert].mVertex]; iWeight++) { for (S32 iWeight = 0; iWeight < vcount[mVertTuples[iVert].mVertex]; iWeight++) {
S32 bIndex = vindices[iWeight*2]; S32 bIndex = vindices[iWeight*2];
F32 bWeight = streams.weights.getFloatValue( vindices[iWeight*2 + 1] ); F32 bWeight = streams.weights.getFloatValue( vindices[iWeight*2 + 1] );
@ -990,7 +990,7 @@ void ColladaAppMesh::lookupSkinData()
// Limit the number of weights per bone (keep the N largest influences) // Limit the number of weights per bone (keep the N largest influences)
if ( nonZeroWeightCount >= TSSkinMesh::BatchData::maxBonePerVert ) if ( nonZeroWeightCount >= TSSkinMesh::BatchData::maxBonePerVert )
{ {
if (vcount[vertTuples[iVert].mVertex] > TSSkinMesh::BatchData::maxBonePerVert) if (vcount[mVertTuples[iVert].mVertex] > TSSkinMesh::BatchData::maxBonePerVert)
{ {
if (!tooManyWeightsWarning) if (!tooManyWeightsWarning)
{ {
@ -1054,10 +1054,10 @@ void ColladaAppMesh::lookupSkinData()
// Lookup the joint element // Lookup the joint element
const domNode* joint = 0; const domNode* joint = 0;
if (instanceCtrl->getSkeleton_array().getCount()) { if (mInstanceCtrl->getSkeleton_array().getCount()) {
// Search for the node using the <skeleton> as the base element // Search for the node using the <skeleton> as the base element
for (S32 iSkel = 0; iSkel < instanceCtrl->getSkeleton_array().getCount(); iSkel++) { for (S32 iSkel = 0; iSkel < mInstanceCtrl->getSkeleton_array().getCount(); iSkel++) {
xsAnyURI skeleton = instanceCtrl->getSkeleton_array()[iSkel]->getValue(); xsAnyURI skeleton = mInstanceCtrl->getSkeleton_array()[iSkel]->getValue();
daeSIDResolver resolver(skeleton.getElement(), jointName); daeSIDResolver resolver(skeleton.getElement(), jointName);
joint = daeSafeCast<domNode>(resolver.getElement()); joint = daeSafeCast<domNode>(resolver.getElement());
if (joint) if (joint)
@ -1072,8 +1072,8 @@ void ColladaAppMesh::lookupSkinData()
if (!joint) { if (!joint) {
daeErrorHandler::get()->handleWarning(avar("Failed to find bone '%s', " daeErrorHandler::get()->handleWarning(avar("Failed to find bone '%s', "
"defaulting to instance_controller parent node '%s'", jointName, appNode->getName())); "defaulting to instance_controller parent node '%s'", jointName, mAppNode->getName()));
joint = appNode->getDomNode(); joint = mAppNode->getDomNode();
} }
mBones[iJoint] = new ColladaAppNode(joint); mBones[iJoint] = new ColladaAppNode(joint);

View file

@ -79,24 +79,24 @@ class ColladaAppMesh : public AppMesh
typedef AppMesh Parent; typedef AppMesh Parent;
protected: protected:
class ColladaAppNode* appNode; ///< Pointer to the node that owns this mesh class ColladaAppNode* mAppNode; ///< Pointer to the node that owns this mesh
const domInstance_geometry* instanceGeom; const domInstance_geometry* mInstanceGeom;
const domInstance_controller* instanceCtrl; const domInstance_controller* mInstanceCtrl;
ColladaExtension_geometry* geomExt; ///< geometry extension ColladaExtension_geometry* mGeomExt; ///< geometry extension
Vector<VertTuple> vertTuples; ///< Vector<VertTuple> mVertTuples; ///<
Map<StringTableEntry,U32> boundMaterials; ///< Local map of symbols to materials Map<StringTableEntry,U32> mBoundMaterials; ///< Local map of symbols to materials
static bool fixedSizeEnabled; ///< Set to true to fix the detail size to a particular value for all geometry static bool mFixedSizeEnabled; ///< Set to true to fix the detail size to a particular value for all geometry
static S32 fixedSize; ///< The fixed detail size value for all geometry static S32 mFixedSize; ///< The fixed detail size value for all geometry
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/// Get the morph controller for this mesh (if any) /// Get the morph controller for this mesh (if any)
const domMorph* getMorph() const domMorph* getMorph()
{ {
if (instanceCtrl) { if (mInstanceCtrl) {
const domController* ctrl = daeSafeCast<domController>(instanceCtrl->getUrl().getElement()); const domController* ctrl = daeSafeCast<domController>(mInstanceCtrl->getUrl().getElement());
if (ctrl && ctrl->getSkin()) if (ctrl && ctrl->getSkin())
ctrl = daeSafeCast<domController>(ctrl->getSkin()->getSource().getElement()); ctrl = daeSafeCast<domController>(ctrl->getSkin()->getSource().getElement());
return ctrl ? ctrl->getMorph() : NULL; return ctrl ? ctrl->getMorph() : NULL;
@ -123,13 +123,13 @@ public:
ColladaAppMesh(const domInstance_controller* instance, ColladaAppNode* node); ColladaAppMesh(const domInstance_controller* instance, ColladaAppNode* node);
~ColladaAppMesh() ~ColladaAppMesh()
{ {
delete geomExt; delete mGeomExt;
} }
static void fixDetailSize(bool fixed, S32 size=2) static void fixDetailSize(bool fixed, S32 size=2)
{ {
fixedSizeEnabled = fixed; mFixedSizeEnabled = fixed;
fixedSize = size; mFixedSize = size;
} }
/// Get the name of this mesh /// Get the name of this mesh
@ -147,7 +147,7 @@ public:
/// @return True if a value was set, false if not /// @return True if a value was set, false if not
bool getFloat(const char *propName, F32 &defaultVal) bool getFloat(const char *propName, F32 &defaultVal)
{ {
return appNode->getFloat(propName,defaultVal); return mAppNode->getFloat(propName,defaultVal);
} }
/// Get an integer property value /// Get an integer property value
@ -158,7 +158,7 @@ public:
/// @return True if a value was set, false if not /// @return True if a value was set, false if not
bool getInt(const char *propName, S32 &defaultVal) bool getInt(const char *propName, S32 &defaultVal)
{ {
return appNode->getInt(propName,defaultVal); return mAppNode->getInt(propName,defaultVal);
} }
/// Get a boolean property value /// Get a boolean property value
@ -169,14 +169,14 @@ public:
/// @return True if a value was set, false if not /// @return True if a value was set, false if not
bool getBool(const char *propName, bool &defaultVal) bool getBool(const char *propName, bool &defaultVal)
{ {
return appNode->getBool(propName,defaultVal); return mAppNode->getBool(propName,defaultVal);
} }
/// Return true if this mesh is a skin /// Return true if this mesh is a skin
bool isSkin() bool isSkin()
{ {
if (instanceCtrl) { if (mInstanceCtrl) {
const domController* ctrl = daeSafeCast<domController>(instanceCtrl->getUrl().getElement()); const domController* ctrl = daeSafeCast<domController>(mInstanceCtrl->getUrl().getElement());
if (ctrl && ctrl->getSkin() && if (ctrl && ctrl->getSkin() &&
(ctrl->getSkin()->getVertex_weights()->getV()->getValue().getCount() > 0)) (ctrl->getSkin()->getVertex_weights()->getV()->getValue().getCount() > 0))
return true; return true;