BlueRoseNote/04-ComputerGraphics/Directx12/DirectX12学习笔记(1)——DirectXMath库.md
2023-06-29 11:55:02 +08:00

36 lines
663 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: DirectX12学习笔记1——DirectXMath库
date: 2023-03-01 19:39:43
excerpt:
tags:
rating: ⭐
---
DXM库利用**SIMD(单指令多数据)** 可以仅使用一条指令就同时完成多个数据的运算或处理。
# 向量
需要包含头文件
```c++
#include <DirectXMath.h>
#include <DirectXPackedVector.h>
```
`DirectXPackedVector.h`的代码主要位于`DirectX::PackedVector`中。
## Type
- XMVECTOR
- XMFLOAT2
- XMFLOAT3
- XMFLOAT4
## Method
- XMLoadFloat()XMFLOAT =>XMVECTOR
- XMStoreFloat()XMVECTOR => XMFLOAT
- XMVectorGet()
- XMVectorSet()
# 矩阵
## Type
- XMMATRIX代表一个4x4矩阵
## Method
- XMMAtrixSet