Table of Contents

Class XnaVector2Extensions

Namespace
Thunder.UnitsNET.Vectors.MonoGame
Assembly
Thunder.UnitsNET.Vectors.MonoGame.dll

Extension methods for converting between XNA/MonoGame Microsoft.Xna.Framework.Vector2 and Thunder typed vector types.

public static class XnaVector2Extensions
Inheritance
XnaVector2Extensions
Inherited Members

Methods

ToAccelerationVector2(Vector2, AccelerationUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to an AccelerationVector2 with components interpreted as unit.

public static AccelerationVector2 ToAccelerationVector2(this Vector2 v, AccelerationUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit AccelerationUnit

The physical unit of the component values.

Returns

AccelerationVector2

The typed vector.

ToDoubleVector2(Vector2)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a DoubleVector2.

public static DoubleVector2 ToDoubleVector2(this Vector2 v)

Parameters

v Vector2

The XNA vector.

Returns

DoubleVector2

A DoubleVector2 with components cast to double.

ToElectricFieldVector2(Vector2, ElectricFieldUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to an ElectricFieldVector2 with components interpreted as unit.

public static ElectricFieldVector2 ToElectricFieldVector2(this Vector2 v, ElectricFieldUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit ElectricFieldUnit

The physical unit of the component values.

Returns

ElectricFieldVector2

The typed vector.

ToForceVector2(Vector2, ForceUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a ForceVector2 with components interpreted as unit.

public static ForceVector2 ToForceVector2(this Vector2 v, ForceUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit ForceUnit

The physical unit of the component values.

Returns

ForceVector2

The typed vector.

ToImpulseVector2(Vector2, ImpulseUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to an ImpulseVector2 with components interpreted as unit.

public static ImpulseVector2 ToImpulseVector2(this Vector2 v, ImpulseUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit ImpulseUnit

The physical unit of the component values.

Returns

ImpulseVector2

The typed vector.

ToJerkVector2(Vector2, JerkUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a JerkVector2 with components interpreted as unit.

public static JerkVector2 ToJerkVector2(this Vector2 v, JerkUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit JerkUnit

The physical unit of the component values.

Returns

JerkVector2

The typed vector.

ToLengthVector2(Vector2, LengthUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a LengthVector2 with components interpreted as unit.

public static LengthVector2 ToLengthVector2(this Vector2 v, LengthUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit LengthUnit

The physical unit of the component values.

Returns

LengthVector2

A LengthVector2 with components in unit.

ToLengthVector2(Vector2, LengthUnit, Ratio)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a LengthVector2, dividing components by pixelScale before interpreting as unit.

public static LengthVector2 ToLengthVector2(this Vector2 v, LengthUnit unit, Ratio pixelScale)

Parameters

v Vector2

The XNA vector with component values in unit.

unit LengthUnit

The physical unit of the component values.

pixelScale Ratio

The display scale factor to divide out.

Returns

LengthVector2

A LengthVector2 with components divided by pixelScale and interpreted as unit.

ToLinearDensityVector2(Vector2, LinearDensityUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a LinearDensityVector2 with components interpreted as unit.

public static LinearDensityVector2 ToLinearDensityVector2(this Vector2 v, LinearDensityUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit LinearDensityUnit

The physical unit of the component values.

Returns

LinearDensityVector2

The typed vector.

ToMagneticFieldVector2(Vector2, MagneticFieldUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a MagneticFieldVector2 with components interpreted as unit.

public static MagneticFieldVector2 ToMagneticFieldVector2(this Vector2 v, MagneticFieldUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit MagneticFieldUnit

The physical unit of the component values.

Returns

MagneticFieldVector2

The typed vector.

ToMagnetizationVector2(Vector2, MagnetizationUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a MagnetizationVector2 with components interpreted as unit.

public static MagnetizationVector2 ToMagnetizationVector2(this Vector2 v, MagnetizationUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit MagnetizationUnit

The physical unit of the component values.

Returns

MagnetizationVector2

The typed vector.

ToSpeedVector2(Vector2, SpeedUnit)

Converts an XNA Microsoft.Xna.Framework.Vector2 to a SpeedVector2 with components interpreted as unit.

public static SpeedVector2 ToSpeedVector2(this Vector2 v, SpeedUnit unit)

Parameters

v Vector2

The XNA vector with component values in unit.

unit SpeedUnit

The physical unit of the component values.

Returns

SpeedVector2

The typed vector.

ToXnaVector2(AccelerationVector2)

Converts an AccelerationVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this AccelerationVector2 v)

Parameters

v AccelerationVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(AccelerationVector2, AccelerationUnit)

Converts an AccelerationVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this AccelerationVector2 v, AccelerationUnit unit)

Parameters

v AccelerationVector2

The typed vector.

unit AccelerationUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(DoubleVector2)

Converts a DoubleVector2 to an XNA Microsoft.Xna.Framework.Vector2.

public static Vector2 ToXnaVector2(this DoubleVector2 v)

Parameters

v DoubleVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components cast to float.

ToXnaVector2(ElectricFieldVector2)

Converts an ElectricFieldVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this ElectricFieldVector2 v)

Parameters

v ElectricFieldVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(ElectricFieldVector2, ElectricFieldUnit)

Converts an ElectricFieldVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this ElectricFieldVector2 v, ElectricFieldUnit unit)

Parameters

v ElectricFieldVector2

The typed vector.

unit ElectricFieldUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(ForceVector2)

Converts a ForceVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this ForceVector2 v)

Parameters

v ForceVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(ForceVector2, ForceUnit)

Converts a ForceVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this ForceVector2 v, ForceUnit unit)

Parameters

v ForceVector2

The typed vector.

unit ForceUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(ImpulseVector2)

Converts an ImpulseVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this ImpulseVector2 v)

Parameters

v ImpulseVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(ImpulseVector2, ImpulseUnit)

Converts an ImpulseVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this ImpulseVector2 v, ImpulseUnit unit)

Parameters

v ImpulseVector2

The typed vector.

unit ImpulseUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(JerkVector2)

Converts a JerkVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this JerkVector2 v)

Parameters

v JerkVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(JerkVector2, JerkUnit)

Converts a JerkVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this JerkVector2 v, JerkUnit unit)

Parameters

v JerkVector2

The typed vector.

unit JerkUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(LengthVector2)

Converts a LengthVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this LengthVector2 v)

Parameters

v LengthVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(LengthVector2, LengthUnit)

Converts a LengthVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this LengthVector2 v, LengthUnit unit)

Parameters

v LengthVector2

The typed vector.

unit LengthUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(LengthVector2, LengthUnit, Ratio)

Converts a LengthVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit multiplied by pixelScale.

public static Vector2 ToXnaVector2(this LengthVector2 v, LengthUnit unit, Ratio pixelScale)

Parameters

v LengthVector2

The typed vector.

unit LengthUnit

The unit to express components in before scaling.

pixelScale Ratio

Pixels per unit (or other display scale factor).

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components scaled for rendering.

ToXnaVector2(LinearDensityVector2)

Converts a LinearDensityVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this LinearDensityVector2 v)

Parameters

v LinearDensityVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(LinearDensityVector2, LinearDensityUnit)

Converts a LinearDensityVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this LinearDensityVector2 v, LinearDensityUnit unit)

Parameters

v LinearDensityVector2

The typed vector.

unit LinearDensityUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(MagneticFieldVector2)

Converts a MagneticFieldVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this MagneticFieldVector2 v)

Parameters

v MagneticFieldVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(MagneticFieldVector2, MagneticFieldUnit)

Converts a MagneticFieldVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this MagneticFieldVector2 v, MagneticFieldUnit unit)

Parameters

v MagneticFieldVector2

The typed vector.

unit MagneticFieldUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(MagnetizationVector2)

Converts a MagnetizationVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this MagnetizationVector2 v)

Parameters

v MagnetizationVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(MagnetizationVector2, MagnetizationUnit)

Converts a MagnetizationVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this MagnetizationVector2 v, MagnetizationUnit unit)

Parameters

v MagnetizationVector2

The typed vector.

unit MagnetizationUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

ToXnaVector2(SpeedVector2)

Converts a SpeedVector2 to an XNA Microsoft.Xna.Framework.Vector2 using the default SI unit.

public static Vector2 ToXnaVector2(this SpeedVector2 v)

Parameters

v SpeedVector2

The typed vector.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in the default SI unit.

ToXnaVector2(SpeedVector2, SpeedUnit)

Converts a SpeedVector2 to an XNA Microsoft.Xna.Framework.Vector2 expressed in unit.

public static Vector2 ToXnaVector2(this SpeedVector2 v, SpeedUnit unit)

Parameters

v SpeedVector2

The typed vector.

unit SpeedUnit

The unit to express components in.

Returns

Vector2

An XNA Microsoft.Xna.Framework.Vector2 with components in unit.

v0.7.0 ▼