Struct XMUShort2
A 2D vector consisting of 16-bit unsigned integer components.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.PackedVector
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public struct XMUShort2 : IEquatable<XMUShort2>
  Constructors
| Edit this page View SourceXMUShort2(float, float)
Initializes a new instance of the XMUShort2 struct.
Declaration
public XMUShort2(float x, float y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float | x | The x-coordinate of the vector.  | 
      
| float | y | The y-coordinate of the vector.  | 
      
XMUShort2(float[])
Initializes a new instance of the XMUShort2 struct.
Declaration
public XMUShort2(float[] array)
  Parameters
| Type | Name | Description | 
|---|---|---|
| float[] | array | The components of the vector.  | 
      
XMUShort2(ushort, ushort)
Initializes a new instance of the XMUShort2 struct.
Declaration
public XMUShort2(ushort x, ushort y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ushort | x | The x-coordinate of the vector.  | 
      
| ushort | y | The y-coordinate of the vector.  | 
      
XMUShort2(ushort[])
Initializes a new instance of the XMUShort2 struct.
Declaration
public XMUShort2(ushort[] array)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ushort[] | array | The components of the vector.  | 
      
XMUShort2(uint)
Initializes a new instance of the XMUShort2 struct.
Declaration
public XMUShort2(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
public ushort X { get; set; }
  Property Value
| Type | Description | 
|---|---|
| ushort | 
Y
Gets or sets the y-coordinate of the vector.
Declaration
public ushort Y { get; set; }
  Property Value
| Type | Description | 
|---|---|
| ushort | 
Methods
| Edit this page View SourceEquals(XMUShort2)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(XMUShort2 other)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XMUShort2 | other | The object to compare with the current object.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
Equals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| object | obj | The object to compare with the current object.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
Overrides
| Edit this page View SourceFromVector(XMVector)
Declaration
public static XMUShort2 FromVector(XMVector value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XMVector | value | A XMVector.  | 
      
Returns
| Type | Description | 
|---|---|
| XMUShort2 | A XMUShort2.  | 
      
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance.  | 
      
Overrides
| Edit this page View SourceToVector()
Declaration
public XMVector ToVector()
  Returns
| Type | Description | 
|---|---|
| XMVector | A XMVector.  | 
      
Operators
| Edit this page View Sourceoperator ==(XMUShort2, XMUShort2)
Compares two XMUShort2 objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(XMUShort2 left, XMUShort2 right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XMUShort2 | left | The left XMUShort2 to compare.  | 
      
| XMUShort2 | right | The right XMUShort2 to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
implicit operator XMVector(XMUShort2)
Declaration
public static implicit operator XMVector(XMUShort2 value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XMUShort2 | value | A XMUShort2.  | 
      
Returns
| Type | Description | 
|---|---|
| XMVector | A XMVector.  | 
      
implicit operator XMUShort2(XMVector)
Declaration
public static implicit operator XMUShort2(XMVector value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XMVector | value | A XMVector.  | 
      
Returns
| Type | Description | 
|---|---|
| XMUShort2 | A XMUShort2.  | 
      
operator !=(XMUShort2, XMUShort2)
Compares two XMUShort2 objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(XMUShort2 left, XMUShort2 right)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XMUShort2 | left | The left XMUShort2 to compare.  | 
      
| XMUShort2 | right | The right XMUShort2 to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| bool |