예제 #1
0
        /// <summary>
        /// Sets the vectors active and updates thier position and directions
        /// </summary>
        private void UpdateVectors()
        {
            if (selectedInstance == null)
            {
                return;
            }

            cameraDistance = Vector3.Distance(selectedInstance.position, FlightCamera.fetch.transform.position) / 4;

            if (referenceSystem == Space.World)
            {
                fwdVR.SetShow(true);
                upVR.SetShow(true);
                rightVR.SetShow(true);

                fwdVR.Vector = selectedInstance.groupCenter.gameObject.transform.forward;
                fwdVR.Start  = vectorDrawPosition;
                fwdVR.Scale  = cameraDistance;
                fwdVR.Draw();

                upVR.Vector = selectedInstance.groupCenter.gameObject.transform.up;
                upVR.Start  = vectorDrawPosition;
                upVR.Scale  = cameraDistance;
                upVR.Draw();

                rightVR.Vector = selectedInstance.groupCenter.gameObject.transform.right;
                rightVR.Start  = vectorDrawPosition;
                rightVR.Scale  = cameraDistance;
                rightVR.Draw();
            }
            else
            {
                fwdVR.SetShow(true);
                upVR.SetShow(true);
                rightVR.SetShow(true);

                fwdVR.Vector = selectedInstance.transform.forward;
                fwdVR.Start  = vectorDrawPosition;
                fwdVR.Scale  = cameraDistance;
                fwdVR.Draw();

                upVR.Vector = selectedInstance.transform.up;
                upVR.Start  = vectorDrawPosition;
                upVR.Scale  = cameraDistance;
                upVR.Draw();

                rightVR.Vector = selectedInstance.transform.right;
                rightVR.Start  = vectorDrawPosition;
                rightVR.Scale  = cameraDistance;
                rightVR.Draw();
            }
        }
예제 #2
0
파일: Suffixed.cs 프로젝트: mhotwagner/KOS
        public void DoExecuteWork(SharedObjects shared, Vector start, Vector vec, RgbaColor rgba, string str, double scale, bool show, double width, KOSDelegate colorUpdater, KOSDelegate vecUpdater, KOSDelegate startUpdater)
        {
            var vRend = new VectorRenderer(shared.UpdateHandler, shared)
            {
                Vector = vec,
                Start  = start,
                Color  = rgba,
                Scale  = scale,
                Width  = width
            };

            vRend.SetLabel(str);
            vRend.SetShow(show);

            if (colorUpdater != null)
            {
                vRend.SetSuffix("COLORUPDATER", colorUpdater);
            }

            if (vecUpdater != null)
            {
                vRend.SetSuffix("VECUPDATER", vecUpdater);
            }

            if (startUpdater != null)
            {
                vRend.SetSuffix("STARTUPDATER", startUpdater);
            }

            ReturnValue = vRend;
        }
예제 #3
0
        public void DoExecuteWork(SharedObjects shared)
        {
            var vRend = new VectorRenderer(shared.UpdateHandler, shared);

            vRend.SetShow(false);

            ReturnValue = vRend;
        }
예제 #4
0
파일: Suffixed.cs 프로젝트: jenden0/KOS
        public override void Execute(SharedObjects shared)
        {
            var vRend = new VectorRenderer(shared.UpdateHandler, shared);

            vRend.SetShow(false);

            shared.Cpu.PushStack(vRend);
        }
 /// <summary>
 /// stops the drawing of the vectors
 /// </summary>
 private void CloseVectors()
 {
     northVR.SetShow(false);
     eastVR.SetShow(false);
     fwdVR.SetShow(false);
     upVR.SetShow(false);
     rightVR.SetShow(false);
 }
예제 #6
0
        /// <summary>
        /// Sets the vectors active and updates thier position and directions
        /// </summary>
        private void UpdateVectors()
        {
            if (selectedObject == null)
            {
                return;
            }

            if (referenceSystem == Space.Self)
            {
                fwdVR.SetShow(true);
                upVR.SetShow(true);
                rightVR.SetShow(true);

                northVR.SetShow(false);
                eastVR.SetShow(false);

                fwdVR.Vector = selectedObject.gameObject.transform.forward;
                fwdVR.Start  = vectorDrawPosition;
                fwdVR.draw();

                upVR.Vector = selectedObject.gameObject.transform.up;
                upVR.Start  = vectorDrawPosition;
                upVR.draw();

                rightVR.Vector = selectedObject.gameObject.transform.right;
                rightVR.Start  = vectorDrawPosition;
                rightVR.draw();
            }
            if (referenceSystem == Space.World)
            {
                northVR.SetShow(true);
                eastVR.SetShow(true);

                fwdVR.SetShow(false);
                upVR.SetShow(false);
                rightVR.SetShow(false);

                northVR.Vector = northVector;
                northVR.Start  = vectorDrawPosition;
                northVR.draw();

                eastVR.Vector = eastVector;
                eastVR.Start  = vectorDrawPosition;
                eastVR.draw();
            }
        }
        /// <summary>
        /// Sets the vectors active and updates thier position and directions
        /// </summary>
        private void UpdateVectors()
        {
            if (selectedInstance == null)
            {
                return;
            }

            fwdVR.SetShow(true);
            upVR.SetShow(true);
            rightVR.SetShow(true);

            fwdVR.Vector = selectedInstance.groupCenter.gameObject.transform.forward;
            fwdVR.Start  = vectorDrawPosition;
            fwdVR.draw();

            upVR.Vector = selectedInstance.groupCenter.gameObject.transform.up;
            upVR.Start  = vectorDrawPosition;
            upVR.draw();

            rightVR.Vector = selectedInstance.groupCenter.gameObject.transform.right;
            rightVR.Start  = vectorDrawPosition;
            rightVR.draw();
        }
예제 #8
0
        public void DoExecuteWork(SharedObjects shared, Vector start, Vector vec, RgbaColor rgba, string str, double scale, bool show)
        {
            var vRend = new VectorRenderer(shared.UpdateHandler, shared)
            {
                Vector = vec,
                Start  = start,
                Color  = rgba,
                Scale  = scale
            };

            vRend.SetLabel(str);
            vRend.SetShow(show);

            ReturnValue = vRend;
        }
예제 #9
0
파일: Suffixed.cs 프로젝트: jenden0/KOS
        public override void Execute(SharedObjects shared)
        {
            bool      show  = Convert.ToBoolean(shared.Cpu.PopValue());
            double    scale = GetDouble(shared.Cpu.PopValue());
            string    str   = shared.Cpu.PopValue().ToString();
            RgbaColor rgba  = GetRgba(shared.Cpu.PopValue());
            Vector    vec   = GetVector(shared.Cpu.PopValue());
            Vector    start = GetVector(shared.Cpu.PopValue());

            var vRend = new VectorRenderer(shared.UpdateHandler, shared)
            {
                Vector = vec,
                Start  = start,
                Color  = rgba,
                Scale  = scale
            };

            vRend.SetLabel(str);
            vRend.SetShow(show);

            shared.Cpu.PushStack(vRend);
        }