Skip to content

Commit

Permalink
mintor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Apr 4, 2018
1 parent b181290 commit 802769a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
7 changes: 4 additions & 3 deletions AirLib/include/physics/FastPhysicsEngine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ class FastPhysicsEngine : public PhysicsEngineBase {
//TODO: implement better rolling friction
next.twist.angular *= 0.9f;

//there is no acceleration during collision response
//next.accelerations.linear = Vector3r::Zero();
//next.accelerations.angular = Vector3r::Zero();
// there is no acceleration during collision response, this is a hack, but without it the acceleration cancels
// the computed impulse response too much and stops the vehicle from bouncing off the collided object.
next.accelerations.linear = Vector3r::Zero();
next.accelerations.angular = Vector3r::Zero();

next.pose = current.pose;
if (enable_ground_lock && ground_collision) {
Expand Down
4 changes: 4 additions & 0 deletions LogViewer/LogViewer/Controls/SimpleLineChart.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ private void SmoothScroll(DataValue newValue)

void UpdateChart()
{
if (this.series == null)
{
this.series = new DataSeries() { Name = "", Values = new List<DataValue>() };
}
Canvas.SetLeft(Graph, 0);
visibleCount = 0;
this.smoothScrollIndex = 0;
Expand Down
11 changes: 2 additions & 9 deletions LogViewer/LogViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Xml.Linq;
Expand Down Expand Up @@ -1522,13 +1521,7 @@ private void OnClearZoom(object sender, RoutedEventArgs e)
private void OnConnectorClick(object sender, MouseButtonEventArgs e)
{
ConnectionPanel.Start();
TranslateTransform transform = new TranslateTransform(300, 0);
ConnectionPanel.RenderTransform = transform;
transform.BeginAnimation(TranslateTransform.XProperty,
new DoubleAnimation(0, new Duration(TimeSpan.FromSeconds(0.2)))
{
EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseOut }
});
XamlExtensions.Flyout(ConnectionPanel);
}

private void OnOpenFileCommand(object sender, ExecutedRoutedEventArgs e)
Expand Down Expand Up @@ -1680,7 +1673,7 @@ void SendMessage(MAVLink.MAVLINK_MSG_ID id, object mavlinkPayload)

private void OnSettings(object sender, RoutedEventArgs e)
{
AppSettingsPanel.Visibility = Visibility.Visible;
XamlExtensions.Flyout(AppSettingsPanel);
}

private void OnMapTest(object sender, RoutedEventArgs e)
Expand Down
18 changes: 14 additions & 4 deletions LogViewer/LogViewer/Utilities/XamlExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;

namespace LogViewer.Utilities
{
public static class XamlExtensions
{
public static void Flyout(this FrameworkElement e)
{
e.Visibility = Visibility.Visible;
e.UpdateLayout();
double width = e.ActualWidth;
TranslateTransform transform = new TranslateTransform(width, 0);
e.RenderTransform = transform;
transform.BeginAnimation(TranslateTransform.XProperty,
new DoubleAnimation(0, new Duration(TimeSpan.FromSeconds(0.2)))
{
EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseOut }
});
}

public static T FindAncestorOfType<T>(this DependencyObject d) where T : DependencyObject
{
Expand Down

0 comments on commit 802769a

Please sign in to comment.