本文整理汇总了C++中ISceneManager::addSceneNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneManager::addSceneNode方法的具体用法?C++ ISceneManager::addSceneNode怎么用?C++ ISceneManager::addSceneNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneManager
的用法示例。
在下文中一共展示了ISceneManager::addSceneNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spawnVehicle
ISceneNode* spawnVehicle( const pdp::VehicleDesign *design, const vector3df &pos ) {
ISceneManager* smgr = irrlicht->getSceneManager();
ISceneNode *container_node = smgr->addSceneNode( "empty" );
std::list<IAnimatedMesh*>::const_iterator it = design->chassis()->meshes().begin();
std::list<IAnimatedMesh*>::const_iterator itEnd = design->chassis()->meshes().end();
for ( ; it != itEnd; ++it) {
IAnimatedMesh* mesh = *it;
IAnimatedMeshSceneNode* mesh_node = smgr->addAnimatedMeshSceneNode( mesh, container_node );
if (mesh_node) {
mesh_node->setMaterialFlag( EMF_LIGHTING, false );
mesh_node->setAnimationSpeed( 20.0f );
mesh_node->setMaterialTexture( 0, design->chassis()->texture() );
playerChassis = mesh_node;
}
}
std::list<pdp::Component*>::const_iterator tit = design->components().begin();
for (int i=0; i < design->chassis()->attachments().size(); ++i) {
pdp::Attachment a = design->chassis()->attachments()[i];
it = (*tit)->meshes().begin();
itEnd = (*tit)->meshes().end();
for (; it != itEnd; ++it) {
IAnimatedMesh *mesh = *it;
IMeshSceneNode *turr_node = smgr->addMeshSceneNode( mesh, container_node );
if (turr_node) {
turr_node->setMaterialFlag( EMF_LIGHTING, false );
turr_node->setMaterialTexture( 0, (*tit)->texture() );
turr_node->setPosition(a.offset());
if (a.type() == "Turret") {
playerTurret = turr_node;
}
}
}
++tit;
}
return container_node;
}