XMSHORT2::XMSHORT2(constfloat) function (directxpackedvector.h)

Initializes a new instance of XMSHORT2 from a two element float array argument.

This constructor initializes a new instance of XMSHORT2 from a two element float array argument.

Note  This constructor is only available under C++.

Syntax

void XMSHORT2(
  const float *pArray
);

Parameters

pArray

Two element float array containing the values used to initialize the two components of a new instance of XMSHORT2.

Return value

None

Remarks

The magnitude of each member of the pArray argument to the constructor will be clamped to the range supported by an 16-bit signed integer [-32767.0, 32767.0].

The following pseudocode demonstrates the operation of this constructor:

XMSHORT2 instance;

instance.x = (int16_t)min( max( pArray[0] -32767.0 ), 32767.0 );
instance.y = (int16_t)min( max( pArray[1] -32767.0 ), 32767.0 );

Requirements

   
Target Platform Windows
Header directxpackedvector.h

See also

XMSHORT2

XMSHORT2 Constructors