//--------------------------------------------------------------------------------------------------------- /// <summary> /// Конвертация объекта вектор в объект типа <see cref="Vector2D"/> /// </summary> /// <param name="value">Значение</param> /// <param name="target_type">Целевой тип</param> /// <param name="parameter">Дополнительный параметр</param> /// <param name="culture">Культура</param> /// <returns>Объект <see cref="Vector2D"/></returns> //--------------------------------------------------------------------------------------------------------- public Object Convert(Object value, Type target_type, Object parameter, CultureInfo culture) { if (value is Vector2D) { return(value); } if (value is System.Windows.Vector) { System.Windows.Vector v = (System.Windows.Vector)value; return(new Vector2D(v.X, v.Y)); } if (value is System.Windows.Point) { System.Windows.Point v = (System.Windows.Point)value; return(new Vector2D(v.X, v.Y)); } #if USE_ASSIMP if (value is Assimp.Vector2D) { Assimp.Vector2D v = (Assimp.Vector2D)value; return(new Vector2D(v.X, v.Y)); } #endif #if USE_SHARPDX if (value is SharpDX.Vector2) { SharpDX.Vector2 v = (SharpDX.Vector2)value; return(new Vector2D(v.X, v.Y)); } #endif return(Vector2D.Zero); }
public static Vector2 ToVector2(this Assimp.Vector2D v) { return(new Vector2(v.X, v.Y)); }
public static XNAV2 ToXna(this Assimp.Vector2D v) { return(new XNAV2(v.X, v.Y)); }
public static Vector2 ToNumeric(this Assimp.Vector2D vector) => new Vector2(vector.X, vector.Y);
public static OpenTK.Vector2 ToGL(this Assimp.Vector2D vector) { return(new OpenTK.Vector2(vector.X, vector.Y)); }