XMUDECN4 structure (directxpackedvector.h)
A 4D vector for storing unsigned, normalized integer values as 10 bit unsigned x-, y-, and z-components and a 2-bit unsigned w-component.
For a list of more functionality such as constructors and operators that are available
using XMUDECN4
when you are programming in C++, see XMUDECN4 Extensions.
Syntax
struct XMUDECN4 {
union {
struct {
uint32_t x : 10;
uint32_t y : 10;
uint32_t z : 10;
uint32_t w : 2;
};
uint32_t v;
};
void XMUDECN4();
void XMUDECN4(
const XMUDECN4 & unnamedParam1
);
XMUDECN4 & operator=(
const XMUDECN4 & unnamedParam1
);
void XMUDECN4(
XMUDECN4 && unnamedParam1
);
XMUDECN4 & operator=(
XMUDECN4 && unnamedParam1
);
void XMUDECN4(
uint32_t Packed
) noexcept;
void XMUDECN4(
float _x,
float _y,
float _z,
float _w
) noexcept;
void XMUDECN4(
const float *pArray
) noexcept;
void operator uint32_t() noexcept;
XMUDECN4 & operator=(
uint32_t Packed
) noexcept;
};
Members
x
Unsigned integer value in the range [0, 1023] describing the x-coordinate of the vector.
y
Unsigned integer value in the range [0, 1023] describing the y-coordinate of the vector.
z
Unsigned integer value in the range [0, 1023] describing the z-coordinate of the vector.
w
Unsigned integer value in the range [0, 3] describing the w-coordinate of the vector.
v
Unsigned 32-bit integer representing the 4D vector.
Default constructor for XMUDECN4
.
Default constructor for XMUDECN4 .
void XMUDECN4( const XMUDECN4 & unnamedParam1)
A constructor for XMUDECN4
.
A constructor for XMUDECN4 .
XMUDECN4 & operator=( const XMUDECN4 & unnamedParam1)
void XMUDECN4( XMUDECN4 && unnamedParam1)
A constructor for XMUDECN4
.
A constructor for XMUDECN4 .
XMUDECN4 & operator=( XMUDECN4 && unnamedParam1)
Assigns the vector component data from one instance of XMUDECN4
to the current instance of XMUDECN4
.
This operator assigns the vector component data from one instance of XMUDECN4 to the current instance of XMUDECN4
.
void XMUDECN4( uint32_t Packed) noexcept
Initializes a new instance of XMUDECN4
from a uint32_t
variable containing
component data in a packed format.
This constructor initializes a new instance of XMUDECN4 from a
uint32_t
variable containing component data in a packed format.
void XMUDECN4( float _x, float _y, float _z, float _w) noexcept
This constructor initializes a new instance of XMUDECN4 from four
normalized float
arguments.
void XMUDECN4( const float *pArray) noexcept
Initializes a new instance of XMUDECN4 from a four element float
array argument.
This constructor initializes a new instance of XMUDECN4 from a four element float
array argument.
void operator uint32_t() noexcept
Returns an instance of uint32_t
containing the components of the XMUDECN4
instance in a packed format.
Returns an instance of uint32_t
containing the components of the XMUDECN4 instance in a packed format.
XMUDECN4 & operator=( uint32_t Packed) noexcept
Assigns the vector component data packed in an instance of uint32_t
to the current
instance of XMUDECN4
.
This operator assigns the vector component data packed in an instance of uint32_t
to
the current instance of XMUDECN4.
Remarks
Those XMUDECN4
constructors using floating point arguments require normalized input,
which must be in the range of [0.-1.0]. During instantiation, the inputs specifying the x-, y-,
and z-components are multiplied by 1023.0f, and the w-component are multiplied by 3.0f.
The results are rounded, and then assigned to the appropriate members of XMUDECN4
.
You can use XMUDECN4
to load instances of XMVECTOR from normalized values
by using XMLoadUDecN4, which divides the x-, y-, and
z-components by 1023.0f, divides the w-component by 3.0f, rounds the result, and then assigns
the components to an XMVECTOR
instance.
XMVECTOR
instances containing normalized values can be stored into XMUDECN4
using XMStoreUDecN4, which multiplies the x-, y-, and z-components by
1023.0f, multiplies the w-component by 3.0f, and rounds the result before assigning the values
to the appropriate XMUDECN4
members.
Namespace: Use DirectX::PackedVector
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
Requirement | Value |
---|---|
Header | directxpackedvector.h |