本文整理汇总了C++中ISceneManager::getSceneNodesFromType方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneManager::getSceneNodesFromType方法的具体用法?C++ ISceneManager::getSceneNodesFromType怎么用?C++ ISceneManager::getSceneNodesFromType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneManager
的用法示例。
在下文中一共展示了ISceneManager::getSceneNodesFromType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
//false, //closeTop
//0.f //oblique
//);
//node = smgr->addMeshSceneNode(
//mesh,
//0, //ISceneNode * parent
//-1, //s32 id
//vector3df(0, -HEIGHT, 0), //const core::vector3df & position
//vector3df(0, 0, 0), //const core::vector3df & rotation
//vector3df(1.0f, 2.*HEIGHT, 1.0f) //const core::vector3df & scale
//);
//node->getMaterial(0).AmbientColor.set(0,0,0,255);
//node->getMaterial(0).DiffuseColor.set(0,0,0,255);
//sphere
//node = smgr->addSphereSceneNode(
//0.1, // radius
//50, // poly count
//0, // parent
//FruitID, // id
//vector3df(0, 0, 0), // center
//vector3df(0, 0, 0), // rotation
//vector3df(1.0f, 1.0f, 1.0f) // scale
//);
//node->getMaterial(0).AmbientColor.set(0,0,0,255);
//node->getMaterial(0).DiffuseColor.set(0,0,0,255);
//node->getMaterial(0).Lighting = true;
//-- collision ------------------------------------------------------------//
/* Put everything we want to do collision checking with inside the meta selector. */
IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector();
array<ISceneNode *> nodes;
smgr->getSceneNodesFromType(ESNT_ANY, nodes); // Find all nodes
for (u32 i=0; i < nodes.size(); ++i)
{
ISceneNode * node = nodes[i];
ITriangleSelector * selector = 0;
switch(node->getType())
{
case ESNT_CUBE:
case ESNT_ANIMATED_MESH:
// Because the selector won't animate with the mesh,
// and is only being used for camera collision, we'll just use an approximate
// bounding box instead of ((IAnimatedMeshSceneNode*)node)->getMesh(0)
selector = smgr->createTriangleSelectorFromBoundingBox(node);
break;
case ESNT_MESH:
case ESNT_SPHERE: // Derived from IMeshSceneNode
selector = smgr->createTriangleSelector(((IMeshSceneNode*)node)->getMesh(), node);
break;
case ESNT_TERRAIN:
selector = smgr->createTerrainTriangleSelector((ITerrainSceneNode*)node);
break;
case ESNT_OCTREE:
selector = smgr->createOctreeTriangleSelector(((IMeshSceneNode*)node)->getMesh(), node);
break;
default:
// Don't create a selector for this node type
break;