Ejemplo n.º 1
0
        /// <inheritdoc />
        protected override void OnRender()
        {
            var torque = _joint.GetMotorTorque(TestSettings.Hertz);

            DrawString($"Motor Torque = {torque}");

            ImGui.SetNextWindowPos(new Vector2(10.0f, 100.0f));
            ImGui.SetNextWindowSize(new Vector2(200.0f, 100.0f));
            ImGui.Begin("Joint Controls", ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize);

            if (ImGui.Checkbox("Limit", ref _enableLimit))
            {
                _joint.EnableLimit(_enableLimit);
            }

            if (ImGui.Checkbox("Motor", ref _enableMotor))
            {
                _joint.EnableMotor(_enableMotor);
            }

            if (ImGui.SliderFloat("Speed", ref _motorSpeed, -100.0f, 100.0f, "%.0f"))
            {
                _joint.SetMotorSpeed(_motorSpeed);
            }

            ImGui.End();
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        protected override void OnRender()
        {
            var torque = Joint.GetMotorTorque(TestSettings.Hertz);

            DrawString($"Motor Torque = {torque}");

            var F = Joint.GetReactionForce(TestSettings.Hertz);

            DrawString($"Reaction Force = ({F.X}, {F.X})");
        }
Ejemplo n.º 3
0
        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            float torque = _joint.GetMotorTorque(settings.Hz);

            DrawString($"Motor Torque = {torque}");

            Vector2 F = _joint.GetReactionForce(settings.Hz);

            DrawString($"Reaction Force = ({F.X}, {F.Y})");
        }
Ejemplo n.º 4
0
        /// <inheritdoc />
        protected override void OnRender()
        {
            var torque = Joint.GetMotorTorque(TestSettings.Hertz);

            DrawString($"Motor Torque = {torque}");
        }