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`

        <b>float</b> value describing the x-coordinate of the vector.
    
    
        `y`

        <b>float</b> value describing the y-coordinate of the vector.
    
    
        `z`

        <b>float</b> value describing the z-coordinate of the vector.
    
    

        [````cpp

void XMFLOAT3()`](nf-directxmath-xmfloat3-xmfloat3.md)

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

Default constructor for XMFLOAT3.

Note  This constructor is only available under C++.
 
        [````cpp

void XMFLOAT3( const float *pArray)`](nf-directxmath-xmfloat3-xmfloat3(constfloat).md)

        A constructor for <code>XMFLOAT3</code>.

A constructor for XMFLOAT3.

Note  This constructor is only available under C++.
        [````cpp

void XMFLOAT3( const XMFLOAT3 & )`](nf-directxmath-xmfloat3-xmfloat3(constxmfloat3_).md)

        A constructor for <code>XMFLOAT3</code>.

A constructor for XMFLOAT3.

Note  This constructor is only available under C++.
        [````cpp

XMFLOAT3 & operator=( const XMFLOAT3 & )`](nf-directxmath-xmfloat3-operator-assign.md)

        Assigns the vector component data from one instance of <code>XMFLOAT3</code> to the current instance of <code>XMFLOAT3</code>.

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 && )`](nf-directxmath-xmfloat3-xmfloat3(xmfloat3__).md)

        A constructor for <code>XMFLOAT3</code>.

A constructor for XMFLOAT3.

Note  This constructor is only available under C++.
        ````cpp

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 XMFLOAT3 from a three float arguments.

Note  This constructor is only available under C++.
 
## 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

XMLoadFloat3.

Instances of XMVECTOR can be stored into an instance of XMFLOAT3 with XMStoreFloat3.

Namespace: Use DirectX

Platform Requirements

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

   
Header directxmath.h
## See Also

    <a href="https://docs.microsoft.com/windows/desktop/dxmath/ovw-xnamath-reference-structures">DirectXMath Library Structures</a>

XMFLOAT3 Extensions