From bfb8fd84838cd5ccb980d9a50d50183495131c61 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Thu, 2 Feb 2012 22:41:23 +0000 Subject: [PATCH] # Ifc: fix materials when running double precision. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1141 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCMaterial.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/IFCMaterial.cpp b/code/IFCMaterial.cpp index c3bf06a3f..1a490a8da 100644 --- a/code/IFCMaterial.cpp +++ b/code/IFCMaterial.cpp @@ -76,7 +76,7 @@ void FillMaterial(aiMaterial* mat,const IFC::IfcSurfaceStyle* surf,ConversionDat // now see which kinds of surface information are present BOOST_FOREACH(boost::shared_ptr< const IFC::IfcSurfaceStyleElementSelect > sel2, surf->Styles) { if (const IFC::IfcSurfaceStyleShading* shade = sel2->ResolveSelectPtr(conv.db)) { - IfcColor4 col_base,col; + aiColor4D col_base,col; ConvertColor(col_base, shade->SurfaceColour); mat->AddProperty(&col_base,1, AI_MATKEY_COLOR_DIFFUSE); @@ -84,7 +84,7 @@ void FillMaterial(aiMaterial* mat,const IFC::IfcSurfaceStyle* surf,ConversionDat if (const IFC::IfcSurfaceStyleRendering* ren = shade->ToPtr()) { if (ren->Transparency) { - const IfcFloat t = 1.f-ren->Transparency.Get(); + const float t = 1.f-static_cast(ren->Transparency.Get()); mat->AddProperty(&t,1, AI_MATKEY_OPACITY); } @@ -115,7 +115,7 @@ void FillMaterial(aiMaterial* mat,const IFC::IfcSurfaceStyle* surf,ConversionDat if(const EXPRESS::REAL* rt = ren->SpecularHighlight.Get()->ToPtr()) { // at this point we don't distinguish between the two distinct ways of // specifying highlight intensities. leave this to the user. - const IfcFloat e = *rt; + const float e = static_cast(*rt); mat->AddProperty(&e,1,AI_MATKEY_SHININESS); } else { @@ -141,7 +141,7 @@ unsigned int ProcessMaterials(const IFC::IfcRepresentationItem& item, Conversion name.Set(""); mat->AddProperty(&name,AI_MATKEY_NAME); - IfcColor4 col = IfcColor4(0.6f,0.6f,0.6f,1.0f); + const aiColor4D col = aiColor4D(0.6f,0.6f,0.6f,1.0f); mat->AddProperty(&col,1, AI_MATKEY_COLOR_DIFFUSE); conv.materials.push_back(mat.release());