Example #1
0
        void GetImagesTransparency(out double poweredBy, out double project)
        {
            var curve = new CurveLine();

            curve.AddPoint(0, new Vector3(0, 0, 0));
            curve.AddPoint(1.0, new Vector3(0, 0, 0));
            curve.AddPoint(1.0 + FadingTime, new Vector3(1, 0, 0));
            curve.AddPoint(1.0 + FadingTime + PoweredByTime, new Vector3(1, 0, 0));
            curve.AddPoint(1.0 + FadingTime + PoweredByTime + FadingTime, new Vector3(0, 0, 0));
            curve.AddPoint(1.0 + FadingTime + PoweredByTime + FadingTime + 1.0, new Vector3(0, 0, 0));
            curve.AddPoint(1.0 + FadingTime + PoweredByTime + FadingTime + 1.0 + FadingTime, new Vector3(0, 1, 0));
            curve.AddPoint(1.0 + FadingTime + PoweredByTime + FadingTime + 1.0 + FadingTime + ProjectTime, new Vector3(0, 1, 0));
            curve.AddPoint(1.0 + FadingTime + PoweredByTime + FadingTime + 1.0 + FadingTime + ProjectTime + FadingTime, new Vector3(0, 0, 0));

            var value = curve.CalculateValueByTime(Time);

            poweredBy = MathEx.Saturate(value.X);
            project   = MathEx.Saturate(value.Y);

            if (!enablePoweredByTime)
            {
                poweredBy = 0;
            }

            if (gotoMainMenu)
            {
                poweredBy = 0;
                project   = 0;
            }
        }
Example #2
0
        double GetFadeInAlpha()
        {
            var curve = new CurveLine();

            curve.AddPoint(0, new Vector3(1, 0, 0));
            curve.AddPoint(1.0, new Vector3(1, 0, 0));
            curve.AddPoint(1.0 + 1.0, new Vector3(0, 0, 0));

            var value = curve.CalculateValueByTime(fadeInTimer);

            return(MathEx.Saturate(value.X));
        }
        public void CutLine(CurveLine curve)
        {
            foreach (var tr in geomManager.triangle)
            {
                ElementCutParameters p = new ElementCutParameters();
                p.CutLine(tr, curve, pref.CalcAreaRelation);
                cutParam.Add(tr, p);
            }

            if ((pref.WeightFunctionCalculate) & (curve is Circle))
            {
                foreach (var v in geomManager.vertex)
                {
                    weightfunc.Add(v, ((Circle)curve).CalcWeightFunc(v.X, v.Y));
                }
            }
        }