XMVector4Reflect 函数 (directxmath.h)
反映跨 4D 法向量的事件 4D 向量。
语法
XMVECTOR XM_CALLCONV XMVector4Reflect(
[in] FXMVECTOR Incident,
[in] FXMVECTOR Normal
) noexcept;
参数
[in] Incident
要反射的 4D 事件向量。
[in] Normal
4D 法线向量,用于反映事件向量。
返回值
返回反射的事件角度。
注解
以下伪代码演示函数的操作:
XMVECTOR Result;
float s = 2.0f * dot(Incident, Normal);
Result.x = Incident.x - s * Normal.x;
Result.y = Incident.y - s * Normal.y;
Result.z = Incident.z - s * Normal.z;
Result.w = Incident.w - s * Normal.w;
return Result;
平台要求
Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012 与 Windows 8 Windows SDK。 支持 Win32 桌面应用、Windows 应用商店应用和 Windows Phone 8 应用。要求
要求 | 值 |
---|---|
目标平台 | Windows |
标头 | directxmath.h (包括 DirectXMath.h) |