本文整理汇总了C++中FnObject::GetVisibility方法的典型用法代码示例。如果您正苦于以下问题:C++ FnObject::GetVisibility方法的具体用法?C++ FnObject::GetVisibility怎么用?C++ FnObject::GetVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FnObject
的用法示例。
在下文中一共展示了FnObject::GetVisibility方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Display
/*----------------------------------
display the shadow on the terrain
C.Wang 0522, 2006
-----------------------------------*/
void FuCShadowModify::Display()
{
TPROFILE("Shadow Display");
if ( m_fyActor.Object() == FAILED_ID )
return;
FnObject model;
model.Object(mSeed);
if (!model.GetVisibility())
return;
WORLDid wID;
FnTriangle tT;
FnScene scene;
FnTerrain terrain;
int vLen , texLen = 2, tri[3];
float M[16], *G, vLC[3];
// get all neighboring triangles
//nList = terrain.GetAllVertexNeighborTriangles(iOne, list, 64);
//if (nList <= 0) return;
// get the matrix to character's base coordinate
m_lightCam.SetWorldPosition( m_actorPos );
G = m_lightCam.GetMatrix(TRUE);
FyInverseM16(G, M);
tT.Object( m_terrain.Object() , 0);
scene.Object(mHost);
wID = scene.GetWorld();
// reset all rendering states
FyResetRenderStates(wID);
FySetD3DRenderState(wID, D3DRS_LIGHTING, FALSE);
FySetD3DRenderState(wID, D3DRS_FOGENABLE, FALSE);
FySetD3DRenderState(wID, D3DRS_ZWRITEENABLE, FALSE);
// set current material
FySetCurrentMaterial(wID, mRenderTarget, FALSE, 1.0f);
FySetD3DRenderState(wID, D3DRS_ALPHABLENDENABLE, TRUE);
FySetD3DRenderState(wID, D3DRS_ALPHATESTENABLE, FALSE);
FySetD3DRenderState(wID, D3DRS_SRCBLEND, D3DBLEND_ZERO);
FySetD3DRenderState(wID, D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
LPDIRECT3DDEVICE9 dev = FyGetD3DDevice(wID);
float pos[16];
FuLitedVertex v[3];
// display these triangles
vLen = 6;
v[0].diffuse = D3DCOLOR_RGBA(255, 255, 255, 255);
v[1].diffuse = D3DCOLOR_RGBA(255, 255, 255, 255);
v[2].diffuse = D3DCOLOR_RGBA(255, 255, 255, 255);
int nTri = m_triIDVec.size();
for ( int i = 0; i < nTri ; i++)
{
// get the triangle vertices
tT.GetTopology( m_triIDVec[i] , tri);
for ( int j = 0; j < 3; ++j )
{
tT.GetVertex(tri[2-j], pos);
v[j].pos[0] = pos[0];
v[j].pos[1] = pos[1];
v[j].pos[2] = pos[2] + mShadowHeightOffset;
// calculate the texture coordinate
FUTransformVertexWithM16_Simple(vLC, v[j].pos, M);
CalculateShadowUV(vLC, v[j].uv);
}
FyDrawTriangles(wID, XYZ_DIFFUSE, 3 , 1 , &texLen, (float *) &v[0] );
}
}