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 XMFLOAT4 & );
  XMFLOAT4 &   operator=( const XMFLOAT4 & );
  void         XMFLOAT4( XMFLOAT4 && );
  XMFLOAT4 &   operator=( XMFLOAT4 && );
  XM_CONSTEXPR XMFLOAT4( float _x, float _y, float _z, float _w);
  void         XMFLOAT4( const float *pArray);
};

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.

void XMFLOAT4()

Constructors exposed by XMFLOAT4.

Constructs instances of the XMFLOAT4 structure.

Note  The constructors listed here are only available under C++.
 

Overload list

Constructor Description
XMFLOAT4 () Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 
XMFLOAT4 (const float*) Initializes a new instance of XMFLOAT4 from a four element float array argument.

This constructor initializes a new instance of XMFLOAT4 from a from a four element float array argument.

Note  This constructor is only available under C++.
 
XMFLOAT4 (float,float,float,float) Initializes a new instance of XMFLOAT4 from four float arguments.

This constructor initializes a new instance of XMFLOAT4 from four float arguments.

Note  This constructor is only available under C++.
 

void XMFLOAT4( const XMFLOAT4 & )

Constructors exposed by XMFLOAT4.

Constructs instances of the XMFLOAT4 structure.

Note  The constructors listed here are only available under C++.
 

Overload list

Constructor Description
XMFLOAT4 () Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 
XMFLOAT4 (const float*) Initializes a new instance of XMFLOAT4 from a four element float array argument.

This constructor initializes a new instance of XMFLOAT4 from a from a four element float array argument.

Note  This constructor is only available under C++.
 
XMFLOAT4 (float,float,float,float) Initializes a new instance of XMFLOAT4 from four float arguments.

This constructor initializes a new instance of XMFLOAT4 from four float arguments.

Note  This constructor is only available under C++.
 

XMFLOAT4 & operator=( const XMFLOAT4 & )

void XMFLOAT4( XMFLOAT4 && )

Constructors exposed by XMFLOAT4.

Constructs instances of the XMFLOAT4 structure.

Note  The constructors listed here are only available under C++.
 

Overload list

Constructor Description
XMFLOAT4 () Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 
XMFLOAT4 (const float*) Initializes a new instance of XMFLOAT4 from a four element float array argument.

This constructor initializes a new instance of XMFLOAT4 from a from a four element float array argument.

Note  This constructor is only available under C++.
 
XMFLOAT4 (float,float,float,float) Initializes a new instance of XMFLOAT4 from four float arguments.

This constructor initializes a new instance of XMFLOAT4 from four float arguments.

Note  This constructor is only available under C++.
 

XMFLOAT4 & operator=( XMFLOAT4 && )

XM_CONSTEXPR XMFLOAT4( float _x, float _y, float _z, float _w)

Constructors exposed by XMFLOAT4.

Constructs instances of the XMFLOAT4 structure.

Note  The constructors listed here are only available under C++.
 

Overload list

Constructor Description
XMFLOAT4 () Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 
XMFLOAT4 (const float*) Initializes a new instance of XMFLOAT4 from a four element float array argument.

This constructor initializes a new instance of XMFLOAT4 from a from a four element float array argument.

Note  This constructor is only available under C++.
 
XMFLOAT4 (float,float,float,float) Initializes a new instance of XMFLOAT4 from four float arguments.

This constructor initializes a new instance of XMFLOAT4 from four float arguments.

Note  This constructor is only available under C++.
 

void XMFLOAT4( const float *pArray)

Constructors exposed by XMFLOAT4.

Constructs instances of the XMFLOAT4 structure.

Note  The constructors listed here are only available under C++.
 

Overload list

Constructor Description
XMFLOAT4 () Default constructor for XMFLOAT4.

Default constructor for XMFLOAT4.

Note  This constructor is only available under C++.
 
XMFLOAT4 (const float*) Initializes a new instance of XMFLOAT4 from a four element float array argument.

This constructor initializes a new instance of XMFLOAT4 from a from a four element float array argument.

Note  This constructor is only available under C++.
 
XMFLOAT4 (float,float,float,float) Initializes a new instance of XMFLOAT4 from four float arguments.

This constructor initializes a new instance of XMFLOAT4 from four float arguments.

Note  This constructor is only available under C++.
 

Remarks

XMFLOAT4 can be loaded into instances of XMVECTOR by using XMLoadFloat4.

Instances of XMVECTOR can be stored into an instance of XMFLOAT4 with XMStoreFloat4.

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

DirectXMath Library Structures

XMFLOAT4 Extensions