Ejemplo n.º 1
0
        public override void DoExecute(BaseContext c)
        {
            if (c.sampledPositions == null)
            {
                return;
            }
            if (c.sampledPositions.Count > 0)
            {
                c.sampledPositions.Clear();
            }
            Vector3 position      = c.Position;
            float   single        = Time.time * 1f;
            float   samplingRange = this.SamplingRange / (float)this.SampleRings;

            for (float i = this.SamplingRange; i > 0.5f; i -= samplingRange)
            {
                single += 10f;
                for (float j = single % 35f; j < 360f; j += 35f)
                {
                    Vector3 vector3 = new Vector3(position.x + Mathf.Sin(j * 0.0174532924f) * i, position.y, position.z + Mathf.Cos(j * 0.0174532924f) * i);
                    if (!this.CalculatePath || i >= this.SamplingRange * this.CalculatePathInnerCirclePercentageThreshold)
                    {
                        ScanForPositions.TryAddPoint(c, vector3, false, this.ScanAllAreas, this.AreaName, this.SampleTerrainHeight);
                    }
                    else
                    {
                        ScanForPositions.TryAddPoint(c, vector3, true, this.ScanAllAreas, this.AreaName, this.SampleTerrainHeight);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public override void DoExecute(BaseContext c)
        {
            if (c.sampledPositions == null)
            {
                return;
            }
            if (c.sampledPositions.Count > 0)
            {
                c.sampledPositions.Clear();
            }
            Vector3 position = c.Position;
            float   num1     = Time.get_time() * 1f;
            float   num2     = this.SamplingRange / (float)this.SampleRings;

            for (float samplingRange = this.SamplingRange; (double)samplingRange > 0.5; samplingRange -= num2)
            {
                num1 += 10f;
                for (float num3 = num1 % 35f; (double)num3 < 360.0; num3 += 35f)
                {
                    Vector3 p;
                    ((Vector3) ref p).\u002Ector((float)(position.x + (double)Mathf.Sin(num3 * ((float)Math.PI / 180f)) * (double)samplingRange), (float)position.y, (float)(position.z + (double)Mathf.Cos(num3 * ((float)Math.PI / 180f)) * (double)samplingRange));
                    if (this.CalculatePath && (double)samplingRange < (double)this.SamplingRange * (double)this.CalculatePathInnerCirclePercentageThreshold)
                    {
                        ScanForPositions.TryAddPoint(c, p, true, this.ScanAllAreas, this.AreaName, this.SampleTerrainHeight);
                    }
                    else
                    {
                        ScanForPositions.TryAddPoint(c, p, false, this.ScanAllAreas, this.AreaName, this.SampleTerrainHeight);
                    }
                }
            }
        }