COLLADA: Add support for <reflectivity> elements. This maps to AI_MATKEY_REFLECTIVITY.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@504 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2009-11-22 14:06:51 +00:00
parent f85d7b63ef
commit 46809f0dfa
4 changed files with 6 additions and 1 deletions

View File

@ -493,7 +493,7 @@ struct Effect
mTexTransparent, mTexBump, mTexReflective;
// Scalar factory
float mShininess, mRefractIndex;
float mShininess, mRefractIndex, mReflectivity;
float mTransparency;
// local params referring to each other by their SID
@ -518,6 +518,7 @@ struct Effect
, mDoubleSided (false)
, mWireframe (false)
, mFaceted (false)
, mReflectivity (1.f)
{
}
};

View File

@ -1147,6 +1147,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* pScene
// scalar properties
mat.AddProperty( &effect.mShininess, 1, AI_MATKEY_SHININESS);
mat.AddProperty( &effect.mReflectivity, 1, AI_MATKEY_REFLECTIVITY);
mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI);
// transparency, a very hard one. seemingly not all files are following the

View File

@ -1135,6 +1135,8 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
}
else if( IsElement( "shininess"))
ReadEffectFloat( pEffect.mShininess);
else if( IsElement( "reflectivity"))
ReadEffectFloat( pEffect.mReflectivity);
/* Single scalar properties */
else if( IsElement( "transparency"))

View File

@ -754,6 +754,7 @@ extern "C" {
#define AI_MATKEY_OPACITY "$mat.opacity",0,0
#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
#define AI_MATKEY_SHININESS "$mat.shininess",0,0
#define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0