Struct HalfSingle
- Namespace
- Microsoft.Xna.Framework.Graphics.PackedVector
- Assembly
- MonoGame.Framework.dll
Packed vector type containing a single 16-bit floating point
public struct HalfSingle : IPackedVector<ushort>, IPackedVector, IEquatable<HalfSingle>
- Implements
- Inherited Members
Constructors
HalfSingle(float)
Initializes a new instance of this structure.
public HalfSingle(float single)
Parameters
singlefloatTheThe initial value for this structure.
Properties
PackedValue
Directly gets or sets the packed representation of the value.
public ushort PackedValue { get; set; }
Property Value
Methods
Equals(HalfSingle)
public bool Equals(HalfSingle other)
Parameters
otherHalfSingle
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToSingle()
Expands the packed representation to a System.Single
public float ToSingle()
Returns
- float
The expanded value.
ToString()
public override string ToString()
Returns
ToVector4()
Expands the packed representation into a Vector4.
public Vector4 ToVector4()
Returns
Operators
operator ==(HalfSingle, HalfSingle)
Returns a value that indicates whether the two values are equal.
public static bool operator ==(HalfSingle lhs, HalfSingle rhs)
Parameters
lhsHalfSingleThe value on the left of the equality operator.
rhsHalfSingleThe value on the right of the equality operator.
Returns
- bool
true if the two values are equal; otherwise, false.
operator !=(HalfSingle, HalfSingle)
Returns a value that indicates whether the two value are not equal.
public static bool operator !=(HalfSingle lhs, HalfSingle rhs)
Parameters
lhsHalfSingleThe value on the left of the inequality operator.
rhsHalfSingleThe value on the right of the inequality operator.
Returns
- bool
true if the two value are not equal; otherwise, false.