Something about XNA math lib

Source: Internet
Author: User

typedef __m128 Xmvector;

To summarize,
1. Use Xmvector for local or global variables.
2. Use XMFLOAT2, XMFLOAT3, and XMFLOAT4 for class data members. (because it is 128bits, it is definitely not available as class data members.)
3. Use loading functions to convert from xmfloat* to Xmvector before doing calculations.

// Loads XMFLOAT2 into Xmvector Xmvector XMLOADFLOAT2 (CONST XMFLOAT2 *psource); // Loads XMFLOAT3 into Xmvector Xmvector XMLOADFLOAT3 (CONST XMFLOAT3 *psource); // Loads XMFLOAT4 into Xmvector Xmvector XMLoadFloat4 (CONST XMFLOAT4 *psource);

4. Do calculations with Xmvector instances.
5. Use storage functions to convert from Xmvector to xmfloat*.

// Loads xmvector into XMFLOAT2 VOID XMStoreFloat2 (XMFLOAT2 *pdestination, fxmvector V); // Loads xmvector into XMFLOAT3 VOID XMSTOREFLOAT3 (XMFLOAT3 *pdestination, fxmvector V); // Loads xmvector into XMFLOAT4 VOID XMStoreFloat4 (XMFLOAT4 *pdestination, Fxmvector V);

Something about XNA math lib

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.