Class XnaVector2Extensions
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
vVector2The XNA vector with component values in
unit.unitAccelerationUnitThe 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
vVector2The 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
vVector2The XNA vector with component values in
unit.unitElectricFieldUnitThe 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
vVector2The XNA vector with component values in
unit.unitForceUnitThe 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
vVector2The XNA vector with component values in
unit.unitImpulseUnitThe 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
vVector2The XNA vector with component values in
unit.unitJerkUnitThe 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
vVector2The XNA vector with component values in
unit.unitLengthUnitThe 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
vVector2The XNA vector with component values in
unit.unitLengthUnitThe physical unit of the component values.
pixelScaleRatioThe display scale factor to divide out.
Returns
- LengthVector2
A LengthVector2 with components divided by
pixelScaleand interpreted asunit.
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
vVector2The XNA vector with component values in
unit.unitLinearDensityUnitThe 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
vVector2The XNA vector with component values in
unit.unitMagneticFieldUnitThe 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
vVector2The XNA vector with component values in
unit.unitMagnetizationUnitThe 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
vVector2The XNA vector with component values in
unit.unitSpeedUnitThe 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
vAccelerationVector2The 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
vAccelerationVector2The typed vector.
unitAccelerationUnitThe 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
vDoubleVector2The 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
vElectricFieldVector2The 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
vElectricFieldVector2The typed vector.
unitElectricFieldUnitThe 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
vForceVector2The 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
vForceVector2The typed vector.
unitForceUnitThe 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
vImpulseVector2The 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
vImpulseVector2The typed vector.
unitImpulseUnitThe 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
vJerkVector2The 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
vJerkVector2The typed vector.
unitJerkUnitThe 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
vLengthVector2The 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
vLengthVector2The typed vector.
unitLengthUnitThe 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
vLengthVector2The typed vector.
unitLengthUnitThe unit to express components in before scaling.
pixelScaleRatioPixels 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
vLinearDensityVector2The 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
vLinearDensityVector2The typed vector.
unitLinearDensityUnitThe 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
vMagneticFieldVector2The 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
vMagneticFieldVector2The typed vector.
unitMagneticFieldUnitThe 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
vMagnetizationVector2The 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
vMagnetizationVector2The typed vector.
unitMagnetizationUnitThe 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
vSpeedVector2The 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
vSpeedVector2The typed vector.
unitSpeedUnitThe unit to express components in.
Returns
- Vector2
An XNA Microsoft.Xna.Framework.Vector2 with components in
unit.