Struct XMFloat4
A 4D vector consisting of four single-precision floating-point values.
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public struct XMFloat4 : IEquatable<XMFloat4>, IFormattable
Constructors
| Edit this page View SourceXMFloat4(float, float, float, float)
Initializes a new instance of the XMFloat4 struct.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "z", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "w", Justification = "Reviewed")]
public XMFloat4(float x, float y, float z, float w)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x-coordinate of the vector. |
| float | y | The y-coordinate of the vector. |
| float | z | The z-coordinate of the vector. |
| float | w | The w-coordinate of the vector. |
XMFloat4(float[]?)
Initializes a new instance of the XMFloat4 struct.
Declaration
public XMFloat4(float[]? array)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | array | The components of the vector. |
Properties
| Edit this page View SourceW
Gets or sets the w-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "W", Justification = "Reviewed")]
public float W { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
X
Gets or sets the x-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X", Justification = "Reviewed")]
public float X { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Y
Gets or sets the y-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y", Justification = "Reviewed")]
public float Y { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Z
Gets or sets the z-coordinate of the vector.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Z", Justification = "Reviewed")]
public float Z { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
| Edit this page View SourceEquals(XMFloat4)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(XMFloat4 other)
Parameters
| Type | Name | Description |
|---|---|---|
| XMFloat4 | 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 XMFloat4 FromVector(XMVector value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMVector | value | A XMVector. |
Returns
| Type | Description |
|---|---|
| XMFloat4 | A XMFloat4. |
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 SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The fully qualified type name. |
Overrides
| Edit this page View SourceToString(string?, IFormatProvider?)
Formats the value of the current instance using the specified format.
Declaration
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | The format to use. -or- A null reference ( |
| IFormatProvider | formatProvider | The provider to use to format the value. -or- A null reference ( |
Returns
| Type | Description |
|---|---|
| string | The value of the current instance in the specified format. |
ToVector()
Declaration
public XMVector ToVector()
Returns
| Type | Description |
|---|---|
| XMVector | A XMVector. |
Operators
| Edit this page View Sourceoperator ==(XMFloat4, XMFloat4)
Compares two XMFloat4 objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(XMFloat4 left, XMFloat4 right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMFloat4 | left | The left XMFloat4 to compare. |
| XMFloat4 | right | The right XMFloat4 to compare. |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator XMVector(XMFloat4)
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
public static implicit operator XMVector(XMFloat4 value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMFloat4 | value | A XMFloat4. |
Returns
| Type | Description |
|---|---|
| XMVector | A XMVector. |
implicit operator XMFloat4(XMVector)
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
public static implicit operator XMFloat4(XMVector value)
Parameters
| Type | Name | Description |
|---|---|---|
| XMVector | value | A XMVector. |
Returns
| Type | Description |
|---|---|
| XMFloat4 | A XMFloat4. |
operator !=(XMFloat4, XMFloat4)
Compares two XMFloat4 objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(XMFloat4 left, XMFloat4 right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMFloat4 | left | The left XMFloat4 to compare. |
| XMFloat4 | right | The right XMFloat4 to compare. |
Returns
| Type | Description |
|---|---|
| bool |