private void _updateLiveness(IMetaLodTarget target) { UMetaLodTargetFactorInfo factorInfo = new UMetaLodTargetFactorInfo(); factorInfo.FactorRate_Bounds = _calculateImpact(_factorBounds, target.GetFactorBounds()); factorInfo.FactorRate_GeomComplexity = _calculateImpact(_factorGeomComplexity, target.GetFactorGeomComplexity()); factorInfo.FactorRate_PSysComplexity = _calculateImpact(_factorPSysComplexity, target.GetFactorPSysComplexity()); factorInfo.FactorRate_VisualImpact = _calculateImpact(_factorBounds, target.GetFactorBounds()); factorInfo.FactorRate_UserFactors = 0.0f; foreach (var factor in _userFactors) { factorInfo.FactorRate_UserFactors += _calculateImpact(factor, target.GetUserFactor(factor.Name)); } // impact factors accumulation float factorRate = 1.0f - factorInfo.GetAccumulated(); // perform liveness calculation float distance = target.GetDistance() * factorRate; float liveness = 1.0f - UMetaLodUtil.Percent(_distInnerAttenuated, _distOuterAttenuated, distance); if (UMetaLodConfig.EnableDebuggingOutput) { target.OutputDebugInfo(ref factorInfo); } target.SetLiveness(liveness); }
private void _updateLiveness(IMetaLodTarget target) { UMetaLodTargetFactorInfo factorInfo = new UMetaLodTargetFactorInfo(); factorInfo.FactorRate_Bounds = _calculateImpact(_factorBounds, target.GetFactorBounds()); factorInfo.FactorRate_GeomComplexity = _calculateImpact(_factorGeomComplexity, target.GetFactorGeomComplexity()); factorInfo.FactorRate_PSysComplexity = _calculateImpact(_factorPSysComplexity, target.GetFactorPSysComplexity()); factorInfo.FactorRate_VisualImpact = _calculateImpact(_factorBounds, target.GetFactorBounds()); factorInfo.FactorRate_UserFactors = 0.0f; foreach (var factor in _userFactors) factorInfo.FactorRate_UserFactors += _calculateImpact(factor, target.GetUserFactor(factor.Name)); // impact factors accumulation float factorRate = 1.0f - factorInfo.GetAccumulated(); // perform liveness calculation float distance = target.GetDistance() * factorRate; float liveness = 1.0f - UMetaLodUtil.Percent(_distInnerAttenuated, _distOuterAttenuated, distance); if (UMetaLodConfig.EnableDebuggingOutput) target.OutputDebugInfo(ref factorInfo); target.SetLiveness(liveness); }