本文整理汇总了C++中VisRenderContext_cl::GetLODDistanceScaling方法的典型用法代码示例。如果您正苦于以下问题:C++ VisRenderContext_cl::GetLODDistanceScaling方法的具体用法?C++ VisRenderContext_cl::GetLODDistanceScaling怎么用?C++ VisRenderContext_cl::GetLODDistanceScaling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisRenderContext_cl
的用法示例。
在下文中一共展示了VisRenderContext_cl::GetLODDistanceScaling方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Set
void VTerrainVisibilityInfo::Set(IVisVisibilityCollector_cl *pCollector,const VTerrainConfig &config)
{
hkvVec3 vCamPos(hkvNoInitialization), vCamDir(hkvNoInitialization);
pCollector->GetSourceObject()->GetPosition(vCamPos);
vCamDir = pCollector->GetSourceObject()->GetDirection();
VisRenderContext_cl *pLODContext = pCollector->GetLODReferenceRenderContext();
VASSERT(pLODContext!=NULL && pLODContext->GetCamera()!=NULL);
pLODContext->GetCamera()->GetPosition(m_vCamLODPos);
m_vCamPos.FromRenderSpace(config,(const hkvVec3& )vCamPos);
m_vCamVisPos = vCamPos;
m_CameraPlane.setFromPointAndNormal(vCamPos,vCamDir);
VASSERT(m_vCamPos.IsValid(config));
// compute the rest
float fNear,fFar;
pCollector->GetClipPlanes(fNear,fFar);
m_fMaxViewDistance = fFar;
m_fLODDistanceInvScale = pLODContext->GetLODDistanceScaling() * VTerrainSectorManager::g_fDecorationDistanceInvScaling;
if (m_fLODDistanceInvScale>0.f)
m_fLODDistanceScale = 1.f/m_fLODDistanceInvScale;
else
m_fLODDistanceScale = 0.f;
// overestimate
config.GetViewDistanceBox(m_CamBBox, m_vCamVisPos, fFar);
m_VisibleRangeBox.FromRenderSpace(config,m_CamBBox);
m_iContextFilterMask = pCollector->GetFilterBitmask();
// reset min/max
m_iVisibleSectorRange[0] = m_iVisibleSectorRange[1] = 32000;
m_iVisibleSectorRange[2] = m_iVisibleSectorRange[3] = -32000;
// reset some of the values:
m_iVisibleDecorationCount = 0;
m_iEstimatedDecorationCount = 0;
static bool bEnableOpt = true;
// shadowmap related:
if (bEnableOpt && pCollector->GetTypeId()==V_RUNTIME_CLASS(VShadowmapVisibilityCollector))
{
m_pSMGenerator = ((VShadowmapVisibilityCollector *)pCollector)->m_pSMGenerator;
float fShadowExtrusionFactor = m_pSMGenerator->GetShadowMapComponent()->GetShadowBoxExtrudeMultiplier();
m_vShadowExtrusion = m_pSMGenerator->GetDirection();
if (m_vShadowExtrusion.z<-0.01f) // normalize height
m_vShadowExtrusion.z *= (-1.f/m_vShadowExtrusion.z);
m_vShadowExtrusion *= fShadowExtrusionFactor;
m_bCastDynamicShadows = (m_pSMGenerator->GetShadowMapComponent()->GetGeometryTypes()&SHADOW_CASTER_TERRAIN)>0;
}
else
m_pSMGenerator = NULL;
}