本文整理汇总了C++中IAnimatedMeshSceneNode::setAutomaticCulling方法的典型用法代码示例。如果您正苦于以下问题:C++ IAnimatedMeshSceneNode::setAutomaticCulling方法的具体用法?C++ IAnimatedMeshSceneNode::setAutomaticCulling怎么用?C++ IAnimatedMeshSceneNode::setAutomaticCulling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAnimatedMeshSceneNode
的用法示例。
在下文中一共展示了IAnimatedMeshSceneNode::setAutomaticCulling方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
/* shadowDimen = dimension2du(1024,1024);
shadowDimen = dimension2du(2048,2048);
shadowDimen = dimension2du(4096,4096);
shadowDimen = dimension2du(2048,2048);
filterType = EFT_NONE;
filterType = EFT_4PCF;
filterType = EFT_8PCF;
filterType = EFT_4PCF;
*/
dimension2du shadowDimen = dimension2du(1024,1024);
E_FILTER_TYPE filterType = EFT_4PCF;
filterType = EFT_NONE;
////
IrrlichtDevice* device = createDevice(EDT_OPENGL,dimension2du(800,600),32);
ISceneManager* smgr = device->getSceneManager();
IVideoDriver* driver = device->getVideoDriver();
ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0,100,.5);
cam->setPosition(vector3df(0,10,0));
// Create the effect handler, passing the device and RTT size (as a dimension2d) .
effectHandler* effect = new effectHandler(device,shadowDimen);
ITerrainSceneNode* terrain = smgr->addTerrainSceneNode("media/terrain.bmp",0,-1,vector3df(0,0,0),vector3df(0,0,0),vector3df(1,1,1),SColor(255,255,255,255),1,ETPS_33);
terrain->setMaterialTexture(0,driver->getTexture("media/terrain.jpg"));
terrain->setMaterialTexture(1, driver->getTexture("media/detailmap.jpg"));
terrain->scaleTexture(1,10);
terrain->setScale(core::vector3df(4, 0.01f, 4));
terrain->setPosition(vector3df(-120,-1.5f,-120));
terrain->setMaterialType(EMT_DETAIL_MAP);
// Make the terrain recieve a shadow with the specified filter type.
// (NOTE: 12PCF is only available in Direct3D9, all others work with OpenGL)
effect->addShadowToNode(terrain,filterType);
IAnimatedMeshSceneNode* sydney;
IAnimatedMesh* sydneymesh = smgr->getMesh("media/dwarf.x");
for(int g = 0;g < 1;g++)
{
for(int v = 0;v < 3;v++)
{
sydney = smgr->addAnimatedMeshSceneNode(sydneymesh);
sydney->setScale(vector3df(0.05f,0.05f,0.05f));
sydney->setPosition(vector3df(g * 4,0.5f,v * 4));
sydney->setMaterialFlag(EMF_NORMALIZE_NORMALS,true);
sydney->setAutomaticCulling(EAC_FRUSTUM_BOX);
sydney->setMaterialType(EMT_SOLID);
// Add the nodes to the depth pass so that they cast a shadow.
effect->addNodeToDepthPass(sydney);
}
}
effect->getLightCamera()->addAnimator(smgr->createFlyCircleAnimator(sydney->getPosition() + vector3df(0,15,0),25,0.0002f));
effect->getLightCamera()->setNearValue(5);
effect->setMaxShadowDistanceFromLight(120);
smgr->addLightSceneNode(effect->getLightCamera());
MyEventReceiver receiver(cam);
device->setEventReceiver(&receiver);
// Parent a sphere to the light camera so we can see its position.
smgr->addSphereSceneNode(1,8,effect->getLightCamera())->setMaterialFlag(EMF_LIGHTING,false);
while(device->run())
{
wchar_t tmp[255];
swprintf(tmp,255,L"Shadow Map Demo (FPS: %d)",driver->getFPS());
device->setWindowCaption(tmp);
driver->beginScene(true,true,SColor(0,0,0,0));
// Point the light camera at one of the nodes as it rotates around them.
effect->setLightTarget(sydney->getPosition());
// Update the effect handler, remember to always do this BEFORE smgr->drawAll and AFTER beginscene!
effect->update();
smgr->drawAll();
// If user wishes we can display the shadow map to the screen. (May not work in OpenGL)
//.........这里部分代码省略.........