mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 22:00:05 +00:00
commit
7d5dea1bac
@ -32,6 +32,12 @@
|
|||||||
<uri>meshes/link_0.stl</uri>
|
<uri>meshes/link_0.stl</uri>
|
||||||
</mesh>
|
</mesh>
|
||||||
</geometry>
|
</geometry>
|
||||||
|
<material>
|
||||||
|
<ambient>1 0 0 1</ambient>
|
||||||
|
<diffuse>0 0 1 1</diffuse>
|
||||||
|
<specular>0.1 0.1 0.1 1</specular>
|
||||||
|
<emissive>0 0 0 0</emissive>
|
||||||
|
</material>
|
||||||
</visual>
|
</visual>
|
||||||
</link>
|
</link>
|
||||||
<link name='lbr_iiwa_link_1'>
|
<link name='lbr_iiwa_link_1'>
|
||||||
|
@ -490,7 +490,22 @@ bool UrdfParser::parseVisual(UrdfModel& model, UrdfVisual& visual, TiXmlElement*
|
|||||||
// Material
|
// Material
|
||||||
TiXmlElement *mat = config->FirstChildElement("material");
|
TiXmlElement *mat = config->FirstChildElement("material");
|
||||||
//todo(erwincoumans) skip materials in SDF for now (due to complexity)
|
//todo(erwincoumans) skip materials in SDF for now (due to complexity)
|
||||||
if (mat && !m_parseSDF)
|
if (mat)
|
||||||
|
{
|
||||||
|
if (m_parseSDF)
|
||||||
|
{
|
||||||
|
UrdfMaterial* matPtr = new UrdfMaterial;
|
||||||
|
matPtr->m_name = "mat";
|
||||||
|
std::string diffuseText = mat->FirstChildElement("diffuse")->GetText();
|
||||||
|
btVector4 rgba(1,0,0,1);
|
||||||
|
parseVector4(rgba,diffuseText);
|
||||||
|
matPtr->m_rgbaColor = rgba;
|
||||||
|
matPtr->m_textureFilename = "textureTest.png";
|
||||||
|
model.m_materials.insert(matPtr->m_name.c_str(),matPtr);
|
||||||
|
visual.m_materialName = "mat";
|
||||||
|
visual.m_hasLocalMaterial = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// get material name
|
// get material name
|
||||||
if (!mat->Attribute("name"))
|
if (!mat->Attribute("name"))
|
||||||
@ -514,6 +529,7 @@ bool UrdfParser::parseVisual(UrdfModel& model, UrdfVisual& visual, TiXmlElement*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user