コード例 #1
0
ファイル: Prismatic.cs プロジェクト: CrazyLiu00/GMap
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.L)
     {
         _joint.EnableLimit(!_joint.IsLimitEnabled());
     }
     if (e.KeyCode == Keys.M)
     {
         _joint.EnableMotor(!_joint.IsMotorEnabled());
     }
     if (e.KeyCode == Keys.P)
     {
         _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
     }
 }
コード例 #2
0
        /// <inheritdoc />
        public override void OnKeyDown(KeyInputEventArgs keyInput)
        {
            if (keyInput.Key == KeyCodes.L)
            {
                Joint.EnableLimit(!Joint.IsLimitEnabled());
            }

            if (keyInput.Key == KeyCodes.L)
            {
                Joint.EnableMotor(!Joint.IsMotorEnabled());
            }

            if (keyInput.Key == KeyCodes.L)
            {
                Joint.SetMotorSpeed(-Joint.GetMotorSpeed());
            }
        }
コード例 #3
0
        /// <inheritdoc />
        public override void OnKeyDown(KeyboardKeyEventArgs key)
        {
            if (key.Key == Key.L)
            {
                _joint.EnableLimit(!_joint.IsLimitEnabled());
            }

            if (key.Key == Key.L)
            {
                _joint.EnableMotor(!_joint.IsMotorEnabled());
            }

            if (key.Key == Key.L)
            {
                _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
            }
        }
コード例 #4
0
        /// <inheritdoc />
        public override void OnRender()
        {
            DrawString("Keys: (l) limits, (m) motors, (s) speed");

            var force = _joint.GetMotorForce(1 / TestSettings.Dt);

            DrawString($"Motor Force = {force}");

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableLimit(!_joint.IsLimitEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableMotor(!_joint.IsMotorEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
            }
        }
コード例 #5
0
ファイル: Prismatic.cs プロジェクト: yuyixiaoxiang/Box2DSharp
        /// <inheritdoc />
        protected override void PreStep()
        {
            DrawString("Keys: (l) limits, (m) motors, (s) speed");

            var force = _joint.GetMotorForce(TestSettings.Frequency);

            DrawString($"Motor Force = {force}");

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableLimit(!_joint.IsLimitEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableMotor(!_joint.IsMotorEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
            }
        }