XMBYTEN2 structure (directxpackedvector.h)
A 2D vector for storing signed, normalized values as signed 8-bits (1 byte) integers.
For a list of additional functionality such as constructors and operators that are available using XMBYTEN2
when you
are programming in C++, see XMBYTEN2 Extensions.
Syntax
struct XMBYTEN2 {
union {
struct {
int8_t x;
int8_t y;
};
uint16_t v;
};
void XMBYTEN2();
void XMBYTEN2(
const XMBYTEN2 & unnamedParam1
);
XMBYTEN2 & operator=(
const XMBYTEN2 & unnamedParam1
);
void XMBYTEN2(
XMBYTEN2 && unnamedParam1
);
XMBYTEN2 & operator=(
XMBYTEN2 && unnamedParam1
);
void XMBYTEN2(
uint16_t Packed
) noexcept;
void XMBYTEN2(
int8_t _x,
int8_t _y
) noexcept;
void XMBYTEN2(
const int8_t *pArray
) noexcept;
void XMBYTEN2(
float _x,
float _y
) noexcept;
void XMBYTEN2(
const float *pArray
) noexcept;
XMBYTEN2 & operator=(
uint16_t Packed
) noexcept;
};
Members
x
Signed 8-bit integer value in the range [-127, 127] describing the x-coordinate of the vector.
y
Signed 8-bit integer value in the range [-127, 127] describing the y-coordinate of the vector.
v
Default constructor for XMBYTEN2
Default constructor for XMBYTEN2.
void XMBYTEN2( const XMBYTEN2 & unnamedParam1)
A constructor for XMBYTEN2
A constructor for XMBYTEN2.
XMBYTEN2 & operator=( const XMBYTEN2 & unnamedParam1)
Assigns the vector component data from one instance of XMBYTEN2
to the current instance of XMBYTEN2
.
This operator assigns the vector component data from one instance of XMBYTEN2 to the current instance of XMBYTEN2
.
void XMBYTEN2( XMBYTEN2 && unnamedParam1)
A constructor for XMBYTEN2
A constructor for XMBYTEN2.
XMBYTEN2 & operator=( XMBYTEN2 && unnamedParam1)
void XMBYTEN2( uint16_t Packed) noexcept
A constructor for XMBYTEN2
A constructor for XMBYTEN2.
void XMBYTEN2( int8_t _x, int8_t _y) noexcept
Initializes a new instance of XMBYTEN2
from two int8_t
arguments.
This constructor initializes a new instance of XMBYTEN2 from two int8_t
arguments.
void XMBYTEN2( const int8_t *pArray) noexcept
Initializes a new instance of XMBYTEN2 from a two-element int8_t
array argument.
This constructor initializes a new instance of XMBYTEN2 from a two-element int8_t
array argument.
void XMBYTEN2( float _x, float _y) noexcept
Initializes a new instance of XMBYTEN2
from two float
arguments.
This constructor initializes a new instance of XMBYTEN2 from two float
arguments.
void XMBYTEN2( const float *pArray) noexcept
Initializes a new instance of XMBYTEN2 from a two-element float
array argument.
This constructor initializes a new instance of XMBYTEN2 from a two-element float
array argument.
XMBYTEN2 & operator=( uint16_t Packed) noexcept
Remarks
Those XMBYTEN2
constructors using floating point arguments require normalized input, which must be in the range of
[0.0.-1.0]. During instantiation, this data is multiplied by 127.0f, results are rounded, and then assigned to the
appropriate members of XMBYTEN2
.
XMBYTEN2
can be used to load instances of XMVECTOR from normalized values,
by using XMLoadByteN2, which divides each component 127.0f, rounds the result,
and then assigns the components to an XMVECTOR
instance.
XMVECTOR
instances containing normalized values can be stored into XMBYTEN2
using
XMStoreByteN2, which multiplies each component by 127.0f, rounding the result, before assigning
the values to the appropriate XMBYTEN2
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 |