本文整理汇总了C++中X3DAttributes::getSFBool方法的典型用法代码示例。如果您正苦于以下问题:C++ X3DAttributes::getSFBool方法的具体用法?C++ X3DAttributes::getSFBool怎么用?C++ X3DAttributes::getSFBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X3DAttributes
的用法示例。
在下文中一共展示了X3DAttributes::getSFBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startIndexedLineSet
int OgreNodeHandler::startIndexedLineSet(const X3DAttributes &attr) {
_currentGeometry = new IndexedGeometry(createUniqueName(attr, "indexedLineSet"));
int index = attr.getAttributeIndex(ID::coordIndex);
if (index != -1)
_currentGeometry->setCoordIndex(attr.getMFInt32(index));
index = attr.getAttributeIndex(ID::colorPerVertex);
_currentGeometry->setColorPerVertex(index != -1 ? attr.getSFBool(index) : true);
return CONTINUE;
}
示例2: startIndexedFaceSet
int OgreNodeHandler::startIndexedFaceSet(const X3DAttributes &attr) {
std::cout << "Start IndexedFaceSet" << std::endl;
_currentGeometry = new IndexedGeometry(createUniqueName(attr, "indexedFaceSet"));
int index = attr.getAttributeIndex(ID::coordIndex);
if (index != -1)
_currentGeometry->setCoordIndex(attr.getMFInt32(index));
index = attr.getAttributeIndex(ID::normalIndex);
if (index != -1)
_currentGeometry->setNormalIndex(attr.getMFInt32(index));
index = attr.getAttributeIndex(ID::normalPerVertex);
_currentGeometry->setNormalPerVertex(index != -1 ? attr.getSFBool(index) : true);
return 1;
}
示例3: startDirectionalLight
int OgreNodeHandler::startDirectionalLight(const X3DAttributes &attr) {
Light* light = _sceneManager->createLight(createUniqueName(attr, "directionalLight"));
light->setType(Ogre::Light::LT_DIRECTIONAL);
// Get the X3D values;
SFVec3f direction;
SFColor color;
int index = attr.getAttributeIndex(ID::direction);
if (index != -1)
{
direction = attr.getSFVec3f(index);
}
else
direction.z = -1;
index = attr.getAttributeIndex(ID::color);
if (index != -1)
{
color = attr.getSFColor(index);
}
else
color.r = color.g = color.b = 1;
index = attr.getAttributeIndex(ID::intensity);
float intensity = (index == -1) ? 1 : attr.getSFFloat(index);
index = attr.getAttributeIndex(ID::on);
bool on = (index == -1) ? true : attr.getSFBool(index);
// Set the Ogre values
light->setDirection(direction.x, direction.y, direction.z);
Ogre::ColourValue colourValue(color.r, color.g, color.b);
colourValue *= intensity;
light->setDiffuseColour(colourValue);
light->setSpecularColour(colourValue);
light->setVisible(on);
_nodeStack.top()->attachObject(light);
return 1;
}