本文整理汇总了C++中SubMesh::hasTransparency方法的典型用法代码示例。如果您正苦于以下问题:C++ SubMesh::hasTransparency方法的具体用法?C++ SubMesh::hasTransparency怎么用?C++ SubMesh::hasTransparency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubMesh
的用法示例。
在下文中一共展示了SubMesh::hasTransparency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawScene
//.........这里部分代码省略.........
// color
Vector3 color = light->getFinalColor();
// set light
render->enableLight(l);
render->setLightPosition(l, light->getTransformedPosition());
render->setLightDiffuse(l, Vector4(color));
render->setLightSpecular(l, Vector4(color));
render->setLightAmbient(l, Vector3(0, 0, 0));
render->setLightAttenuation(l, 1, 0, quadraticAttenuation);
// spot
render->setLightSpotAngle(l, light->getSpotAngle());
if(light->getSpotAngle() < 90){
render->setLightSpotDirection(l, light->getRotatedVector(Vector3(0, 0, -1)).getNormalized());
render->setLightSpotExponent(l, light->getSpotExponent());
}
else {
render->setLightSpotExponent(l, 0.0f);
}
}
for(l=lightsNumber; l<4; l++){
render->disableLight(l);
}
render->pushMatrix();
render->multMatrix(entity->getMatrix());
// draw opaques
drawOpaques(subMesh, mesh->getArmature());
if(subMesh->hasTransparency())
{
if(transpSubObsNumber < MAX_TRANSP_SUBOBJ)
{
// transparent subMesh pass
MSubMeshPass * subMeshPass = &transpSubObjs[transpSubObsNumber];
// lights
subMeshPass->lightsNumber = lightsNumber;
for(l=0; l<lightsNumber; l++)
subMeshPass->lights[l] = entityLights[entityLightsList[l]].light;
// z distance to camera
float z = getDistanceToCam(camera, center);
// set values
transpList[transpSubObsNumber] = transpSubObsNumber;
transpZList[transpSubObsNumber] = z;
subMeshPass->subMeshId = s;
subMeshPass->object = entity;
transpSubObsNumber++;
}
}
render->popMatrix();
}
mesh->updateBoundingBox();
(*entity->getBoundingBox()) = (*mesh->getBoundingBox());
}
}