Fonction XMSHORTN2::XMSHORTN2(constfloat*) (directxpackedvector.h)
Initialise une nouvelle instance de XMSHORTN2 à partir d’un argument de tableau à deux élémentsfloat
.
Ce constructeur initialise une nouvelle instance de XMSHORTN2 à partir d’un argument de tableau à deux élémentsfloat
.
Syntaxe
void XMSHORTN2(
const float *pArray
) noexcept;
Paramètres
pArray
Tableau à virgule flottante à deux éléments contenant les valeurs utilisées pour initialiser les deux composants d’une nouvelle instance de XMSHORTN2.
Valeur de retour
None
Notes
Les éléments de tableau sont mappés aux composants vectoriels d’une nouvelle instance de XMSHORTN2 comme suit :
Composant Vector | Array, élément | Plage | Description |
---|---|---|---|
x | pArray[0] | -1.0, 1.0 | Pendant l’instanciation, pArray[0] est limité entre -1 et 1, multiplié par 32767.0f et affecté à x. |
y | pArray[1] | -1.0, 1.0 | Pendant l’instanciation, pArray[1] est limité entre -1 et 1, multiplié par 32767.0f, puis affecté à y. |
Le pseudo-code suivant illustre l’opération de ce constructeur :
XMSHORTN2 instance;
_x1=min( max( pArray[0], -1.0 ), 1.0 );
_y1=min( max( pArray[1], -1.0 ), 1.0 );
_x1 = round( _x1 * 32767.0f);
_y1 = round( _y1 * 32767.0f);
instance._x = _x1;
instance._y = _y1;
Spécifications
Plateforme cible | Windows |
En-tête | directxpackedvector.h |
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour