XMFLOAT3 structure

Describes a 3D vector consisting of three single-precision floating-point values.

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

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

Syntax

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

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.

````cpp void XMFLOAT3()`

Default constructor for XMFLOAT3.

Default constructor for XMFLOAT3.

Note  This constructor is only available under C++.
 

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

A constructor for XMFLOAT3.

A constructor for XMFLOAT3.

Note  This constructor is only available under C++.

````cpp void XMFLOAT3( const XMFLOAT3 & )`

A constructor for XMFLOAT3.

A constructor for XMFLOAT3.

Note  This constructor is only available under C++.

````cpp XMFLOAT3 & operator=( const XMFLOAT3 & )`

Assigns the vector component data from one instance of XMFLOAT3 to the current instance of XMFLOAT3.

This operator assigns the vector component data from one instance of XMFLOAT3 to the current instance of XMFLOAT3.

Note  This operator is only available under C++.

````cpp void XMFLOAT3( XMFLOAT3 && )`

A constructor for XMFLOAT3.

A constructor for XMFLOAT3.

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





[````cpp
XM_CONSTEXPR XMFLOAT3(  float _x,  float _y,  float _z)`](nf-directxmath-xmfloat3-xmfloat3(float_float_float).md)

Initializes a new instance of <code>XMFLOAT3</code> from three <code>float</code> arguments.

This constructor initializes a new instance of <a href="https://docs.microsoft.com/windows/desktop/api/directxmath/ns-directxmath-xmfloat3">XMFLOAT3</a> from a three <code>float</code> arguments.
<div class="alert"><b>Note</b>  This constructor is only available under C++.</div><div> </div>



## Remarks
<code>XMFLOAT3</code> can be loaded into instances of <a href="https://docs.microsoft.com/windows/desktop/dxmath/xmvector-data-type"> XMVECTOR</a> by using
   <a href="https://docs.microsoft.com/en-us/windows/desktop/api/directxmath/nf-directxmath-xmloadfloat3">XMLoadFloat3</a>.

Instances of <code>XMVECTOR</code> can be stored into an instance of <code>XMFLOAT3</code> with
   <a href="https://docs.microsoft.com/windows/desktop/api/directxmath/nf-directxmath-xmstorefloat3">XMStoreFloat3</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://docs.microsoft.com/windows/desktop/dxmath/ovw-xnamath-reference-structures">DirectXMath Library Structures</a>



<a href="https://docs.microsoft.com/windows/desktop/dxmath/ovw-xmfloat3-extensions">XMFLOAT3 Extensions</a>