当前位置: 首页>>代码示例>>C++>>正文


C++ X3DAttributes::getSFBool方法代码示例

本文整理汇总了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;
}
开发者ID:151706061,项目名称:MEPP,代码行数:13,代码来源:OgreNodeHandler.cpp

示例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;
}
开发者ID:151706061,项目名称:MEPP,代码行数:19,代码来源:OgreNodeHandler.cpp

示例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;
}
开发者ID:151706061,项目名称:MEPP,代码行数:42,代码来源:OgreNodeHandler.cpp


注:本文中的X3DAttributes::getSFBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。