mirror of
https://github.com/AxioDL/zeus.git
synced 2025-06-15 11:03:27 +00:00
Add clip-space constructor for CVector4f
This commit is contained in:
parent
8a062453ef
commit
1347e23597
@ -117,6 +117,13 @@ public:
|
|||||||
return xfVec.toVec3f() / xfVec.w;
|
return xfVec.toVec3f() / xfVec.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline CVector3f multiplyOneOverW(const CVector3f& point, float& wOut) const
|
||||||
|
{
|
||||||
|
CVector4f xfVec = *this * point;
|
||||||
|
wOut = xfVec.w;
|
||||||
|
return xfVec.toVec3f() / xfVec.w;
|
||||||
|
}
|
||||||
|
|
||||||
union {
|
union {
|
||||||
float m[4][4];
|
float m[4][4];
|
||||||
struct
|
struct
|
||||||
|
@ -89,6 +89,13 @@ public:
|
|||||||
w = 1.0f;
|
w = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static CVector4f ToClip(const zeus::CVector3f& v, float w)
|
||||||
|
{
|
||||||
|
CVector4f ret(v * w);
|
||||||
|
ret.w = w;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
inline CVector3f toVec3f() const
|
inline CVector3f toVec3f() const
|
||||||
{
|
{
|
||||||
#if __SSE__
|
#if __SSE__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user