Fix bugs with quaternion editor.
This commit is contained in:
@@ -61,6 +61,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
_slidingEnded = true;
|
_slidingEnded = true;
|
||||||
ClearToken();
|
ClearToken();
|
||||||
};
|
};
|
||||||
|
_defaultSlidingSpeed = XElement.ValueBox.SlideSpeed;
|
||||||
|
|
||||||
YElement = grid.FloatValue();
|
YElement = grid.FloatValue();
|
||||||
YElement.ValueBox.Category = Utils.ValueCategory.Angle;
|
YElement.ValueBox.Category = Utils.ValueCategory.Angle;
|
||||||
@@ -270,7 +271,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
Float3 average = Float3.Zero;
|
Float3 average = Float3.Zero;
|
||||||
for (int i = 0; i < Values.Count; i++)
|
for (int i = 0; i < Values.Count; i++)
|
||||||
{
|
{
|
||||||
var value = (Quaternion)Values[0];
|
var value = (Quaternion)Values[i];
|
||||||
var euler = value.EulerAngles;
|
var euler = value.EulerAngles;
|
||||||
|
|
||||||
average += euler;
|
average += euler;
|
||||||
@@ -337,6 +338,13 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
XElement.ValueBox.Value = euler.X;
|
XElement.ValueBox.Value = euler.X;
|
||||||
YElement.ValueBox.Value = euler.Y;
|
YElement.ValueBox.Value = euler.Y;
|
||||||
ZElement.ValueBox.Value = euler.Z;
|
ZElement.ValueBox.Value = euler.Z;
|
||||||
|
|
||||||
|
if (!Mathf.NearEqual(XElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
||||||
|
XElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
||||||
|
if (!Mathf.NearEqual(YElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
||||||
|
YElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
||||||
|
if (!Mathf.NearEqual(ZElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
||||||
|
ZElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -444,17 +444,11 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
ZElement.ValueBox.Value = value.Z;
|
ZElement.ValueBox.Value = value.Z;
|
||||||
|
|
||||||
if (!Mathf.NearEqual(XElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
if (!Mathf.NearEqual(XElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
||||||
{
|
|
||||||
XElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
XElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
||||||
}
|
|
||||||
if (!Mathf.NearEqual(YElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
if (!Mathf.NearEqual(YElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
||||||
{
|
|
||||||
YElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
YElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
||||||
}
|
|
||||||
if (!Mathf.NearEqual(ZElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
if (!Mathf.NearEqual(ZElement.ValueBox.SlideSpeed, _defaultSlidingSpeed))
|
||||||
{
|
|
||||||
ZElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
ZElement.ValueBox.SlideSpeed = _defaultSlidingSpeed;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user