DirectX中的XMVECTOR

问题描述 投票:-1回答:2

对不起,愚蠢的问题....但是为什么这不起作用?为了显示问题,我编写了以下简单代码:

#include <windows.h> 
#include <DirectXMath.h>
#include <DirectXPackedVector.h>
#include <iostream>
using namespace std;
using namespace DirectX;
using namespace DirectX::PackedVector;

int main()
{
XMVECTOR c = XMVECTORSet(3.0f, 3.0f, 3.0f, 3.0f);

return 0;
}

VS回答“错误C3861:'XMVECTORSet':找不到标识符”

c++ directx directxmath
2个回答
1
投票

您应该使用XMVectorSet而不是XMVECTORSet(此功能不存在)


1
投票

有多种方法可以初始化DirectXMath的向量常量。当参数是浮点型变量而不是文字值时,XMVectorSet最佳。

© www.soinside.com 2019 - 2024. All rights reserved.