SP3-16 Slight rework to SHColour for compatibility #159
|
@ -191,7 +191,7 @@ namespace SHADE
|
|||
|
||||
SHVec4 SHMatrix::operator*(const SHVec4& rhs) const noexcept
|
||||
{
|
||||
return SHVec4::Transform3D(rhs, *this);
|
||||
return SHVec4::Transform(rhs, *this);
|
||||
}
|
||||
|
||||
SHMatrix SHMatrix::operator*(float rhs) const noexcept
|
||||
|
|
|
@ -445,9 +445,7 @@ namespace SHADE
|
|||
{
|
||||
SHVec3 result;
|
||||
|
||||
const XMMATRIX TF = XMLoadFloat4x4(&transformMtx);
|
||||
|
||||
XMStoreFloat3(&result, XMVector3TransformCoord(v, TF));
|
||||
XMStoreFloat3(&result, XMVector3TransformCoord(v, transformMtx));
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -460,13 +460,19 @@ namespace SHADE
|
|||
return result;
|
||||
}
|
||||
|
||||
SHVec4 SHVec4::Transform(const SHVec4& v, const SHMatrix& transformMtx) noexcept
|
||||
{
|
||||
SHVec4 result;
|
||||
|
||||
XMStoreFloat4(&result, XMVector4Transform(v, transformMtx));
|
||||
return result;
|
||||
}
|
||||
|
||||
SHVec4 SHVec4::Transform3D(const SHVec4& v, const SHMatrix& transformMtx) noexcept
|
||||
{
|
||||
SHVec4 result;
|
||||
|
||||
const XMMATRIX TF = XMLoadFloat4x4(&transformMtx);
|
||||
|
||||
XMStoreFloat4(&result, XMVector3TransformCoord(v, TF));
|
||||
XMStoreFloat4(&result, XMVector3TransformCoord(v, transformMtx));
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -134,6 +134,7 @@ namespace SHADE
|
|||
[[nodiscard]] static SHVec4 Project3D (const SHVec4& v, const SHVec4& u) noexcept;
|
||||
[[nodiscard]] static SHVec4 Reflect (const SHVec4& v, const SHVec4& normal) noexcept;
|
||||
[[nodiscard]] static SHVec4 Reflect3D (const SHVec4& v, const SHVec4& normal) noexcept;
|
||||
[[nodiscard]] static SHVec4 Transform (const SHVec4& v, const SHMatrix& transformMtx) noexcept;
|
||||
[[nodiscard]] static SHVec4 Transform3D (const SHVec4& v, const SHMatrix& transformMtx) noexcept;
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue