Esempio n. 1
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Time", true, out subEle);
            subEle.Value = Time.ToString();

            ele.TryPathTo("Radius", true, out subEle);
            subEle.Value = Radius.ToString();

            ele.TryPathTo("Color", true, out subEle);
            Color.WriteXML(subEle, master);

            ele.TryPathTo("Flags", true, out subEle);
            subEle.Value = Flags.ToString();

            ele.TryPathTo("FalloffExponent", true, out subEle);
            subEle.Value = FalloffExponent.ToString("G15");

            ele.TryPathTo("FOV", true, out subEle);
            subEle.Value = FOV.ToString("G15");

            ele.TryPathTo("Value", true, out subEle);
            subEle.Value = Value.ToString();

            ele.TryPathTo("Weight", true, out subEle);
            subEle.Value = Weight.ToString("G15");
        }
Esempio n. 2
0
        public void ManualPrintFOV()
        {
            var map = new ArrayMap <bool>(10, 10);

            QuickGenerators.GenerateRectangleMap(map);

            FOV myFov = new FOV(map);

            myFov.Calculate(5, 5, 3);

            Console.WriteLine(myFov);
            Console.WriteLine();
            Console.WriteLine(myFov.ToString(3));
        }
Esempio n. 3
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("FOV", true, out subEle);
            subEle.Value = FOV.ToString("G15");

            ele.TryPathTo("Topic", true, out subEle);
            Topic.WriteXML(subEle, master);

            ele.TryPathTo("Flags", true, out subEle);
            subEle.Value = Flags.ToString();

            WriteUnusedXML(ele, master);

            ele.TryPathTo("Type", true, out subEle);
            subEle.Value = Type.ToString();
        }
Esempio n. 4
0
        public override bool OnExport(SceneExportInfo info)
        {
            EngineInstanceEntity entity = _engineInstance as EngineInstanceEntity;

            // this shape is only exported as entity if the camera has a key
            SetHint(HintFlags_e.NoExport, string.IsNullOrEmpty(_objectKey));

            if (entity != null)
            {
                // we dont have a specific engine instance class, so assign via standard variable reflection
                entity.SetVariable("NearClipDistance", NearClipDistance.ToString());
                entity.SetVariable("FarClipDistance", FarClipDistance.ToString());
                entity.SetVariable("FovX", FOV.ToString());
            }

            bool bResult = base.OnExport(info);

            return(bResult);
        }
Esempio n. 5
0
        public void FOVBooleanOutput()
        {
            var map = new ArrayMap <bool>(10, 10);

            QuickGenerators.GenerateRectangleMap(map);

            var fov = new FOV(map);

            fov.Calculate(5, 5, 3);

            Console.WriteLine("FOV for reference:");
            Console.WriteLine(fov.ToString(2));

            foreach (var pos in fov.Positions())
            {
                bool inFOV = fov[pos] != 0.0;
                Assert.AreEqual(inFOV, fov.BooleanFOV[pos]);
            }
        }