Struct XMShort2
A 2D vector consisting of 16-bit signed and normalized integer components.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.PackedVector
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public struct XMShort2 : IEquatable<XMShort2>
Constructors
| Edit this page View SourceXMShort2(short, short)
Initializes a new instance of the XMShort2 struct.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y", Justification = "Reviewed")]
public XMShort2(short x, short y)
Parameters
| Type | Name | Description |
|---|---|---|
| short | x | The x-coordinate of the vector. |
| short | y | The y-coordinate of the vector. |
XMShort2(short[])
Initializes a new instance of the XMShort2 struct.
Declaration
public XMShort2(short[] array)
Parameters
| Type | Name | Description |
|---|---|---|
| short[] | array | The components of the vector. |
XMShort2(ReadOnlySpan<short>)
Initializes a new instance of the XMShort2 struct.
Declaration
public XMShort2(ReadOnlySpan<short> array)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<short> | array | The components of the vector. |
XMShort2(ReadOnlySpan<float>)
Initializes a new instance of the XMShort2 struct.
Declaration
public XMShort2(ReadOnlySpan<float> array)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<float> | array | The components of the vector. |
XMShort2(float, float)
Initializes a new instance of the XMShort2 struct.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y", Justification = "Reviewed")]
public XMShort2(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x-coordinate of the vector. |
| float | y | The y-coordinate of the vector. |
XMShort2(float[])
Initializes a new instance of the XMShort2 struct.
Declaration
public XMShort2(float[] array)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | array | The components of the vector. |
XMShort2(uint)
Initializes a new instance of the XMShort2 struct.
Declaration
public XMShort2(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 short X { get; set; }
Property Value
| Type | Description |
|---|---|
| short |
Y
Gets or sets the y-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y", Justification = "Reviewed")]
public short Y { get; set; }
Property Value
| Type | Description |
|---|---|
| short |
Methods
| Edit this page View SourceEquals(XMShort2)
Declaration
public readonly bool Equals(XMShort2 other)
Parameters
| Type | Name | Description |
|---|---|---|
| XMShort2 | 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)
Declaration
public static XMShort2 FromVector(XMVector value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMVector | value | A XMVector. |
Returns
| Type | Description |
|---|---|
| XMShort2 | A XMShort2. |
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View SourceToVector()
Declaration
public XMVector ToVector()
Returns
| Type | Description |
|---|---|
| XMVector | A XMVector. |
Operators
| Edit this page View Sourceoperator ==(XMShort2, XMShort2)
Declaration
public static bool operator ==(XMShort2 left, XMShort2 right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMShort2 | left | |
| XMShort2 | right |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator XMVector(XMShort2)
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
public static implicit operator XMVector(XMShort2 value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMShort2 | value | A XMShort2. |
Returns
| Type | Description |
|---|---|
| XMVector | A XMVector. |
implicit operator XMShort2(XMVector)
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
public static implicit operator XMShort2(XMVector value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMVector | value | A XMVector. |
Returns
| Type | Description |
|---|---|
| XMShort2 | A XMShort2. |
operator !=(XMShort2, XMShort2)
Declaration
public static bool operator !=(XMShort2 left, XMShort2 right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMShort2 | left | |
| XMShort2 | right |
Returns
| Type | Description |
|---|---|
| bool |