예제 #1
0
    void Start()
    {
        cheatmode = FindObjectOfType <HotAirBalloon>();

        viewer = FindObjectOfType <CameraMovement>().transform;

        sidewaysSpeed = new AxisSpeed("X", 1, SpeedBuildup, SpeedFalloff);
        forwardSpeed  = new AxisSpeed("Y", 1, SpeedBuildup, SpeedFalloff);

        directions = new List <AxisSpeed>();
        directions.Add(sidewaysSpeed);
        directions.Add(forwardSpeed);

        rb = GetComponent <Rigidbody>();
        c  = GetComponent <Climber>();
        g  = GetComponentInChildren <GroundChecker>();
    }
예제 #2
0
    public void Start()
    {
        Target = FindObjectOfType <PlayerMovement>().transform;

        x = InitialX;
        y = InitialY;
        z = InitialZ;

        axisX = new AxisSpeed("Camera X", MaxSpeedX, BuildupX, SpeedFalloff, InvertX);
        axisY = new AxisSpeed("Camera Y", MaxSpeedY, BuildupY, SpeedFalloff, InvertY);
        axisZ = new AxisSpeed("Camera Z", MaxSpeedZ, BuildupZ, SpeedFalloff, InvertZ);

        directions = new List <AxisSpeed>();
        directions.Add(axisX);
        directions.Add(axisY);
        directions.Add(axisZ);
    }
예제 #3
0
        private string EQ_SendGCode(AxisId axisId, HemisphereOption hemisphere, AxisMode mode, AxisDirection direction, AxisSpeed speed)
        {
            System.Diagnostics.Debug.WriteLine(string.Format("EQ_SendGCode({0}, {1}, {2}, {3}, {4})", axisId, hemisphere, mode, direction, speed));
            byte ch;

            ch = 0;

            // Set Direction bit	(Bit 0)
            if (direction == AxisDirection.Reverse)
            {
                ch |= 0x01;
            }

            // Set Hemisphere bit	(Bit 1)
            if (hemisphere == HemisphereOption.Southern)
            {
                ch |= 0x02;
            }

            // 0 = high speed GOTO mode
            // 1 = low speed SLEW mode
            // 2 = low speed GOTO mode
            // 3 = high speed SLEW mode

            // Set Mode and speed bits
            if (mode == AxisMode.Goto)
            {
                //goto
                if (speed == AxisSpeed.LowSpeed)
                {
                    // Low speed goto = 2
                    ch |= 0x20;
                }
                else
                {
                    //high speed goto = 0
                }
            }
            else
            {
                // slew
                if (speed == AxisSpeed.HighSpeed)
                {
                    // High speed slew= 3
                    ch |= 0x30;
                }
                else
                {
                    // low speed slew= 1
                    ch |= 0x10;
                }
            }


            // Send 'G' Command, with parameter
            return(GetEQSendCommandCommand(axisId, 'G', ch, 2));
        }
예제 #4
0
        protected string MCSetMotionMode(AxisId axis, HemisphereOption hemisphere, AxisMode mode, AxisDirection direction, AxisSpeed speed)
        {
            byte ch;

            ch = 0;

            // Set Direction bit	(Bit 0)
            if (direction == AxisDirection.Reverse)
            {
                ch |= 0x01;
            }

            // Set Hemisphere bit	(Bit 1)
            if (hemisphere == HemisphereOption.Southern)
            {
                ch |= 0x02;
            }

            // 0 = high speed GOTO mode
            // 1 = low speed SLEW mode
            // 2 = low speed GOTO mode
            // 3 = high speed SLEW mode

            // Set Mode and speed bits
            if (mode == AxisMode.Goto)
            {
                //goto
                if (speed == AxisSpeed.LowSpeed)
                {
                    // Low speed goto = 2
                    ch |= 0x20;
                }
                else
                {
                    //high speed goto = 0
                }
            }
            else
            {
                // slew
                if (speed == AxisSpeed.HighSpeed)
                {
                    // High speed slew= 3
                    ch |= 0x30;
                }
                else
                {
                    // low speed slew= 1
                    ch |= 0x10;
                }
            }


            string szCmd = LongTo2BitHEX(ch);

            return(GetTalkWithAxisCommand(axis, 'G', szCmd));
        }