本文整理汇总了C++中Appearance::setIdS方法的典型用法代码示例。如果您正苦于以下问题:C++ Appearance::setIdS方法的具体用法?C++ Appearance::setIdS怎么用?C++ Appearance::setIdS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appearance
的用法示例。
在下文中一共展示了Appearance::setIdS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pontoAux
//.........这里部分代码省略.........
int lightId = GL_LIGHT0;
TiXmlElement* lightElement = lightingElement->FirstChildElement();
while(lightElement){
lightId++;
//OMNI
if ((string)lightElement->Value() == "omni"){
string oenabled; //boolean
string id;
string location, oambient, odiffuse, ospecular;
if (lightElement->Attribute("id") != NULL &&
lightElement->Attribute("enabled") != NULL &&
lightElement->Attribute("location") != NULL &&
lightElement->Attribute("ambient") != NULL &&
lightElement->Attribute("diffuse") != NULL &&
lightElement->Attribute("specular") != NULL)
{
string location = lightElement->Attribute("location");
float omniLocation[4];
omniLocation[3] = 1.0;
sscanf_s(location.c_str(),"%f %f %f", &omniLocation[0], &omniLocation[1], &omniLocation[2]);
float* dir = (float*) 0;
Omni* omniAux = new Omni(lightId, omniLocation, NULL);
id = lightElement->Attribute("id");
oenabled = lightElement->Attribute("enabled");
oambient = lightElement->Attribute("ambient");
odiffuse = lightElement->Attribute("diffuse");
ospecular = lightElement->Attribute("specular");
omniAux->setIdS(id);
omniAux->setIdI(lightId);
if(oenabled == "true") omniAux->enable();
else omniAux->disable();
float ambientArr[4];
sscanf_s(oambient.c_str(),"%f %f %f %f", &ambientArr[0], &ambientArr[1], &ambientArr[2], &ambientArr[3]);
omniAux->setAmbient(ambientArr);
float specularArr[4];
sscanf_s(ospecular.c_str(),"%f %f %f %f", &specularArr[0], &specularArr[1], &specularArr[2], &specularArr[3]);
omniAux->setSpecular(specularArr);
float diffuseArr[4];
sscanf_s(odiffuse.c_str(),"%f %f %f %f", &diffuseArr[0], &diffuseArr[1], &diffuseArr[2], &diffuseArr[3]);
omniAux->setDiffuse(diffuseArr);
scene->lightsComp.push_back(omniAux);
}
else
printf("Error parsing Omni Element\n");
}
else if ((string)lightElement->Value() == "spot")
{
string senabled; // boolean
float angle, exponent;
string id, direction;
if (lightElement->QueryFloatAttribute("angle",&angle)==TIXML_SUCCESS &&
lightElement->QueryFloatAttribute("exponent",&exponent)==TIXML_SUCCESS &&