XMUHENDN3 Structure
A 3D vector for storing unsigned, normalized values as 11 bit unsigned x-,and y- components and a 10 bit unsigned z-component.
For a list of additional functionality such as constructors and operators that are available using XMUHENDN3 when you are programming in C++, see XMUHENDN3 Extensions.
Note
See XNA Math Library Type Equivalences for information about equivalent D3DDECLTYPE, D3DFORMAT, and DXGI_FORMAT objects.
Syntax
typedef struct _XMUHENDN3 {
union {
struct {
UINT x : 11;
UINT y : 11;
UINT z : 10;
};
UINT v;
};
} XMUHENDN3;
Members
x
Unsigned integer value in the range [0, 2047] describing the x-coordinate of the vector.y
Unsigned integer value in the range [0, 2047] describing the y-coordinate of the vector.z
Unsigned integer value in the range [0, 1023] describing the z-coordinate of the vector.v
Unsigned 32-bit integer representing the 3D vector.
Remarks
Those XMUHENDN3 constructors using floating point arguments require normalized input, which must be in the range of [0.0.-1.0]. During instantiation, the inputs specifying the x- and y-components are multiplied by 2047.0f and the w-component by 1023.0f, these results are rounded and then assigned to the appropriate members of XMUHENDN3.
XMUHENDN3 can be used to load instances of XMVECTOR from normalized values, by using XMLoadUHenDN3, which divides the x- and y-components by 2047.0f and the w-component by 1023.0f, rounds the result, and then assigns the components to an XMVECTOR instance.
XMVECTOR instances containing normalized values can be stored into XMUHENDN3 using XMStoreUHenDN3, which multiplies the x-, and y-components by 2047.0f and the w-component by 1023.0f, rounding the result, before assigning the values to the appropriate XMUHENDN3 members.
Requirements
Header: Declared in xnamath.h.