예제 #1
0
        public Wave2D()
        {
            stamp    = new Stamp();
            clear    = new Clear();
            normal   = new Normal2D();
            caustics = new Caustics();
            uploader = new Uploader();
            boundary = new Boundary();
            wave     = new WaveEquation2D();

            validator.Reset();
            validator.Validation += () => {
                time = 0f;

                wave.Dt   = pd.dt;
                wave.Damp = Mathf.Clamp01(pd.damping * pd.dt);

                normal.Dxy = pd.normalScale;


                caustics.Refractive       = pd.refractiveIndex;
                caustics.DepthFieldAspect = DepthFieldAspect;
                caustics.LightDir         = pd.lightDir;
            };
        }
예제 #2
0
            /// <summary>
            /// Возвращает массив точек на окружности
            /// </summary>
            /// <param name="args">Углы точек относительно центра окружности и оси X</param>
            /// <param name="weights">Веса точек (по умолчанию единичные)</param>
            /// <returns></returns>
            public        Normal2D[] GetNormalsOnCircle(double[] args, double[] weights = null)
            {
                weights = weights ?? Vectors.Create(1.0, args.Length).DoubleMas;

                Normal2D[] res = new Normal2D[args.Length];
                for (int i = 0; i < res.Length; i++)
                {
                    res[i] = new Normal2D(this.center, new Point(center.x + radius * Math.Cos(args[i]), center.y + radius * Math.Sin(args[i])), weights[i]);
                }
                return(res);
            }
예제 #3
0
            public override bool Equals(object obj)
            {
                Normal2D v = (Normal2D)obj;

                return(n.Equals(v.n) && Position.Equals(v.Position));
            }