Struct XMUShortN2
A 2D vector for storing unsigned, normalized values as unsigned 16-bit integers.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.PackedVector
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "XMU", Justification = "Reviewed")]
public struct XMUShortN2 : IEquatable<XMUShortN2>
Constructors
| Edit this page View SourceXMUShortN2(ReadOnlySpan<float>)
Initializes a new instance of the XMUShortN2 struct.
Declaration
public XMUShortN2(ReadOnlySpan<float> array)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<float> | array | The components of the vector. |
XMUShortN2(ReadOnlySpan<ushort>)
Initializes a new instance of the XMUShortN2 struct.
Declaration
public XMUShortN2(ReadOnlySpan<ushort> array)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<ushort> | array | The components of the vector. |
XMUShortN2(float, float)
Initializes a new instance of the XMUShortN2 struct.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y", Justification = "Reviewed")]
public XMUShortN2(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x-coordinate of the vector. |
| float | y | The y-coordinate of the vector. |
XMUShortN2(float[])
Initializes a new instance of the XMUShortN2 struct.
Declaration
public XMUShortN2(float[] array)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | array | The components of the vector. |
XMUShortN2(ushort, ushort)
Initializes a new instance of the XMUShortN2 struct.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y", Justification = "Reviewed")]
public XMUShortN2(ushort x, ushort y)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | x | The x-coordinate of the vector. |
| ushort | y | The y-coordinate of the vector. |
XMUShortN2(ushort[])
Initializes a new instance of the XMUShortN2 struct.
Declaration
public XMUShortN2(ushort[] array)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort[] | array | The components of the vector. |
XMUShortN2(uint)
Initializes a new instance of the XMUShortN2 struct.
Declaration
public XMUShortN2(uint packed)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | packed | A packed value representing the vector. |
Properties
| Edit this page View SourceX
Gets or sets the x-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X", Justification = "Reviewed")]
public ushort X { get; set; }
Property Value
| Type | Description |
|---|---|
| ushort |
Y
Gets or sets the x-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y", Justification = "Reviewed")]
public ushort Y { get; set; }
Property Value
| Type | Description |
|---|---|
| ushort |
Methods
| Edit this page View SourceEquals(XMUShortN2)
Declaration
public readonly bool Equals(XMUShortN2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| XMUShortN2 | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Declaration
public override readonly bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
| Edit this page View SourceFromVector(XMVector)
Converts a XMVector to a XMUShortN2.
Declaration
public static XMUShortN2 FromVector(XMVector value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMVector | value | A XMVector. |
Returns
| Type | Description |
|---|---|
| XMUShortN2 | A XMUShortN2. |
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View SourceToVector()
Converts a XMUShortN2 to a XMVector.
Declaration
public XMVector ToVector()
Returns
| Type | Description |
|---|---|
| XMVector | A XMVector. |
Operators
| Edit this page View Sourceoperator ==(XMUShortN2, XMUShortN2)
Declaration
public static bool operator ==(XMUShortN2 left, XMUShortN2 right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMUShortN2 | left | |
| XMUShortN2 | right |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator XMVector(XMUShortN2)
Converts a XMUShortN2 to a XMVector.
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
public static implicit operator XMVector(XMUShortN2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMUShortN2 | value | A XMUShortN2. |
Returns
| Type | Description |
|---|---|
| XMVector | A XMVector. |
implicit operator XMUShortN2(XMVector)
Converts a XMVector to a XMUShortN2.
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
public static implicit operator XMUShortN2(XMVector value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMVector | value | A XMVector. |
Returns
| Type | Description |
|---|---|
| XMUShortN2 | A XMUShortN2. |
operator !=(XMUShortN2, XMUShortN2)
Declaration
public static bool operator !=(XMUShortN2 left, XMUShortN2 right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMUShortN2 | left | |
| XMUShortN2 | right |
Returns
| Type | Description |
|---|---|
| bool |