本文整理汇总了C++中QuadTree::init方法的典型用法代码示例。如果您正苦于以下问题:C++ QuadTree::init方法的具体用法?C++ QuadTree::init怎么用?C++ QuadTree::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuadTree
的用法示例。
在下文中一共展示了QuadTree::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitWindowsApp
//.........这里部分代码省略.........
descDepth.MipLevels = 1;
descDepth.ArraySize = 1;
descDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
descDepth.SampleDesc.Count = 1;
descDepth.SampleDesc.Quality = 0;
descDepth.Usage = D3D10_USAGE_DEFAULT;
descDepth.BindFlags = D3D10_BIND_DEPTH_STENCIL;
descDepth.CPUAccessFlags = 0;
descDepth.MiscFlags = 0;
md3dDevice->CreateTexture2D( &descDepth, NULL, &mDepthStencil );
// Create the depth stencil view
D3D10_DEPTH_STENCIL_VIEW_DESC descDSV;
ZeroMemory( &descDSV, sizeof(descDSV) );
descDSV.Format = descDepth.Format;
descDSV.ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2D;
descDSV.Texture2D.MipSlice = 0;
// Bind the render target view and depth/stencil view to the pipeline.
md3dDevice->CreateDepthStencilView( mDepthStencil, &descDSV, &mDepthStencilView );
md3dDevice->OMSetRenderTargets( 1, &mRenderTargetView, mDepthStencilView );
// Set the viewport transform.
vp.TopLeftX = 0;
vp.TopLeftY = 0;
vp.Width = SCREEN_WIDTH;
vp.Height = SCREEN_HEIGHT;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
md3dDevice->RSSetViewports(1, &vp);
//________________________________
Effects::InitAll(md3dDevice);
fxU.init(md3dDevice, Effects::MeshFX);
Terrain::InitInfo tii;
tii.CellSpacing = 1.0f;
tii.HeightmapFilename = L"flat513.raw";
tii.HeightOffset = -30.0f;
tii.HeightScale = 0.2f;
tii.NumCols = 513;
tii.NumRows = 513;
land.init(md3dDevice, tii);
//mTerrain.init(md3dDevice, (std::string)"Textures/Terrain/HeightMap.raw", 0.35f, -50.0f, 0.1f, 512, 512);
//Cube c;
//c.init(md3dDevice, D3DXVECTOR3(2.0f, 2.0f, 2.0f), D3DXVECTOR3(-16.0f, land.getHeight(-16.0f, -16.0f)+1.0f, -16.0f));
//mCubes.push_back(c);
//nr.push_back(0);
nrOfTowers.push_back(0);
mCubes.resize(10);
for(int i = 0; i < mCubes.size();i++)
{
mCubes[i].init(i, md3dDevice, D3DXVECTOR3(5.0f,5.0f,5.0f), D3DXVECTOR3(0.0f, land.getHeight(0.0f,0.0f), 0.0f), (i*0.50f+0.50f));
nr.push_back(0);
}
pWave = new wave(1, 20, md3dDevice, &land);
pWave->initMonsters();
mPyramid.init(md3dDevice, D3DXVECTOR3(2.0f, 2.0f, 2.0f), D3DXVECTOR3(-16.0f, land.getHeight(-16.0f, -16.0f)+5.0f, -16.0f));
mCylinder.init(md3dDevice, 1.0f, D3DXVECTOR3(-2.0f, land.getHeight(-2.0f, -8.0f)+1.0f, -8.0f));
//GetCamera().setPosY(land.getHeight(GetCamera().getPos().x, GetCamera().getPos().z));
GetCamera().setLens(0.30f*pi, (float)SCREEN_WIDTH/SCREEN_HEIGHT, 1.0f, 1000.0f);