本文整理汇总了C++中CKinematics::CalculateWallmarks方法的典型用法代码示例。如果您正苦于以下问题:C++ CKinematics::CalculateWallmarks方法的具体用法?C++ CKinematics::CalculateWallmarks怎么用?C++ CKinematics::CalculateWallmarks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKinematics
的用法示例。
在下文中一共展示了CKinematics::CalculateWallmarks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_Dynamic
BOOL CRender::add_Dynamic(IRender_Visual *pVisual, u32 planes)
{
// Check frustum visibility and calculate distance to visual's center
Fvector Tpos; // transformed position
EFC_Visible VIS;
val_pTransform->transform_tiny (Tpos, pVisual->vis.sphere.P);
VIS = View->testSphere (Tpos, pVisual->vis.sphere.R,planes);
if (fcvNone==VIS) return FALSE ;
// If we get here visual is visible or partially visible
xr_vector<IRender_Visual*>::iterator I,E; // it may be usefull for 'hierrarhy' visuals
switch (pVisual->Type) {
case MT_PARTICLE_GROUP:
{
// Add all children, doesn't perform any tests
PS::CParticleGroup* pG = (PS::CParticleGroup*)pVisual;
for (PS::CParticleGroup::SItemVecIt i_it=pG->items.begin(); i_it!=pG->items.end(); i_it++)
{
PS::CParticleGroup::SItem& I = *i_it;
if (fcvPartial==VIS)
{
if (I._effect) add_Dynamic (I._effect,planes);
for (xr_vector<IRender_Visual*>::iterator pit = I._children_related.begin(); pit!=I._children_related.end(); pit++) add_Dynamic(*pit,planes);
for (xr_vector<IRender_Visual*>::iterator pit = I._children_free.begin(); pit!=I._children_free.end(); pit++) add_Dynamic(*pit,planes);
} else
{
if (I._effect) add_leafs_Dynamic (I._effect);
for (xr_vector<IRender_Visual*>::iterator pit = I._children_related.begin(); pit!=I._children_related.end(); pit++) add_leafs_Dynamic(*pit);
for (xr_vector<IRender_Visual*>::iterator pit = I._children_free.begin(); pit!=I._children_free.end(); pit++) add_leafs_Dynamic(*pit);
}
}
}
break;
case MT_HIERRARHY:
{
// Add all children
FHierrarhyVisual* pV = (FHierrarhyVisual*)pVisual;
I = pV->children.begin ();
E = pV->children.end ();
if (fcvPartial==VIS)
{
for (; I!=E; I++) add_Dynamic (*I,planes);
} else {
for (; I!=E; I++) add_leafs_Dynamic (*I);
}
}
break;
case MT_SKELETON_ANIM:
case MT_SKELETON_RIGID:
{
// Add all children, doesn't perform any tests
CKinematics * pV = (CKinematics*)pVisual;
BOOL _use_lod = FALSE ;
if (pV->m_lod)
{
Fvector Tpos; float D;
val_pTransform->transform_tiny (Tpos, pV->vis.sphere.P);
float ssa = CalcSSA (D,Tpos,pV->vis.sphere.R/2.f); // assume dynamics never consume full sphere
if (ssa<r_ssaLOD_A) _use_lod = TRUE ;
}
if (_use_lod)
{
add_leafs_Dynamic (pV->m_lod) ;
} else
{
pV->CalculateBones (TRUE);
pV->CalculateWallmarks (); //. bug?
I = pV->children.begin ();
E = pV->children.end ();
for (; I!=E; I++) add_leafs_Dynamic (*I);
}
/*
I = pV->children.begin ();
E = pV->children.end ();
if (fcvPartial==VIS) {
for (; I!=E; I++) add_Dynamic (*I,planes);
} else {
for (; I!=E; I++) add_leafs_Dynamic (*I);
}
*/
}
break;
default:
{
// General type of visual
r_dsgraph_insert_dynamic(pVisual,Tpos);
}
break;
}
return TRUE;
}
示例2:
void CRender::add_leafs_Dynamic (IRender_Visual *pVisual)
{
if (0==pVisual) return;
// Visual is 100% visible - simply add it
xr_vector<IRender_Visual*>::iterator I,E; // it may be useful for 'hierrarhy' visual
switch (pVisual->Type) {
case MT_PARTICLE_GROUP:
{
// Add all children, doesn't perform any tests
PS::CParticleGroup* pG = (PS::CParticleGroup*)pVisual;
for (PS::CParticleGroup::SItemVecIt i_it=pG->items.begin(); i_it!=pG->items.end(); i_it++) {
PS::CParticleGroup::SItem& I = *i_it;
if (I._effect) add_leafs_Dynamic (I._effect);
for (xr_vector<IRender_Visual*>::iterator pit = I._children_related.begin(); pit!=I._children_related.end(); pit++) add_leafs_Dynamic(*pit);
for (xr_vector<IRender_Visual*>::iterator pit = I._children_free.begin(); pit!=I._children_free.end(); pit++) add_leafs_Dynamic(*pit);
}
}
return;
case MT_HIERRARHY:
{
// Add all children, doesn't perform any tests
FHierrarhyVisual* pV = (FHierrarhyVisual*)pVisual;
I = pV->children.begin ();
E = pV->children.end ();
for (; I!=E; I++) add_leafs_Dynamic (*I);
}
return;
case MT_SKELETON_ANIM:
case MT_SKELETON_RIGID:
{
// Add all children, doesn't perform any tests
CKinematics * pV = (CKinematics*)pVisual;
BOOL _use_lod = FALSE ;
if (pV->m_lod)
{
Fvector Tpos; float D;
val_pTransform->transform_tiny (Tpos, pV->vis.sphere.P);
float ssa = CalcSSA (D,Tpos,pV->vis.sphere.R/2.f); // assume dynamics never consume full sphere
if (ssa<r_ssaLOD_A) _use_lod = TRUE;
}
if (_use_lod)
{
add_leafs_Dynamic (pV->m_lod) ;
} else {
pV->CalculateBones (TRUE);
pV->CalculateWallmarks (); //. bug?
I = pV->children.begin ();
E = pV->children.end ();
for (; I!=E; I++) add_leafs_Dynamic (*I);
}
}
return;
default:
{
// General type of visual
// Calculate distance to it's center
Fvector Tpos;
val_pTransform->transform_tiny (Tpos, pVisual->vis.sphere.P);
r_dsgraph_insert_dynamic (pVisual,Tpos);
}
return;
}
}