XMFLOAT4 structure

Describes a 4D vector consisting of four single-precision floating-point values.

For a list of additional functionality such as constructors and operators that are available using XMFLOAT4 when you are programming in C++, see XMFLOAT4 Extensions.

Note  See DirectXMath Library Type Equivalences for information about equivalent D3DDECLTYPE, D3DFORMAT, and DXGI_FORMAT objects.
 

Syntax

struct XMFLOAT4 {
  float        x;
  float        y;
  float        z;
  float        w;
  void         XMFLOAT4();
  void         XMFLOAT4( const float *pArray);
  void         XMFLOAT4( const XMFLOAT4 & );
  XMFLOAT4 &   operator=( const XMFLOAT4 & );
  void         XMFLOAT4( XMFLOAT4 && );
  XMFLOAT4 &   operator=( XMFLOAT4 && );
  XM_CONSTEXPR XMFLOAT4( float _x, float _y, float _z, float _w);
};

Members

x

float value describing the x-coordinate of the vector.

y

float value describing the y-coordinate of the vector.

z

float value describing the z-coordinate of the vector.

w

float value describing the w-coordinate of the vector.

````cpp void XMFLOAT4()`

Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 

````cpp void XMFLOAT4( const float *pArray)`

Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 

````cpp void XMFLOAT4( const XMFLOAT4 & )`

Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 
XMFLOAT4 & operator=(  const XMFLOAT4 & )`





[````cpp
void XMFLOAT4(  XMFLOAT4 && )`](nf-directxmath-xmfloat4-xmfloat4(xmfloat4__).md)

Default constructor for <code>XMFLOAT4</code>.
    

Default constructor for <a href="https://msdn.microsoft.com/en-us/library/Ee419608(v=VS.85).aspx">XMFLOAT4</a>.
<div class="alert"><b>Note</b>  This constructor is only available under C++.</div><div> </div>



````cpp
XMFLOAT4 & operator=(  XMFLOAT4 && )`





[````cpp
XM_CONSTEXPR XMFLOAT4(  float _x,  float _y,  float _z,  float _w)`](nf-directxmath-xmfloat4-xmfloat4(float_float_float_float).md)

Initializes a new instance of <code>XMFLOAT4</code> from four <code>float</code> arguments.
    

This constructor initializes a new instance of <a href="https://msdn.microsoft.com/en-us/library/Ee419608(v=VS.85).aspx">XMFLOAT4</a> from four
	<code>float</code> arguments.
<div class="alert"><b>Note</b>  This constructor is only available under C++.
    </div><div> </div>



## Remarks
<code>XMFLOAT4</code> can be loaded into instances of <a href="https://msdn.microsoft.com/1a044094-444d-e787-fa6a-76e88531aef1">XMVECTOR</a> by using
	    <a href="https://msdn.microsoft.com/b23728ee-aa6d-4bed-b5fb-d4c3cb603504">XMLoadFloat4</a>.
	

Instances of <code>XMVECTOR</code> can be stored into an instance of <code>XMFLOAT4</code> with <a href="https://msdn.microsoft.com/en-us/library/Ee420343(v=VS.85).aspx">XMStoreFloat4</a>.
	

<b>Namespace:</b> Use DirectX

<h3><a id="Platform_Requirements"></a><a id="platform_requirements"></a><a id="PLATFORM_REQUIREMENTS"></a>Platform Requirements</h3>
Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.


## Requirements
| &nbsp; | &nbsp; |
| ---- |:---- |
| **Header** | directxmath.h |

## See Also

<a href="https://msdn.microsoft.com/58acb05d-e79b-8f42-4cf4-76ae57929739">DirectXMath Library Structures</a>



<a href="https://msdn.microsoft.com/en-us/library/Ee415311(v=VS.85).aspx">XMFLOAT4 Extensions</a>