1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-09 14:10:09 +00:00

Minor comment and parameter update to make it clear XMPlaneTransform(Stream) expects the inverse transpose

This commit is contained in:
Chuck Walbourn 2022-01-17 00:33:20 -08:00
parent 581534ea5f
commit 332fb99d07
2 changed files with 15 additions and 11 deletions

View File

@ -1559,11 +1559,15 @@ namespace DirectX
XMVECTOR XM_CALLCONV XMPlaneNormalize(FXMVECTOR P) noexcept;
XMVECTOR XM_CALLCONV XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTOR LinePoint2) noexcept;
void XM_CALLCONV XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, _Out_ XMVECTOR* pLinePoint2, _In_ FXMVECTOR P1, _In_ FXMVECTOR P2) noexcept;
XMVECTOR XM_CALLCONV XMPlaneTransform(FXMVECTOR P, FXMMATRIX M) noexcept;
XMFLOAT4* XM_CALLCONV XMPlaneTransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (PlaneCount - 1)) XMFLOAT4* pOutputStream,
// Transforms a plane given an inverse transpose matrix
XMVECTOR XM_CALLCONV XMPlaneTransform(FXMVECTOR P, FXMMATRIX ITM) noexcept;
// Transforms an array of planes given an inverse transpose matrix
XMFLOAT4* XM_CALLCONV XMPlaneTransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4) + OutputStride * (PlaneCount - 1)) XMFLOAT4* pOutputStream,
_In_ size_t OutputStride,
_In_reads_bytes_(sizeof(XMFLOAT4) + InputStride * (PlaneCount - 1)) const XMFLOAT4* pInputStream,
_In_ size_t InputStride, _In_ size_t PlaneCount, _In_ FXMMATRIX M) noexcept;
_In_ size_t InputStride, _In_ size_t PlaneCount, _In_ FXMMATRIX ITM) noexcept;
XMVECTOR XM_CALLCONV XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal) noexcept;
XMVECTOR XM_CALLCONV XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3) noexcept;

View File

@ -1217,7 +1217,7 @@ inline void XM_CALLCONV XMPlaneIntersectPlane
inline XMVECTOR XM_CALLCONV XMPlaneTransform
(
FXMVECTOR P,
FXMMATRIX M
FXMMATRIX ITM
) noexcept
{
XMVECTOR W = XMVectorSplatW(P);
@ -1225,10 +1225,10 @@ inline XMVECTOR XM_CALLCONV XMPlaneTransform
XMVECTOR Y = XMVectorSplatY(P);
XMVECTOR X = XMVectorSplatX(P);
XMVECTOR Result = XMVectorMultiply(W, M.r[3]);
Result = XMVectorMultiplyAdd(Z, M.r[2], Result);
Result = XMVectorMultiplyAdd(Y, M.r[1], Result);
Result = XMVectorMultiplyAdd(X, M.r[0], Result);
XMVECTOR Result = XMVectorMultiply(W, ITM.r[3]);
Result = XMVectorMultiplyAdd(Z, ITM.r[2], Result);
Result = XMVectorMultiplyAdd(Y, ITM.r[1], Result);
Result = XMVectorMultiplyAdd(X, ITM.r[0], Result);
return Result;
}
@ -1236,12 +1236,12 @@ inline XMVECTOR XM_CALLCONV XMPlaneTransform
_Use_decl_annotations_
inline XMFLOAT4* XM_CALLCONV XMPlaneTransformStream
(
XMFLOAT4* pOutputStream,
XMFLOAT4* pOutputStream,
size_t OutputStride,
const XMFLOAT4* pInputStream,
size_t InputStride,
size_t PlaneCount,
FXMMATRIX M
FXMMATRIX ITM
) noexcept
{
return XMVector4TransformStream(pOutputStream,
@ -1249,7 +1249,7 @@ inline XMFLOAT4* XM_CALLCONV XMPlaneTransformStream
pInputStream,
InputStride,
PlaneCount,
M);
ITM);
}
//------------------------------------------------------------------------------