コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: UMetaLod_Impl.cs プロジェクト: mc-gulu/umetalod
        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);
        }