Struct Half2
- Namespace
- HelixToolkit.Maths
- Assembly
- HelixToolkit.Maths.dll
Defines a two component vector, using half precision floating point coordinates.
public struct Half2 : IEquatable<Half2>
- Implements
- Inherited Members
- Extension Methods
Constructors
Half2(Half)
Initializes a new instance of the SharpDX.Half2 structure.
public Half2(Half value)
Parameters
valueHalfThe value to set for both the X and Y components.
Half2(Half, Half)
Initializes a new instance of the SharpDX.Half2 structure.
public Half2(Half x, Half y)
Parameters
Half2(float)
Initializes a new instance of the SharpDX.Half2 structure.
public Half2(float value)
Parameters
valuefloatValue to initialize X and Y components with.
Half2(float, float)
Initializes a new instance of the SharpDX.Half2 structure.
public Half2(float x, float y)
Parameters
Half2(ushort, ushort)
Initializes a new instance of the SharpDX.Half2 structure.
public Half2(ushort x, ushort y)
Parameters
Fields
X
Gets or sets the X component of the vector.
public Half X
Field Value
- Half
The X component of the vector.
Y
Gets or sets the Y component of the vector.
public Half Y
Field Value
- Half
The Y component of the vector.
Methods
Equals(Half2)
Returns a value that indicates whether the current instance is equal to the specified object.
public readonly bool Equals(Half2 other)
Parameters
otherHalf2Object to make the comparison with.
Returns
- bool
trueif the current instance is equal to the specified object;falseotherwise.
Equals(ref Half2, ref Half2)
Determines whether the specified object instances are considered equal.
public static bool Equals(ref Half2 value1, ref Half2 value2)
Parameters
Returns
- bool
trueifvalue1is the same instance asvalue2or if both arenullreferences or ifvalue1.Equals(value2)returnstrue; otherwise,false.
Equals(object?)
Returns a value that indicates whether the current instance is equal to a specified object.
public override readonly bool Equals(object? obj)
Parameters
objobjectObject to make the comparison with.
Returns
- bool
trueif the current instance is equal to the specified object;falseotherwise.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
Operators
operator ==(Half2, Half2)
Tests for equality between two objects.
public static bool operator ==(Half2 left, Half2 right)
Parameters
Returns
- bool
trueiflefthas the same value asright; otherwise,false.
implicit operator Vector2(Half2)
public static implicit operator Vector2(Half2 value)
Parameters
valueHalf2The value.
Returns
- Vector2
The result of the conversion.
implicit operator Half2(Vector2)
public static implicit operator Half2(Vector2 value)
Parameters
valueVector2The value.
Returns
- Half2
The result of the conversion.
operator !=(Half2, Half2)
Tests for inequality between two objects.
public static bool operator !=(Half2 left, Half2 right)
Parameters
Returns
- bool
trueiflefthas a different value thanright; otherwise,false.