public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc == null) { return(value); } pd = context.PropertyDescriptor; component = context.Instance; Matrix rot = (Matrix)value; Euler euler = Euler.FromMatrix(rot); using (EulerEditor ctrol = new EulerEditor(euler)) { ctrol.EulerChanged += ctrol_EulerChanged; edSvc.DropDownControl(ctrol); return(ctrol.Orientation.ToMatrix()); } }
public static Euler GetEulerAngles(this IRotable o) { return(Euler.FromMatrix(o.LocalRotation)); }