mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Rename all member variables to follow the style guidelines (prefixed with the 'm') - ColladaExtensions
This commit is contained in:
parent
733347fd61
commit
9aeb4389f3
6 changed files with 101 additions and 101 deletions
|
|
@ -82,9 +82,9 @@ ColladaAppMaterial::ColladaAppMaterial(const domMaterial *pMat)
|
||||||
const domCommon_color_or_texture_type_complexType* domSpecular = findEffectSpecular(effect);
|
const domCommon_color_or_texture_type_complexType* domSpecular = findEffectSpecular(effect);
|
||||||
|
|
||||||
// Wrap flags
|
// Wrap flags
|
||||||
if (effectExt->wrapU)
|
if (effectExt->mWrapU)
|
||||||
flags |= TSMaterialList::S_Wrap;
|
flags |= TSMaterialList::S_Wrap;
|
||||||
if (effectExt->wrapV)
|
if (effectExt->mWrapV)
|
||||||
flags |= TSMaterialList::T_Wrap;
|
flags |= TSMaterialList::T_Wrap;
|
||||||
|
|
||||||
// Set material attributes
|
// Set material attributes
|
||||||
|
|
@ -146,13 +146,13 @@ ColladaAppMaterial::ColladaAppMaterial(const domMaterial *pMat)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Double-sided flag
|
// Double-sided flag
|
||||||
doubleSided = effectExt->double_sided;
|
doubleSided = effectExt->mDoubleSided;
|
||||||
|
|
||||||
// Get the paths for the various textures => Collada indirection at its finest!
|
// Get the paths for the various textures => Collada indirection at its finest!
|
||||||
// <texture>.<newparam>.<sampler2D>.<source>.<newparam>.<surface>.<init_from>.<image>.<init_from>
|
// <texture>.<newparam>.<sampler2D>.<source>.<newparam>.<surface>.<init_from>.<image>.<init_from>
|
||||||
diffuseMap = getSamplerImagePath(effect, getTextureSampler(effect, domDiffuse));
|
diffuseMap = getSamplerImagePath(effect, getTextureSampler(effect, domDiffuse));
|
||||||
specularMap = getSamplerImagePath(effect, getTextureSampler(effect, domSpecular));
|
specularMap = getSamplerImagePath(effect, getTextureSampler(effect, domSpecular));
|
||||||
normalMap = getSamplerImagePath(effect, effectExt->bumpSampler);
|
normalMap = getSamplerImagePath(effect, effectExt->mBumpSampler);
|
||||||
|
|
||||||
// Set the material name
|
// Set the material name
|
||||||
name = ColladaUtils::getOptions().mMatNamePrefix;
|
name = ColladaUtils::getOptions().mMatNamePrefix;
|
||||||
|
|
|
||||||
|
|
@ -354,7 +354,7 @@ MatrixF ColladaAppMesh::getMeshTransform(F32 time)
|
||||||
bool ColladaAppMesh::animatesVis(const AppSequence* appSeq)
|
bool ColladaAppMesh::animatesVis(const AppSequence* appSeq)
|
||||||
{
|
{
|
||||||
#define IS_VIS_ANIMATED(node) \
|
#define IS_VIS_ANIMATED(node) \
|
||||||
(dynamic_cast<const ColladaAppNode*>(node)->nodeExt->visibility.isAnimated(appSeq->getStart(), appSeq->getEnd()))
|
(dynamic_cast<const ColladaAppNode*>(node)->nodeExt->mVisibility.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(mAppNode) || (mAppNode->appParent ? IS_VIS_ANIMATED(mAppNode->appParent) : false);
|
return IS_VIS_ANIMATED(mAppNode) || (mAppNode->appParent ? IS_VIS_ANIMATED(mAppNode->appParent) : false);
|
||||||
|
|
@ -418,7 +418,7 @@ bool ColladaAppMesh::animatesFrame(const AppSequence* appSeq)
|
||||||
F32 ColladaAppMesh::getVisValue(F32 t)
|
F32 ColladaAppMesh::getVisValue(F32 t)
|
||||||
{
|
{
|
||||||
#define GET_VIS(node) \
|
#define GET_VIS(node) \
|
||||||
(dynamic_cast<const ColladaAppNode*>(node)->nodeExt->visibility.getValue(t))
|
(dynamic_cast<const ColladaAppNode*>(node)->nodeExt->mVisibility.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(mAppNode) * (mAppNode->appParent ? GET_VIS(mAppNode->appParent) : 1.0f);
|
return GET_VIS(mAppNode) * (mAppNode->appParent ? GET_VIS(mAppNode->appParent) : 1.0f);
|
||||||
|
|
@ -529,8 +529,8 @@ 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 (mGeomExt->double_sided && appMat && appMat->effectExt)
|
if (mGeomExt->mDoubleSided && appMat && appMat->effectExt)
|
||||||
appMat->effectExt->double_sided = true;
|
appMat->effectExt->mDoubleSided = true;
|
||||||
|
|
||||||
// Pre-allocate triangle indices
|
// Pre-allocate triangle indices
|
||||||
primitive.numElements = numTriangles * 3;
|
primitive.numElements = numTriangles * 3;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ ColladaAppNode::ColladaAppNode(const domNode* node, ColladaAppNode* parent)
|
||||||
|
|
||||||
// Extract user properties from the <node> extension as whitespace separated
|
// Extract user properties from the <node> extension as whitespace separated
|
||||||
// "name=value" pairs
|
// "name=value" pairs
|
||||||
char* properties = dStrdup(nodeExt->user_properties);
|
char* properties = dStrdup(nodeExt->mUserProperties);
|
||||||
char* pos = properties;
|
char* pos = properties;
|
||||||
char* end = properties + dStrlen( properties );
|
char* end = properties + dStrlen( properties );
|
||||||
while ( pos < end )
|
while ( pos < end )
|
||||||
|
|
|
||||||
|
|
@ -45,31 +45,31 @@ const char* ColladaAppSequence::getName() const
|
||||||
|
|
||||||
S32 ColladaAppSequence::getNumTriggers()
|
S32 ColladaAppSequence::getNumTriggers()
|
||||||
{
|
{
|
||||||
return clipExt->triggers.size();
|
return clipExt->mTriggers.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColladaAppSequence::getTrigger(S32 index, TSShape::Trigger& trigger)
|
void ColladaAppSequence::getTrigger(S32 index, TSShape::Trigger& trigger)
|
||||||
{
|
{
|
||||||
trigger.pos = clipExt->triggers[index].time;
|
trigger.pos = clipExt->mTriggers[index].time;
|
||||||
trigger.state = clipExt->triggers[index].state;
|
trigger.state = clipExt->mTriggers[index].state;
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 ColladaAppSequence::getFlags() const
|
U32 ColladaAppSequence::getFlags() const
|
||||||
{
|
{
|
||||||
U32 flags = 0;
|
U32 flags = 0;
|
||||||
if (clipExt->cyclic) flags |= TSShape::Cyclic;
|
if (clipExt->mCyclic) flags |= TSShape::Cyclic;
|
||||||
if (clipExt->blend) flags |= TSShape::Blend;
|
if (clipExt->mBlend) flags |= TSShape::Blend;
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 ColladaAppSequence::getPriority()
|
F32 ColladaAppSequence::getPriority()
|
||||||
{
|
{
|
||||||
return clipExt->priority;
|
return clipExt->mPriority;
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 ColladaAppSequence::getBlendRefTime()
|
F32 ColladaAppSequence::getBlendRefTime()
|
||||||
{
|
{
|
||||||
return clipExt->blendReferenceTime;
|
return clipExt->mBlendReferenceTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColladaAppSequence::setActive(bool active)
|
void ColladaAppSequence::setActive(bool active)
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,10 @@
|
||||||
/// the interval
|
/// the interval
|
||||||
bool ColladaExtension_effect::animatesTextureTransform(F32 start, F32 end)
|
bool ColladaExtension_effect::animatesTextureTransform(F32 start, F32 end)
|
||||||
{
|
{
|
||||||
return repeatU.isAnimated(start, end) || repeatV.isAnimated(start, end) ||
|
return mRepeatU.isAnimated(start, end) || mRepeatV.isAnimated(start, end) ||
|
||||||
offsetU.isAnimated(start, end) || offsetV.isAnimated(start, end) ||
|
mOffsetU.isAnimated(start, end) || mOffsetV.isAnimated(start, end) ||
|
||||||
rotateUV.isAnimated(start, end) || noiseU.isAnimated(start, end) ||
|
mRotateUV.isAnimated(start, end) || mNoiseU.isAnimated(start, end) ||
|
||||||
noiseV.isAnimated(start, end);
|
mNoiseV.isAnimated(start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply the MAYA texture transform to the given UV coordinates
|
/// Apply the MAYA texture transform to the given UV coordinates
|
||||||
|
|
@ -41,21 +41,21 @@ void ColladaExtension_effect::applyTextureTransform(Point2F& uv, F32 time)
|
||||||
// This function will be called for every tvert, every frame. So cache the
|
// This function will be called for every tvert, every frame. So cache the
|
||||||
// texture transform parameters to avoid interpolating them every call (since
|
// texture transform parameters to avoid interpolating them every call (since
|
||||||
// they are constant for all tverts for a given 't')
|
// they are constant for all tverts for a given 't')
|
||||||
if (time != lastAnimTime) {
|
if (time != mLastAnimTime) {
|
||||||
// Update texture transform
|
// Update texture transform
|
||||||
textureTransform.set(EulerF(0, 0, rotateUV.getValue(time)));
|
mTextureTransform.set(EulerF(0, 0, mRotateUV.getValue(time)));
|
||||||
textureTransform.setPosition(Point3F(
|
mTextureTransform.setPosition(Point3F(
|
||||||
offsetU.getValue(time) + noiseU.getValue(time)*gRandGen.randF(),
|
mOffsetU.getValue(time) + mNoiseU.getValue(time)*gRandGen.randF(),
|
||||||
offsetV.getValue(time) + noiseV.getValue(time)*gRandGen.randF(),
|
mOffsetV.getValue(time) + mNoiseV.getValue(time)*gRandGen.randF(),
|
||||||
0));
|
0));
|
||||||
textureTransform.scale(Point3F(repeatU.getValue(time), repeatV.getValue(time), 1.0f));
|
mTextureTransform.scale(Point3F(mRepeatU.getValue(time), mRepeatV.getValue(time), 1.0f));
|
||||||
|
|
||||||
lastAnimTime = time;
|
mLastAnimTime = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply texture transform
|
// Apply texture transform
|
||||||
Point3F result;
|
Point3F result;
|
||||||
textureTransform.mulP(Point3F(uv.x, uv.y, 0), &result);
|
mTextureTransform.mulP(Point3F(uv.x, uv.y, 0), &result);
|
||||||
|
|
||||||
uv.x = result.x;
|
uv.x = result.x;
|
||||||
uv.y = result.y;
|
uv.y = result.y;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class ColladaExtension
|
||||||
get(#param, param, defaultVal)
|
get(#param, param, defaultVal)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const domTechnique* pTechnique;
|
const domTechnique* mTechnique;
|
||||||
|
|
||||||
/// Find the technique with the named profile
|
/// Find the technique with the named profile
|
||||||
template<class T> const domTechnique* findExtraTechnique(const T* element, const char* name) const
|
template<class T> const domTechnique* findExtraTechnique(const T* element, const char* name) const
|
||||||
|
|
@ -86,10 +86,10 @@ protected:
|
||||||
/// Find the parameter with the given name
|
/// Find the parameter with the given name
|
||||||
const domAny* findParam(const char* name)
|
const domAny* findParam(const char* name)
|
||||||
{
|
{
|
||||||
if (pTechnique) {
|
if (mTechnique) {
|
||||||
// search the technique contents for the desired parameter
|
// search the technique contents for the desired parameter
|
||||||
for (S32 iParam = 0; iParam < pTechnique->getContents().getCount(); iParam++) {
|
for (S32 iParam = 0; iParam < mTechnique->getContents().getCount(); iParam++) {
|
||||||
const domAny* param = daeSafeCast<domAny>(pTechnique->getContents()[iParam]);
|
const domAny* param = daeSafeCast<domAny>(mTechnique->getContents()[iParam]);
|
||||||
if (param && !dStrcmp(param->getElementName(), name))
|
if (param && !dStrcmp(param->getElementName(), name))
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +114,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ColladaExtension() : pTechnique(0) { }
|
ColladaExtension() : mTechnique(0) { }
|
||||||
virtual ~ColladaExtension() { }
|
virtual ~ColladaExtension() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -122,14 +122,14 @@ public:
|
||||||
class ColladaExtension_effect : public ColladaExtension
|
class ColladaExtension_effect : public ColladaExtension
|
||||||
{
|
{
|
||||||
// Cached texture transform
|
// Cached texture transform
|
||||||
F32 lastAnimTime;
|
F32 mLastAnimTime;
|
||||||
MatrixF textureTransform;
|
MatrixF mTextureTransform;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>
|
// <effect>
|
||||||
// MAX3D profile elements
|
// MAX3D profile elements
|
||||||
bool double_sided;
|
bool mDoubleSided;
|
||||||
|
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>.<profile_COMMON>
|
// <effect>.<profile_COMMON>
|
||||||
|
|
@ -139,39 +139,39 @@ public:
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>.<profile_COMMON>.<technique>.<blinn/phong/lambert>.<diffuse>.<texture>
|
// <effect>.<profile_COMMON>.<technique>.<blinn/phong/lambert>.<diffuse>.<texture>
|
||||||
// MAYA profile elements
|
// MAYA profile elements
|
||||||
bool wrapU, wrapV;
|
bool mWrapU, mWrapV;
|
||||||
bool mirrorU, mirrorV;
|
bool mMirrorU, mMirrorV;
|
||||||
AnimatedFloat coverageU, coverageV;
|
AnimatedFloat mCoverageU, mCoverageV;
|
||||||
AnimatedFloat translateFrameU, translateFrameV;
|
AnimatedFloat mTranslateFrameU, mTranslateFrameV;
|
||||||
AnimatedFloat rotateFrame;
|
AnimatedFloat mRotateFrame;
|
||||||
AnimatedBool stagger; // @todo: not supported yet
|
AnimatedBool mStagger; // @todo: not supported yet
|
||||||
AnimatedFloat repeatU, repeatV;
|
AnimatedFloat mRepeatU, mRepeatV;
|
||||||
AnimatedFloat offsetU, offsetV;
|
AnimatedFloat mOffsetU, mOffsetV;
|
||||||
AnimatedFloat rotateUV;
|
AnimatedFloat mRotateUV;
|
||||||
AnimatedFloat noiseU, noiseV;
|
AnimatedFloat mNoiseU, mNoiseV;
|
||||||
|
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>.<profile_COMMON>.<technique>
|
// <effect>.<profile_COMMON>.<technique>
|
||||||
// FCOLLADA profile elements
|
// FCOLLADA profile elements
|
||||||
domFx_sampler2D_common_complexType* bumpSampler;
|
domFx_sampler2D_common_complexType* mBumpSampler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ColladaExtension_effect(const domEffect* effect)
|
ColladaExtension_effect(const domEffect* effect)
|
||||||
: lastAnimTime(TSShapeLoader::DefaultTime-1), textureTransform(true), bumpSampler(0)
|
: mLastAnimTime(TSShapeLoader::DefaultTime-1), mTextureTransform(true), mBumpSampler(0)
|
||||||
{
|
{
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>
|
// <effect>
|
||||||
// MAX3D profile
|
// MAX3D profile
|
||||||
pTechnique = findExtraTechnique(effect, "MAX3D");
|
mTechnique = findExtraTechnique(effect, "MAX3D");
|
||||||
GET_EXTRA_PARAM(double_sided, false);
|
GET_EXTRA_PARAM(mDoubleSided, false);
|
||||||
|
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>.<profile_COMMON>
|
// <effect>.<profile_COMMON>
|
||||||
const domProfile_COMMON* profileCommon = ColladaUtils::findEffectCommonProfile(effect);
|
const domProfile_COMMON* profileCommon = ColladaUtils::findEffectCommonProfile(effect);
|
||||||
|
|
||||||
// GOOGLEEARTH profile (same double_sided element)
|
// GOOGLEEARTH profile (same double_sided element)
|
||||||
pTechnique = findExtraTechnique(profileCommon, "GOOGLEEARTH");
|
mTechnique = findExtraTechnique(profileCommon, "GOOGLEEARTH");
|
||||||
GET_EXTRA_PARAM(double_sided, double_sided);
|
GET_EXTRA_PARAM(mDoubleSided, mDoubleSided);
|
||||||
|
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
// <effect>.<profile_COMMON>.<technique>.<blinn/phong/lambert>.<diffuse>.<texture>
|
// <effect>.<profile_COMMON>.<technique>.<blinn/phong/lambert>.<diffuse>.<texture>
|
||||||
|
|
@ -179,43 +179,43 @@ public:
|
||||||
const domFx_sampler2D_common_complexType* sampler2D = ColladaUtils::getTextureSampler(effect, domDiffuse);
|
const domFx_sampler2D_common_complexType* sampler2D = ColladaUtils::getTextureSampler(effect, domDiffuse);
|
||||||
|
|
||||||
// Use the sampler2D to set default values for wrap/mirror flags
|
// Use the sampler2D to set default values for wrap/mirror flags
|
||||||
wrapU = wrapV = true;
|
mWrapU = mWrapV = true;
|
||||||
mirrorU = mirrorV = false;
|
mMirrorU = mMirrorV = false;
|
||||||
if (sampler2D) {
|
if (sampler2D) {
|
||||||
domFx_sampler2D_common_complexType::domWrap_s* wrap_s = sampler2D->getWrap_s();
|
domFx_sampler2D_common_complexType::domWrap_s* wrap_s = sampler2D->getWrap_s();
|
||||||
domFx_sampler2D_common_complexType::domWrap_t* wrap_t = sampler2D->getWrap_t();
|
domFx_sampler2D_common_complexType::domWrap_t* wrap_t = sampler2D->getWrap_t();
|
||||||
|
|
||||||
mirrorU = (wrap_s && wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
mMirrorU = (wrap_s && wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
||||||
wrapU = (mirrorU || !wrap_s || (wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
mWrapU = (mMirrorU || !wrap_s || (wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
||||||
mirrorV = (wrap_t && wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
mMirrorV = (wrap_t && wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
||||||
wrapV = (mirrorV || !wrap_t || (wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
mWrapV = (mMirrorV || !wrap_t || (wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
||||||
}
|
}
|
||||||
|
|
||||||
// MAYA profile
|
// MAYA profile
|
||||||
pTechnique = findExtraTechnique(domDiffuse ? domDiffuse->getTexture() : 0, "MAYA");
|
mTechnique = findExtraTechnique(domDiffuse ? domDiffuse->getTexture() : 0, "MAYA");
|
||||||
GET_EXTRA_PARAM(wrapU, wrapU); GET_EXTRA_PARAM(wrapV, wrapV);
|
GET_EXTRA_PARAM(mWrapU, mWrapU); GET_EXTRA_PARAM(mWrapV, mWrapV);
|
||||||
GET_EXTRA_PARAM(mirrorU, mirrorU); GET_EXTRA_PARAM(mirrorV, mirrorV);
|
GET_EXTRA_PARAM(mMirrorU, mMirrorU); GET_EXTRA_PARAM(mMirrorV, mMirrorV);
|
||||||
GET_EXTRA_PARAM(coverageU, 1.0); GET_EXTRA_PARAM(coverageV, 1.0);
|
GET_EXTRA_PARAM(mCoverageU, 1.0); GET_EXTRA_PARAM(mCoverageV, 1.0);
|
||||||
GET_EXTRA_PARAM(translateFrameU, 0.0); GET_EXTRA_PARAM(translateFrameV, 0.0);
|
GET_EXTRA_PARAM(mTranslateFrameU, 0.0); GET_EXTRA_PARAM(mTranslateFrameV, 0.0);
|
||||||
GET_EXTRA_PARAM(rotateFrame, 0.0);
|
GET_EXTRA_PARAM(mRotateFrame, 0.0);
|
||||||
GET_EXTRA_PARAM(stagger, false);
|
GET_EXTRA_PARAM(mStagger, false);
|
||||||
GET_EXTRA_PARAM(repeatU, 1.0); GET_EXTRA_PARAM(repeatV, 1.0);
|
GET_EXTRA_PARAM(mRepeatU, 1.0); GET_EXTRA_PARAM(mRepeatV, 1.0);
|
||||||
GET_EXTRA_PARAM(offsetU, 0.0); GET_EXTRA_PARAM(offsetV, 0.0);
|
GET_EXTRA_PARAM(mOffsetU, 0.0); GET_EXTRA_PARAM(mOffsetV, 0.0);
|
||||||
GET_EXTRA_PARAM(rotateUV, 0.0);
|
GET_EXTRA_PARAM(mRotateUV, 0.0);
|
||||||
GET_EXTRA_PARAM(noiseU, 0.0); GET_EXTRA_PARAM(noiseV, 0.0);
|
GET_EXTRA_PARAM(mNoiseU, 0.0); GET_EXTRA_PARAM(mNoiseV, 0.0);
|
||||||
|
|
||||||
// FCOLLADA profile
|
// FCOLLADA profile
|
||||||
if (profileCommon) {
|
if (profileCommon) {
|
||||||
pTechnique = findExtraTechnique((const domProfile_COMMON::domTechnique*)profileCommon->getTechnique(), "FCOLLADA");
|
mTechnique = findExtraTechnique((const domProfile_COMMON::domTechnique*)profileCommon->getTechnique(), "FCOLLADA");
|
||||||
if (pTechnique) {
|
if (mTechnique) {
|
||||||
domAny* bump = daeSafeCast<domAny>(const_cast<domTechnique*>(pTechnique)->getChild("bump"));
|
domAny* bump = daeSafeCast<domAny>(const_cast<domTechnique*>(mTechnique)->getChild("bump"));
|
||||||
if (bump) {
|
if (bump) {
|
||||||
domAny* bumpTexture = daeSafeCast<domAny>(bump->getChild("texture"));
|
domAny* bumpTexture = daeSafeCast<domAny>(bump->getChild("texture"));
|
||||||
if (bumpTexture) {
|
if (bumpTexture) {
|
||||||
daeSIDResolver resolver(const_cast<domEffect*>(effect), bumpTexture->getAttribute("texture").c_str());
|
daeSIDResolver resolver(const_cast<domEffect*>(effect), bumpTexture->getAttribute("texture").c_str());
|
||||||
domCommon_newparam_type* param = daeSafeCast<domCommon_newparam_type>(resolver.getElement());
|
domCommon_newparam_type* param = daeSafeCast<domCommon_newparam_type>(resolver.getElement());
|
||||||
if (param)
|
if (param)
|
||||||
bumpSampler = param->getSampler2D();
|
mBumpSampler = param->getSampler2D();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -235,21 +235,21 @@ class ColladaExtension_node : public ColladaExtension
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// FCOLLADA or OpenCOLLADA profile elements
|
// FCOLLADA or OpenCOLLADA profile elements
|
||||||
AnimatedFloat visibility;
|
AnimatedFloat mVisibility;
|
||||||
const char* user_properties;
|
const char* mUserProperties;
|
||||||
|
|
||||||
ColladaExtension_node(const domNode* node)
|
ColladaExtension_node(const domNode* node)
|
||||||
{
|
{
|
||||||
// FCOLLADA profile
|
// FCOLLADA profile
|
||||||
pTechnique = findExtraTechnique(node, "FCOLLADA");
|
mTechnique = findExtraTechnique(node, "FCOLLADA");
|
||||||
GET_EXTRA_PARAM(visibility, 1.0);
|
GET_EXTRA_PARAM(mVisibility, 1.0);
|
||||||
GET_EXTRA_PARAM(user_properties, "");
|
GET_EXTRA_PARAM(mUserProperties, "");
|
||||||
|
|
||||||
// OpenCOLLADA profile
|
// OpenCOLLADA profile
|
||||||
pTechnique = findExtraTechnique(node, "OpenCOLLADA");
|
mTechnique = findExtraTechnique(node, "OpenCOLLADA");
|
||||||
if (!visibility.mElement)
|
if (!mVisibility.mElement)
|
||||||
GET_EXTRA_PARAM(visibility, 1.0);
|
GET_EXTRA_PARAM(mVisibility, 1.0);
|
||||||
GET_EXTRA_PARAM(user_properties, user_properties);
|
GET_EXTRA_PARAM(mUserProperties, mUserProperties);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -258,13 +258,13 @@ class ColladaExtension_geometry : public ColladaExtension
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// MAYA profile elements
|
// MAYA profile elements
|
||||||
bool double_sided;
|
bool mDoubleSided;
|
||||||
|
|
||||||
ColladaExtension_geometry(const domGeometry* geometry)
|
ColladaExtension_geometry(const domGeometry* geometry)
|
||||||
{
|
{
|
||||||
// MAYA profile
|
// MAYA profile
|
||||||
pTechnique = findExtraTechnique(geometry, "MAYA");
|
mTechnique = findExtraTechnique(geometry, "MAYA");
|
||||||
GET_EXTRA_PARAM(double_sided, false);
|
GET_EXTRA_PARAM(mDoubleSided, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -278,27 +278,27 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Torque profile elements (none of these are animatable)
|
// Torque profile elements (none of these are animatable)
|
||||||
S32 num_triggers;
|
S32 mNumTriggers;
|
||||||
Vector<Trigger> triggers;
|
Vector<Trigger> mTriggers;
|
||||||
bool cyclic;
|
bool mCyclic;
|
||||||
bool blend;
|
bool mBlend;
|
||||||
F32 blendReferenceTime;
|
F32 mBlendReferenceTime;
|
||||||
F32 priority;
|
F32 mPriority;
|
||||||
|
|
||||||
ColladaExtension_animation_clip(const domAnimation_clip* clip)
|
ColladaExtension_animation_clip(const domAnimation_clip* clip)
|
||||||
{
|
{
|
||||||
// Torque profile
|
// Torque profile
|
||||||
pTechnique = findExtraTechnique(clip, "Torque");
|
mTechnique = findExtraTechnique(clip, "Torque");
|
||||||
GET_EXTRA_PARAM(num_triggers, 0);
|
GET_EXTRA_PARAM(mNumTriggers, 0);
|
||||||
for (S32 iTrigger = 0; iTrigger < num_triggers; iTrigger++) {
|
for (S32 iTrigger = 0; iTrigger < mNumTriggers; iTrigger++) {
|
||||||
triggers.increment();
|
mTriggers.increment();
|
||||||
get(avar("trigger_time%d", iTrigger), triggers.last().time, 0.0f);
|
get(avar("trigger_time%d", iTrigger), mTriggers.last().time, 0.0f);
|
||||||
get(avar("trigger_state%d", iTrigger), triggers.last().state, 0);
|
get(avar("trigger_state%d", iTrigger), mTriggers.last().state, 0);
|
||||||
}
|
}
|
||||||
GET_EXTRA_PARAM(cyclic, false);
|
GET_EXTRA_PARAM(mCyclic, false);
|
||||||
GET_EXTRA_PARAM(blend, false);
|
GET_EXTRA_PARAM(mBlend, false);
|
||||||
GET_EXTRA_PARAM(blendReferenceTime, 0.0f);
|
GET_EXTRA_PARAM(mBlendReferenceTime, 0.0f);
|
||||||
GET_EXTRA_PARAM(priority, 5.0f);
|
GET_EXTRA_PARAM(mPriority, 5.0f);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue