mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 14:55:39 +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
|
|
@ -53,7 +53,7 @@ class ColladaExtension
|
|||
get(#param, param, defaultVal)
|
||||
|
||||
protected:
|
||||
const domTechnique* pTechnique;
|
||||
const domTechnique* mTechnique;
|
||||
|
||||
/// Find the technique with the named profile
|
||||
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
|
||||
const domAny* findParam(const char* name)
|
||||
{
|
||||
if (pTechnique) {
|
||||
if (mTechnique) {
|
||||
// search the technique contents for the desired parameter
|
||||
for (S32 iParam = 0; iParam < pTechnique->getContents().getCount(); iParam++) {
|
||||
const domAny* param = daeSafeCast<domAny>(pTechnique->getContents()[iParam]);
|
||||
for (S32 iParam = 0; iParam < mTechnique->getContents().getCount(); iParam++) {
|
||||
const domAny* param = daeSafeCast<domAny>(mTechnique->getContents()[iParam]);
|
||||
if (param && !dStrcmp(param->getElementName(), name))
|
||||
return param;
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ protected:
|
|||
}
|
||||
|
||||
public:
|
||||
ColladaExtension() : pTechnique(0) { }
|
||||
ColladaExtension() : mTechnique(0) { }
|
||||
virtual ~ColladaExtension() { }
|
||||
};
|
||||
|
||||
|
|
@ -122,14 +122,14 @@ public:
|
|||
class ColladaExtension_effect : public ColladaExtension
|
||||
{
|
||||
// Cached texture transform
|
||||
F32 lastAnimTime;
|
||||
MatrixF textureTransform;
|
||||
F32 mLastAnimTime;
|
||||
MatrixF mTextureTransform;
|
||||
|
||||
public:
|
||||
//----------------------------------
|
||||
// <effect>
|
||||
// MAX3D profile elements
|
||||
bool double_sided;
|
||||
bool mDoubleSided;
|
||||
|
||||
//----------------------------------
|
||||
// <effect>.<profile_COMMON>
|
||||
|
|
@ -139,39 +139,39 @@ public:
|
|||
//----------------------------------
|
||||
// <effect>.<profile_COMMON>.<technique>.<blinn/phong/lambert>.<diffuse>.<texture>
|
||||
// MAYA profile elements
|
||||
bool wrapU, wrapV;
|
||||
bool mirrorU, mirrorV;
|
||||
AnimatedFloat coverageU, coverageV;
|
||||
AnimatedFloat translateFrameU, translateFrameV;
|
||||
AnimatedFloat rotateFrame;
|
||||
AnimatedBool stagger; // @todo: not supported yet
|
||||
AnimatedFloat repeatU, repeatV;
|
||||
AnimatedFloat offsetU, offsetV;
|
||||
AnimatedFloat rotateUV;
|
||||
AnimatedFloat noiseU, noiseV;
|
||||
bool mWrapU, mWrapV;
|
||||
bool mMirrorU, mMirrorV;
|
||||
AnimatedFloat mCoverageU, mCoverageV;
|
||||
AnimatedFloat mTranslateFrameU, mTranslateFrameV;
|
||||
AnimatedFloat mRotateFrame;
|
||||
AnimatedBool mStagger; // @todo: not supported yet
|
||||
AnimatedFloat mRepeatU, mRepeatV;
|
||||
AnimatedFloat mOffsetU, mOffsetV;
|
||||
AnimatedFloat mRotateUV;
|
||||
AnimatedFloat mNoiseU, mNoiseV;
|
||||
|
||||
//----------------------------------
|
||||
// <effect>.<profile_COMMON>.<technique>
|
||||
// FCOLLADA profile elements
|
||||
domFx_sampler2D_common_complexType* bumpSampler;
|
||||
domFx_sampler2D_common_complexType* mBumpSampler;
|
||||
|
||||
public:
|
||||
ColladaExtension_effect(const domEffect* effect)
|
||||
: lastAnimTime(TSShapeLoader::DefaultTime-1), textureTransform(true), bumpSampler(0)
|
||||
: mLastAnimTime(TSShapeLoader::DefaultTime-1), mTextureTransform(true), mBumpSampler(0)
|
||||
{
|
||||
//----------------------------------
|
||||
// <effect>
|
||||
// MAX3D profile
|
||||
pTechnique = findExtraTechnique(effect, "MAX3D");
|
||||
GET_EXTRA_PARAM(double_sided, false);
|
||||
mTechnique = findExtraTechnique(effect, "MAX3D");
|
||||
GET_EXTRA_PARAM(mDoubleSided, false);
|
||||
|
||||
//----------------------------------
|
||||
// <effect>.<profile_COMMON>
|
||||
const domProfile_COMMON* profileCommon = ColladaUtils::findEffectCommonProfile(effect);
|
||||
|
||||
// GOOGLEEARTH profile (same double_sided element)
|
||||
pTechnique = findExtraTechnique(profileCommon, "GOOGLEEARTH");
|
||||
GET_EXTRA_PARAM(double_sided, double_sided);
|
||||
mTechnique = findExtraTechnique(profileCommon, "GOOGLEEARTH");
|
||||
GET_EXTRA_PARAM(mDoubleSided, mDoubleSided);
|
||||
|
||||
//----------------------------------
|
||||
// <effect>.<profile_COMMON>.<technique>.<blinn/phong/lambert>.<diffuse>.<texture>
|
||||
|
|
@ -179,43 +179,43 @@ public:
|
|||
const domFx_sampler2D_common_complexType* sampler2D = ColladaUtils::getTextureSampler(effect, domDiffuse);
|
||||
|
||||
// Use the sampler2D to set default values for wrap/mirror flags
|
||||
wrapU = wrapV = true;
|
||||
mirrorU = mirrorV = false;
|
||||
mWrapU = mWrapV = true;
|
||||
mMirrorU = mMirrorV = false;
|
||||
if (sampler2D) {
|
||||
domFx_sampler2D_common_complexType::domWrap_s* wrap_s = sampler2D->getWrap_s();
|
||||
domFx_sampler2D_common_complexType::domWrap_t* wrap_t = sampler2D->getWrap_t();
|
||||
|
||||
mirrorU = (wrap_s && wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
||||
wrapU = (mirrorU || !wrap_s || (wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
||||
mirrorV = (wrap_t && wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
||||
wrapV = (mirrorV || !wrap_t || (wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
||||
mMirrorU = (wrap_s && wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
||||
mWrapU = (mMirrorU || !wrap_s || (wrap_s->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
||||
mMirrorV = (wrap_t && wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_MIRROR);
|
||||
mWrapV = (mMirrorV || !wrap_t || (wrap_t->getValue() == FX_SAMPLER_WRAP_COMMON_WRAP));
|
||||
}
|
||||
|
||||
// MAYA profile
|
||||
pTechnique = findExtraTechnique(domDiffuse ? domDiffuse->getTexture() : 0, "MAYA");
|
||||
GET_EXTRA_PARAM(wrapU, wrapU); GET_EXTRA_PARAM(wrapV, wrapV);
|
||||
GET_EXTRA_PARAM(mirrorU, mirrorU); GET_EXTRA_PARAM(mirrorV, mirrorV);
|
||||
GET_EXTRA_PARAM(coverageU, 1.0); GET_EXTRA_PARAM(coverageV, 1.0);
|
||||
GET_EXTRA_PARAM(translateFrameU, 0.0); GET_EXTRA_PARAM(translateFrameV, 0.0);
|
||||
GET_EXTRA_PARAM(rotateFrame, 0.0);
|
||||
GET_EXTRA_PARAM(stagger, false);
|
||||
GET_EXTRA_PARAM(repeatU, 1.0); GET_EXTRA_PARAM(repeatV, 1.0);
|
||||
GET_EXTRA_PARAM(offsetU, 0.0); GET_EXTRA_PARAM(offsetV, 0.0);
|
||||
GET_EXTRA_PARAM(rotateUV, 0.0);
|
||||
GET_EXTRA_PARAM(noiseU, 0.0); GET_EXTRA_PARAM(noiseV, 0.0);
|
||||
mTechnique = findExtraTechnique(domDiffuse ? domDiffuse->getTexture() : 0, "MAYA");
|
||||
GET_EXTRA_PARAM(mWrapU, mWrapU); GET_EXTRA_PARAM(mWrapV, mWrapV);
|
||||
GET_EXTRA_PARAM(mMirrorU, mMirrorU); GET_EXTRA_PARAM(mMirrorV, mMirrorV);
|
||||
GET_EXTRA_PARAM(mCoverageU, 1.0); GET_EXTRA_PARAM(mCoverageV, 1.0);
|
||||
GET_EXTRA_PARAM(mTranslateFrameU, 0.0); GET_EXTRA_PARAM(mTranslateFrameV, 0.0);
|
||||
GET_EXTRA_PARAM(mRotateFrame, 0.0);
|
||||
GET_EXTRA_PARAM(mStagger, false);
|
||||
GET_EXTRA_PARAM(mRepeatU, 1.0); GET_EXTRA_PARAM(mRepeatV, 1.0);
|
||||
GET_EXTRA_PARAM(mOffsetU, 0.0); GET_EXTRA_PARAM(mOffsetV, 0.0);
|
||||
GET_EXTRA_PARAM(mRotateUV, 0.0);
|
||||
GET_EXTRA_PARAM(mNoiseU, 0.0); GET_EXTRA_PARAM(mNoiseV, 0.0);
|
||||
|
||||
// FCOLLADA profile
|
||||
if (profileCommon) {
|
||||
pTechnique = findExtraTechnique((const domProfile_COMMON::domTechnique*)profileCommon->getTechnique(), "FCOLLADA");
|
||||
if (pTechnique) {
|
||||
domAny* bump = daeSafeCast<domAny>(const_cast<domTechnique*>(pTechnique)->getChild("bump"));
|
||||
mTechnique = findExtraTechnique((const domProfile_COMMON::domTechnique*)profileCommon->getTechnique(), "FCOLLADA");
|
||||
if (mTechnique) {
|
||||
domAny* bump = daeSafeCast<domAny>(const_cast<domTechnique*>(mTechnique)->getChild("bump"));
|
||||
if (bump) {
|
||||
domAny* bumpTexture = daeSafeCast<domAny>(bump->getChild("texture"));
|
||||
if (bumpTexture) {
|
||||
daeSIDResolver resolver(const_cast<domEffect*>(effect), bumpTexture->getAttribute("texture").c_str());
|
||||
domCommon_newparam_type* param = daeSafeCast<domCommon_newparam_type>(resolver.getElement());
|
||||
if (param)
|
||||
bumpSampler = param->getSampler2D();
|
||||
mBumpSampler = param->getSampler2D();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -235,21 +235,21 @@ class ColladaExtension_node : public ColladaExtension
|
|||
{
|
||||
public:
|
||||
// FCOLLADA or OpenCOLLADA profile elements
|
||||
AnimatedFloat visibility;
|
||||
const char* user_properties;
|
||||
AnimatedFloat mVisibility;
|
||||
const char* mUserProperties;
|
||||
|
||||
ColladaExtension_node(const domNode* node)
|
||||
{
|
||||
// FCOLLADA profile
|
||||
pTechnique = findExtraTechnique(node, "FCOLLADA");
|
||||
GET_EXTRA_PARAM(visibility, 1.0);
|
||||
GET_EXTRA_PARAM(user_properties, "");
|
||||
mTechnique = findExtraTechnique(node, "FCOLLADA");
|
||||
GET_EXTRA_PARAM(mVisibility, 1.0);
|
||||
GET_EXTRA_PARAM(mUserProperties, "");
|
||||
|
||||
// OpenCOLLADA profile
|
||||
pTechnique = findExtraTechnique(node, "OpenCOLLADA");
|
||||
if (!visibility.mElement)
|
||||
GET_EXTRA_PARAM(visibility, 1.0);
|
||||
GET_EXTRA_PARAM(user_properties, user_properties);
|
||||
mTechnique = findExtraTechnique(node, "OpenCOLLADA");
|
||||
if (!mVisibility.mElement)
|
||||
GET_EXTRA_PARAM(mVisibility, 1.0);
|
||||
GET_EXTRA_PARAM(mUserProperties, mUserProperties);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -258,13 +258,13 @@ class ColladaExtension_geometry : public ColladaExtension
|
|||
{
|
||||
public:
|
||||
// MAYA profile elements
|
||||
bool double_sided;
|
||||
bool mDoubleSided;
|
||||
|
||||
ColladaExtension_geometry(const domGeometry* geometry)
|
||||
{
|
||||
// MAYA profile
|
||||
pTechnique = findExtraTechnique(geometry, "MAYA");
|
||||
GET_EXTRA_PARAM(double_sided, false);
|
||||
mTechnique = findExtraTechnique(geometry, "MAYA");
|
||||
GET_EXTRA_PARAM(mDoubleSided, false);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -278,27 +278,27 @@ public:
|
|||
};
|
||||
|
||||
// Torque profile elements (none of these are animatable)
|
||||
S32 num_triggers;
|
||||
Vector<Trigger> triggers;
|
||||
bool cyclic;
|
||||
bool blend;
|
||||
F32 blendReferenceTime;
|
||||
F32 priority;
|
||||
S32 mNumTriggers;
|
||||
Vector<Trigger> mTriggers;
|
||||
bool mCyclic;
|
||||
bool mBlend;
|
||||
F32 mBlendReferenceTime;
|
||||
F32 mPriority;
|
||||
|
||||
ColladaExtension_animation_clip(const domAnimation_clip* clip)
|
||||
{
|
||||
// Torque profile
|
||||
pTechnique = findExtraTechnique(clip, "Torque");
|
||||
GET_EXTRA_PARAM(num_triggers, 0);
|
||||
for (S32 iTrigger = 0; iTrigger < num_triggers; iTrigger++) {
|
||||
triggers.increment();
|
||||
get(avar("trigger_time%d", iTrigger), triggers.last().time, 0.0f);
|
||||
get(avar("trigger_state%d", iTrigger), triggers.last().state, 0);
|
||||
mTechnique = findExtraTechnique(clip, "Torque");
|
||||
GET_EXTRA_PARAM(mNumTriggers, 0);
|
||||
for (S32 iTrigger = 0; iTrigger < mNumTriggers; iTrigger++) {
|
||||
mTriggers.increment();
|
||||
get(avar("trigger_time%d", iTrigger), mTriggers.last().time, 0.0f);
|
||||
get(avar("trigger_state%d", iTrigger), mTriggers.last().state, 0);
|
||||
}
|
||||
GET_EXTRA_PARAM(cyclic, false);
|
||||
GET_EXTRA_PARAM(blend, false);
|
||||
GET_EXTRA_PARAM(blendReferenceTime, 0.0f);
|
||||
GET_EXTRA_PARAM(priority, 5.0f);
|
||||
GET_EXTRA_PARAM(mCyclic, false);
|
||||
GET_EXTRA_PARAM(mBlend, false);
|
||||
GET_EXTRA_PARAM(mBlendReferenceTime, 0.0f);
|
||||
GET_EXTRA_PARAM(mPriority, 5.0f);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue